connect lines after Hough transform
Afficher commentaires plus anciens
I am working on a image (first image included here) where I need to automatically draw lines by connecting the objects oriented in particular direction (desired image is the one with red lines). I tried to address this using Hough transform. This helped too some extent, but the lines are disconnected (second figure). This might be due to distance between objects in a row. I need to connect these several small lines appearing in a row (second figure). Can someone help me to solve this problem? I am fairly new to matlab, so I would appreciate if someone can share the excerpt of codes to address this.
Also, one thing we can notice in the bottom of the second image is the multiple lines that are not parallel. Since these are unnecessary lines, I want to ignore those areas while drawing the lines. As in large portion of the image, one row runs parallel to the another (i.e., they are y distance apart from each other), can we use this relation to get rid of those nonparallel lines while drawing the lines? If one can, how can we implement this?
I look forward to your comments. Thanks.



Réponses (1)
Image Analyst
le 26 Août 2017
0 votes
You can burn the lines into the image (see attached demo program) and then either skeletonize the image or remove spurs (both can be done with bwmorph()).
2 commentaires
Sami
le 28 Août 2017
Catégories
En savoir plus sur Hough Transform dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!