Ask Your Question

How to find the corners of a rectangular contour in pixel points?

asked 2016-01-13 05:11:43 -0500

Gren8 gravatar image


i want to know how i can find the pixel postion of the corner points of a rectangular contour? With findcontours() and moments() i find the mass center of the contour but know i need the corner points.

Or even better is there a possibility to find the the angular orientation of the rectangle?

Please help it's important for me.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2016-01-13 06:08:20 -0500

thdrksdfthmn gravatar image

If the rectangle is not rotated, then use boundigRect.

If the rectangle may be rotated, then use minAreaRect; the corners can be computed from it.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2016-01-13 05:11:43 -0500

Seen: 3,223 times

Last updated: Jan 13 '16