Adjust regionprops orientation in order to get 360 degree value.

2 views (last 30 days)
I have a point at an end of an ellipse that I am considering the 'head' and I want to get the "orientation" of this ellipse from 0-360 degrees with the head point facing directly up as 0 degrees. I understand that the Orientation field in regionprops works on the X axis from 0 to -90 degrees. How can I adjust this information to fit my goal.
  2 Comments
KAE
KAE on 12 Sep 2019
Is the ellipse you have in an image? regionprops is for images.
Matt J
Matt J on 12 Sep 2019
I want to get the "orientation" of this ellipse from 0-360 degrees
I assume you really mean 0-180.

Sign in to comment.

Answers (1)

Matt J
Matt J on 12 Sep 2019
Edited: Matt J on 12 Sep 2019
theta = 90-Orientation
assuming theta increases clockwise.
  1 Comment
KAE
KAE on 12 Sep 2019
Edited: KAE on 12 Sep 2019
The angle definition of regionprops orientation can trip you up. In Matlab all images have the y-axis reversed, so y=0 is at the image top. The angle is defined to be CCW from the x-axis to the shape's main axis, when seen with the y-axis reversed. Just a cautionary note which is not spelled out in the documentation page for regionprops.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!