Lately, I have encountered the following problem, namely how to recognize the shapes of particular polygons. I have realized that quite straightforward to do so when the polygons are separated by using OpenCV library as shown in the following topics example 1 example 2

My question, however, is quite more complex and concerns how to detect polygons when they share a side, like for instance in the picture attached to this question

enter image description here

Anyone has any suggestions? Maybe some other tool might be able to perform such an analysis?

  • 1
    $\begingroup$ The edges form a planar graph, which is substantially easier to analyze than a picture. You need to convert the image into a graph where the vertices of the graph are the joints and the edges of the graph are line segments of the image. $\endgroup$ Jan 25 at 21:24
  • $\begingroup$ Thank you for the suggestion. It actually makes it quite easier for me to create a planar graph, since I had to post-process the simulation results (particles forms this kind of ordered network) to represent them as "smooth" polygons as shown in the post. My question is, however, what kind of algorithm would you recommend to work with the approach you suggested? $\endgroup$ Jan 25 at 22:15
  • 1
    $\begingroup$ Finding triangles corresponds to finding "cliques" in the graph. That's a standard algorithm. You'll find more information about this in computational graph theory books. $\endgroup$ Jan 26 at 19:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.