Binary image morphological operation for complete broken lines
조회 수: 1 (최근 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!