Binary image morphological operation for complete broken lines
2 ビュー (過去 30 日間)
古いコメントを表示
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 :
original image
after subtract
PLEASE HELP. thanks
0 件のコメント
採用された回答
Image Analyst
2016 年 6 月 26 日
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 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!