opencv--feature2d之FeatureDetector

来源:互联网 发布:上古卷轴5无心捏脸数据 编辑:程序博客网 时间:2024/04/29 12:28

FaceRecognizer::onInit时直接创建了描述符对象:

descriptor_detector_ = new cv::GridAdaptedFeatureDetector();

descriptor_extractor_ = new cv::SurfDescriptorExtractor;


bowExtractor_ = new cv::BOWImgDescriptorExtractor();

训练过程,首先根据样本图像生成提取描述符。然后使用svm分类器。

1.cvtColor 将原始图像转换为灰度图像。

2.归一化直方图。

3.检测灰度图像的关键点,生成关键点。descriptor_detector_->detect

4.根据关键点,从灰度图像提取描述符。生成提取描述符。descriptor_extractor_->compute

5.将生成的提取描述符作为人的描述符。如果模型中没有描述符则直接赋值,如果已有至少一个则匹配插入。

识别检测过程:根据输入图像生成提取描述符,然后使用SVM进行预测。

FeatureDetector

class FeatureDetector : public Algorithm


Abstract base class for 2D image feature detectors.

class CV_EXPORTS FeatureDetector{public:    virtual ~FeatureDetector();    void detect( const Mat& image, vector<KeyPoint>& keypoints,                 const Mat& mask=Mat() ) const;    void detect( const vector<Mat>& images,                 vector<vector<KeyPoint> >& keypoints,                 const vector<Mat>& masks=vector<Mat>() ) const;    virtual void read(const FileNode&);    virtual void write(FileStorage&) const;    static Ptr<FeatureDetector> create( const string& detectorType );protected:...};Parameters:
  • detectorType – Feature detector type.

The following detector types are supported:

  • "FAST"FastFeatureDetector
  • "STAR"StarFeatureDetector
  • "SIFT"SIFT (nonfree module)
  • "SURF"SURF (nonfree module)
  • "ORB"ORB
  • "BRISK"BRISK
  • "MSER"MSER
  • "GFTT"GoodFeaturesToTrackDetector
  • "HARRIS"GoodFeaturesToTrackDetector with Harris detector enabled
  • "Dense"DenseFeatureDetector
  • "SimpleBlob"SimpleBlobDetector

BOWImgDescriptorExtractor::compute

 
0 0
原创粉丝点击