Recalculate binary line local orientation

Dear colleagues,
I would like to kindly ask you for the help with computing a local orientation (angles distribution) of a binary curve in each pixel of its skeleton.
I am using the function SkeletonOrientation, which is attached. This function calculates this orientation with using the function: regionprops(), with the attribute: Orientation.
Unfortunately, this function calculates angles in the range: -90°- 90°, but I need to have this range withing -180° - 180°. I did not find any alternative in MATLAB to do that. Thus, I would like to kindly ask you how to recalculate this angle’s range.
Thank you very much.

回答 (1 件)

Image Analyst
Image Analyst 2021 年 10 月 8 日

0 投票

You don't need that. For example 170 degrees for a line is the same as -10 degrees. If it makes you feel better, just randomly add or subtract 180 from the angle.

カテゴリ

ヘルプ センター および File ExchangeParticle & Nuclear Physics についてさらに検索

質問済み:

2021 年 10 月 8 日

回答済み:

2021 年 10 月 8 日

Community Treasure Hunt

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

Start Hunting!

Translated by