orientation of connected component in a binary image

8 views (last 30 days)
hi friends can some one help me in finding orientation of each connected component in a binary image. To be more clear in the above image how to calculate that how much each white region is inclined? Basically i am working in number plate detection. I am able to locate number plate but some times number plate is locating but in parts. So depending on difference between angle of inclination of two connected regions i want to combine that particular two regions.
Thanks

Accepted Answer

Image Analyst
Image Analyst on 21 Jan 2013
Call regionprops(), asking it to return 'Orientation'. See my image segmentation tutorial if you need help.
  2 Comments
srikanth
srikanth on 30 Jan 2013
thanks Image analyst regionprops() is working good but when i am subtracting between two angles matlab is giving an error saying "Undefined function or method 'minus' for input arguments of type 'struct'."
Image Analyst
Image Analyst on 30 Jan 2013
You can't subtract the structures. The structure could have lots of members representing area, angles, perimeters, etc. You need to extract the angles and then subtract them.
allAngles = [measurements.Orientation];
differenceAngle = allAngles(3) - allAngles(1); % Or whatever you want to subtract.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!