cvhaardetectobjects

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
}
Amused Antelope