5
$\begingroup$

I have an image, like the one below that has different paths. I want to be able to detect the thin parts of these paths and highlight them. What is the best way to go about this? Image containing paths

$\endgroup$
0

2 Answers 2

6
$\begingroup$

Just an idea that might work. Let original image be $I_0$. Erode just enough to remove the thin lines, then dilate back to obtain $I_1$. Afterwards, obtain the difference of the $I_0$ and $I_1$.

$\endgroup$
1
  • $\begingroup$ Thinning until 1px lines appears is skeletonization, and it works ;) $\endgroup$
    – Evil
    Jul 16, 2016 at 23:48
1
$\begingroup$

I got a bit confused on your question. Are you looking for the paths that are thin? or are you trying to make the paths thin?

  • Maybe this paper about Stroke Width Transform can help you.
  • I would also like to suggest doing edge detection first. Then you compute the distance from one edge to another, both on X and Y directions, and then saving the smallest distance in each pixel of the path. To highlight the paths you will look for the smallest values saved on each pixel of the paths.

I hope this helps.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.