Ask Your Question

Revision history [back]

here you can find your answer.

The answer to your problem can be found here, in the tutorial for cascade classifier based face detection. Basically all you have to do is to replace the rectangle you can find your answer.functionality by the circle functionality and calculate the center and diameter of the circle based on the bounding box's dimensions.

The answer to your problem can be found here, in the tutorial for cascade classifier based face detection. Basically all you have to do is to replace the rectangle functionality by the circle functionality and calculate the center and diameter of the circle based on the bounding box's dimensions.dimensions.

Point center;
int radius;

center.x = cvRound((rect.x + rect.width*0.5));
center.y = cvRound((rect.y + rect.height*0.5));
radius = cvRound((rect.width + rect.height)*0.25);
circle( image, center, radius, Scalar(0,255,0), 3, 8, 0 );