I have pictures of networks, like the one below, and my goal is to obtain the network's skeleton from processing those images.
My approach lies in two steps, first I convert grayscale image to binary image using local thresholding or Otsu method, and then a medianfilter (python function medfilt). Result is shown below.
Then, I use a thinning algorithm to extract the network's skeleton. Here is the result of my implementation of the Zhang-Suen thinning algorithm.
Considering the quality of the first image, I'm pretty sure it's possible to do a lot better than that. I thus have two questions :
1) Taking the last image, how would you remove all the small lines perpendendicular to the ridges, and the small gaps, that are artefacts ?
2) What algorithm would you actually advise me to use for the above mentionned steps (conversion to binary image and thinning) ?
I'm mainly working in python.