Ask Your Question
0

How do I get properties from fitEllipse() rotatedrect?

asked 2013-07-27 18:38:32 -0500

blip gravatar image

If I use the fitEllipse() function on a blob, how do I get:

length, width, center, orientation

of its returned rotatedrect?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2013-07-27 19:34:29 -0500

The RotatedRect has the following fields: center, angle and size, where size as width and height fields.

cv::RotatedRect r = cv::fitEllipse(...);
std::cout << "Length: " << r.size.height << ", Width: " << r.size.width
    << ", Center: (" << r.center.x << "," << r.center.y << ")"
    << ", Orientation: " << r.angle << std::endl;
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

Stats

Asked: 2013-07-27 18:38:32 -0500

Seen: 1,023 times

Last updated: Jul 27 '13