#include <opencv/highgui.h>
#include <opencv/cv.h>
#include <opencv2/imgproc/imgproc_c.h>
#include <opencv2/objdetect/objdetect.hpp>
using namespace std;
using namespace cv;
int main(int argc, char** argv)
{
CascadeClassifier stFaceCascade;
IplImage *pstImage = NULL;
std::vector<Rect> faceRects;
if( !stFaceCascade.load("D:\\softwares\\opencv\\sources\\data\\haarcascades\\haarcascade_eye_tree_eyeglasses.xml") )
{
printf("Loading cascade error\n");
return -1;
}
pstImage = cvLoadImage("C:\\Users\\TheOne\\Documents\\mianbubiaoqig\\jaffeimages\\jaffe\\KA.AN1.39.tiff", CV_LOAD_IMAGE_COLOR);
stFaceCascade.detectMultiScale(pstImage,
faceRects, //检出结果
1.1, //缩放步长
2, //框融合时的最小检出个数
0|CV_HAAR_SCALE_IMAGE,//标志 |CV_HAAR_FIND_BIGGEST_OBJECT|CV_HAAR_DO_ROUGH_SEARCH|CV_HAAR_DO_CANNY_PRUNING
Size(30, 30), //最小人脸尺寸
Size(300, 30
opencv中人眼中心的检测(C++)
最新推荐文章于 2022-05-02 11:26:38 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)