📜  cvhaardetectobjects - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:27.850000             🧑  作者: Mango

代码示例1
cvHaarDetectObjects() is used for detecting objects or shapes not only for faces, it depends on HaarCascade classifier.

If you pass face haarcascade xml then it will return an array of faces or also can use eye, nose, etc HaarCascade XML file. You can make also custom haarcascade xml by creating your own positive and negative samples using opencv_traincascade.exe

CvSeq faces = cvHaarDetectObjects(grayImage, classifier, storage,
                1.1, 3, CV_HAAR_DO_CANNY_PRUNING);

for (int i = 0; i < faces.total(); i++) {
   // its ok
}