How to detect the Hexagon in imageprocessing?

 Réponse acceptée

Image Analyst
Image Analyst le 27 Déc 2013

0 votes

Get the boundary of the object with bwboundaries(). Then find out if there are 6 kinks in the boundaries with the FAQ. Then see if the lengths of the sides are similar enough to be considered a hexagon rather than just some arbitrary 6-sided polygon. Also make sure it's convex by checking that the solidity is really close to 1.

2 commentaires

saravanakumar D
saravanakumar D le 31 Déc 2013
How to find out the number of kinks? I searched in FAQ, but i didn't find anything regarding. So please tell me about how to find the number of kinks and how to measure the length of side
Image Analyst
Image Analyst le 31 Déc 2013
From the code the FAQ directs you to, it would be length(xStar). The distance is just the simple Pythagorean theorem, so use diff() and sqrt().

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by