I have a binary image with curved lines as shown below, but I would like to know how I can find where they would intersect if they are extended.
So could you give me some ides on how i could:
I have thought about using hough transform to find lines, then intersection, but in some images my line endpoints are not exactly straight. Is there a way to maybe only find the direction of the line at the end of it instead of over the whole line, as it is a binary image?
Thanks for any help
Applying a dilation and then an erosion will extend your endpoints like this:
(*Code in Mathematica*)
Erosion[Dilation[i, 10], 10]
A full solution could be something like this:
r = Dilation[MorphologicalBranchPoints[
Thinning[Binarize@Erosion[Dilation[i, 10], 10], 10]] // Colorize, 3]
ImageAdd[i, r]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With