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?
2 Answers
$\begingroup$
$\endgroup$
1
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$.
-
$\begingroup$ Thinning until 1px lines appears is skeletonization, and it works ;) $\endgroup$– EvilJul 16, 2016 at 23:48
$\begingroup$
$\endgroup$
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.