Binary image morphological operation for complete broken lines
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Ahmad
am 26 Jun. 2016
Beantwortet: Image Analyst
am 26 Jun. 2016
Hello there, How can i complete these Broken lines using morphological operation on binary image, and after that count the lines. I've got this image from subtracting circles from original image as shown :
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/154468/image.jpeg)
original image
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/154470/image.jpeg)
after subtract
PLEASE HELP. thanks
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 26 Jun. 2016
You have to label the "original" binary image:
[labeledImage, numRegions] = bwlabel(binaryImage);
Then you have to call regionprops() on the subtracted image and ask for the 'Centroid', 'MajorAxisLength' and 'MinorAxisLength'. Then for each centroid, examine the labeled image and see if the other centroids have the same label. If they do, then they were part of the original blob and got broken into two or more parts. So you'd have to reconnect them in the subtraction image with lines. I attach a demo for burning a line into an image.
Now the regions are connected again but you may have crossed lines. To find lines that are crossed, like X, or connected at the ends, like L or T or E. To find crossed lines, call bwmorph() and ask for endpoints. To find shapes like L, T or E, examine the ratio of major axis length to minor axis length.
See my Image Segmentation Tutorial if you need more guidance. http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862
0 Kommentare
Weitere Antworten (0)
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!