BruteForceMatcher报错“无法识别的标识符”

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/qq_33591712/article/details/83582639

对于OpenCV2.4.9的解决办法:
BruteForceMatcher并不在opencv2/features2d/features2d.hpp 而是
需加入opencv2/nonfree/features2d.hpp
包含上面文件最终还需加入 opencv2/legacy/legacy.hpp。
但是对于OpenCV3,上面办法不可行
有这么一个办法:https://blog.csdn.net/qsy2000/article/details/70230827
Ptr matcher = DescriptorMatcher::create(“BruteForce”);
matcher->match(descriptors_1, descriptors_2, matches);

展开阅读全文

无法识别标识符 createFisherFaceRecognizer()

10-31

#define _CRT_SECURE_NO_DEPRECATErn#include rn#include rn#include "opencv2/core.hpp"rn#include "opencv2/core/utility.hpp"rn#include "opencv2/core/ocl.hpp"rn#include "opencv2/imgcodecs.hpp"rn#include "opencv2/highgui.hpp"rn#include "opencv2/features2d.hpp"rn#include "opencv2/calib3d.hpp"rn#include "opencv2/imgproc.hpp"rn#include"opencv2/flann.hpp"rn#include"opencv2/xfeatures2d.hpp"rn#include"opencv2/ml.hpp"rn#include"opencv2/face.hpp"rn#include"opencv2/face/facerec.hpp"rn#include"opencv2/objdetect.hpp"rnrnusing namespace cv;rnusing namespace std;rnusing namespace cv::xfeatures2d;rnusing namespace cv::ml;rnusing namespace face;rnrnint main()rnrn CascadeClassifier cas("haarcascade_frontalface_default.xml"); //加载人脸分类器rn Ptr fc = createFisherFaceRecognizer();rn Mat a1 = imread("01.jpg", CV_LOAD_IMAGE_GRAYSCALE); //加载用于训练的人脸照片rn Mat a2 = imread("02.jpg", CV_LOAD_IMAGE_GRAYSCALE);rn Mat a3 = imread("03.jpg", CV_LOAD_IMAGE_GRAYSCALE);rn Mat a4 = imread("04.jpg", CV_LOAD_IMAGE_GRAYSCALE);rn Mat a5 = imread("05.jpg", CV_LOAD_IMAGE_GRAYSCALE);rn Mat b1 = imread("11.jpg", CV_LOAD_IMAGE_GRAYSCALE);rn Mat b2 = imread("12.jpg", CV_LOAD_IMAGE_GRAYSCALE);rn Mat b3 = imread("13.jpg", CV_LOAD_IMAGE_GRAYSCALE);rn Mat b4 = imread("14.jpg", CV_LOAD_IMAGE_GRAYSCALE);rn Mat b5 = imread("15.jpg", CV_LOAD_IMAGE_GRAYSCALE);rn Mat c1 = imread("21.jpg", CV_LOAD_IMAGE_GRAYSCALE);rn Mat c2 = imread("22.jpg", CV_LOAD_IMAGE_GRAYSCALE);rn Mat c3 = imread("23.jpg", CV_LOAD_IMAGE_GRAYSCALE);rn Mat c4 = imread("24.jpg", CV_LOAD_IMAGE_GRAYSCALE);rn Mat c5 = imread("25.jpg", CV_LOAD_IMAGE_GRAYSCALE);rn。。。。。。。。rnrn上面代码中 createFisherFaceRecognizer() 提示“无法识别的标识符”,是少include了什么东东么? 请大侠指教,我用的opencv3.3版本。rn 论坛

没有更多推荐了,返回首页