Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

@lp, You are trying to detect a known object, what i understands from this line is, You must be using a already trained cascade classifier to detect the known objects in a given image :

vector<Rect> faces;

// here we are trying to detect number of faces 

FaceCascadeClassifier.detectMultiScale(image, faces, 1.1, 1, 0|CV_HAAR_SCALE_IMAGE, Size(20, 20));

cout<<"no of found faces :" <<faces.size();

for (int i = 0; i < faces.size(); i++) 
  Rect r = faces[i];
  printf("a face is found at Rect(%d,%d,%d,%d).\n", r.x, r.y, r.width, r.height);

kindly try to find such code in your code and look at width and height parameters i am printing, and i think this is what you want. Dot.