How to detect Triange and Hexagone?

Anybody please tell the algorithm to detect the Triangle and Hexagone shapes in pictures

 Accepted Answer

Image Analyst
Image Analyst on 31 Dec 2013
Depends on what the picture looks like. If it's just a picture of a random snapshot of a city scene, then it could be difficult. If you already have the binary image, it's a lot easier. Maybe try corner() in the Image Processing Toolbox, or, depending on how perfect the shapes are you could call regionprops() and look at the Perimeter^2/(4*pi*area) ratio, which will be different for the two shapes.

6 Comments

I have binary image contain some Triangles,square,circle and Hexagone. What i have to do?
Look at the circularity ratio like I suggested. If you need help with regionprops, see my tutorial at http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862. It will show you how to measure things like area, etc. Just change the image to your image and try it.
I have binary image. May i go with corner() function to detect the Hexagone and Triangle?
That's one way to do it. I'd probably go with regionprops because it's easier but whatever works....
Corner() function didn't work for me. It just returns and 200 points on the boundries of the Triangle. It just show the points on corner.
Alright, so try regionprops.

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!