Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Remove small spurs, but keep the longest line

Hi, 

 

I need to remove the small spurs on this line, but I have to keep the longest line, because I need this for tracking. I tried using imaq extract curves, but I know it is not designed for binary pictures.

Anyone  got an idea to track the longest line or how I can remove the small spurs without deleting pixels from the long line?

 

Thanks, Esben. 

 

Line2 

 

 Line1

0 Kudos
Message 1 of 3
(3,382 Views)
Try eroding with customizing the kernel elements. And dilate when you see the spur getting invisible.
Message 2 of 3
(3,380 Views)
I need it to be an automated system, and I tried eroding/dilating, also using hit-miss, but it removes pixels on the end of the long line...
0 Kudos
Message 3 of 3
(3,372 Views)