Ask Your Question

Revision history [back]

i tested the given image by adding the lines below. it seems @slycheese is right.

"classifier's ability to find the face in the image is dependent on the dimensions/position of the ROI I give it"

/*** Mod begin */
if(!inputName.empty())
{
    frame = cv::imread(inputName);

    for(int percent = 100; percent > 40; percent-- )
    {
        Rect newroi;
        newroi.width=(frame.cols*percent)/100;
        newroi.height=(frame.rows*percent)/100;
        newroi.x=(frame.cols-newroi.width)/2;
        newroi.y=(frame.rows-newroi.height)/2;

        Mat shrinked = frame(newroi).clone();
        detectAndDisplay( shrinked );
        waitKey();
    }
}
else
    /*** Mod end */