c++ - OpenCV: Why does Haar classifier only detect one face and one eye? -
i absolutely newcomer opencv , haar classifiers. have copied following code , works fine, returns 1 face , 1 eye. second eye , face? const char[] eyescascadefilename = "haarcascade_eye.xml"; const char[] facecascadefilename = "haarcascade_frontalface_alt2.xml"; const int haaroptions = cv_haar_do_rough_search; // prepare image fast processing mat grayimage; cvtcolor(colorimage, grayimage, cv_bgr2gray); equalizehist(grayimage, grayimage); // detect faces on image std::vector<cv::rect> faces; facecascade.detectmultiscale(grayimage, faces, 1.1, 2, haaroptions, cv::size(60, 60)); (int = 0; < faces.size(); i++) { // visualize faces cv::point pt1(faces[i].x + faces[i].width, faces[i].y + faces[i].height); cv::point pt2(faces[i].x, faces[i].y); cv::rectangle(colorimage, pt1, pt2, cvscalar(0, 255, 0, 0), 1, 8 ,0); // detect eyes within facial roi cv::rect rect(faces[