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));
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.