unified the coordinate interpretation in RotatedRect (ticket #425)
This commit is contained in:
@@ -71,12 +71,16 @@ void processImage(int h, void*)
|
||||
Mat(contours[i]).convertTo(pointsf, CV_32F);
|
||||
RotatedRect box = fitEllipse(pointsf);
|
||||
|
||||
box.angle = -box.angle;
|
||||
if( MAX(box.size.width, box.size.height) > MIN(box.size.width, box.size.height)*30 )
|
||||
continue;
|
||||
drawContours(cimage, contours, (int)i, Scalar::all(255), 1, 8);
|
||||
|
||||
ellipse(cimage, box, Scalar(0,0,255), 1, CV_AA);
|
||||
ellipse(cimage, box.center, box.size*0.5f, box.angle, 0, 360, Scalar(0,255,255), 1, CV_AA);
|
||||
Point2f vtx[4];
|
||||
box.points(vtx);
|
||||
for( int j = 0; j < 4; j++ )
|
||||
line(cimage, vtx[j], vtx[(j+1)%4], Scalar(0,255,0), 1, CV_AA);
|
||||
}
|
||||
|
||||
imshow("result", cimage);
|
||||
|
Reference in New Issue
Block a user