轮廓 画外接圆外接矩形

轮廓 画外接圆外接矩形

for (int i = 0; i < contours_set.size(); i ++)

{
Rect rect = boundingRect(contours_set[i] );


float radius;  
Point2f center;  
minEnclosingCircle(Mat(contours_set[i]),center,radius);  

if (rect.area() > 50 && rect.width < 50 && rect.height <50)
{
mSkinObject.push_back(rect);
rectangle(img,rect,Scalar(0,255,0));
circle(img,Point(center),(radius),Scalar(0),2); 
//img0(rect).copyTo(img_masked);
}

}

你可能感兴趣的:(轮廓外接圆)