Ask Your Question

Revision history [back]

minAreaRect from 0 to 360 angle calculation

I am creating a minAreaRect around a group of points that is moving in a video. I want to be able to determine the angle of this rectangle. The below image shows the binary image I am creating the box around. The angle generated by open cv goes from -90 to 0, and wraps back when going past these angles. How can I transform this to work within a range from 0 to 360 ?

image description

minAreaRect from 0 to 360 angle calculation

I am creating a minAreaRect around a group of points that is moving in a video. I want to be able to determine the angle of this rectangle. The below image shows the binary image I am creating the box around. The angle generated by open cv goes from -90 to 0, and wraps back when going past these angles. How can I transform this to work within a range from 0 to 360 ?

image description