How to remove bridged lines/branches between lines in image?
2 views (last 30 days)
Show older comments
Hi,
I would like to remove certain lines which are not the main parallel lines, that is, all the horizontally connected bridges and spurs.
This is my thinedImage:
I have tried disconnecting the branches by using:
bp=bwlookup(thinedImage, makelut(@(x) sum(x(:))>=4 & x(5)==1,3)); %branch points?
filteredIm=thinedImage&~bp;
I then try to perform a bwareaopen(filteredIm, 50) and get this:
Basically everything on the left hand side is fine, but I have removed too much from the right hand side. How do I keep the major line, removing only the smaller branches?
I have also tried using
thinedImage - bwmorph(thinedImage, 'spur', Inf);
in the 2nd step, but that doesnt turn out too wel either.
2 Comments
Walter Roberson
on 23 Jan 2019
Perhaps use hough() with a range of theta that are close to 0, and then houghlines() to detect lines at those angles?
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!