1 | initial version |
Once you have a series of contours, you can convert them to according circles by using
vector< vector<Point> > contours;
vector< Point2f > centers;
vector< float > radiuses;
for(size_t i =0; i<contours.size(); i++){
Point2f center;
float radius;
minEnclosingCircle(contours[i], center, radius);
centers.push_back(center);
radiuses.push_back(radius);
}
// Now you can draw each one of them by using the circle command
You are welcome!