minAreaRect from 0 to 360 angle calculation

asked 2020-01-17 04:48:45 -0600

Trab40 gravatar image

updated 2020-11-05 23:40:40 -0600

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

edit retag flag offensive close merge delete

Comments

since it is using atan : −π/2 < y < π/2

berak gravatar imageberak ( 2020-01-17 04:55:05 -0600 )edit