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: |
|
|---|
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

这篇博客介绍了OpenCV中的FeatureDetector类及其在特征检测中的应用,如FAST, STAR, SIFT, SURF等。同时讲解了BOWImgDescriptorExtractor如何用于图像描述符的计算,涉及关键点检测、描述符提取和SVM分类器在训练与识别过程中的角色。"
106576037,9327294,C++实现最长回文子串,"['字符串算法', '动态规划', '数据结构', 'C++编程']

1万+

被折叠的 条评论
为什么被折叠?



