Open rfeinman opened 4 years ago
hi, see the multi graph parameter!
a tips: a small hole [column 1] and little touch [columns 2] may lead small ring in the graph. you can use skimage's remove_small_objects and binary_erode befor skeleton.
Ah yes, multigraph is exactly what I needed. Thank you!
I was already using morphology.remove_small_holes
, but now I see that morphology.binary_erosion
is also useful for some cases, such as column 2. Thanks for the tip.
One more question/request: is there an easy way to add the "maximum circle criterion" (Liao & Huang, 1990) for removing spurious branches and duplicate fork points? See image below for example. The algorithm places the largest possible circle on each critical point, such that the circle resides within the original ink (gray regions in d).
C.-W. Liao, J. S. Huang, Stroke segmentation by bernstein-bezier curve fitting. Pattern Recognit. 23, 475–484 (1990).
Sorry for not review this issues for a long time. I think it is not difficult.
if it is useful for you, we can add another file to sknw, which do some graph repair. such as:
In my another repo, ImagePy (a ui framework for image processing) here integrate some sknw's function, there are "remove isolate node", "remove 2 edges' node", "cut branch" a topic on image.sc, here is some demo.
Hi - Thank you so much for getting back to me about this! Sorry it has taken me a while to reply.
I looked at your demo and its great. I don't think I want to remove 2-edge or isolate nodes for my application. Some isolate nodes in characters are important, like dots. And corners are instances of 2-edge nodes, which I'd like to keep.
The new algorithm that you suggested sounds simple and effective. If you have a working implementation, I'd love to take a look. Otherwise I will work on crafting my own version.
could you share a character image with many kinds of defect?
Here are two demonstrative examples of the issue. I am showing the image and the current skeleton network. The L-shaped character should probably only have 1 node in the corner (rather than two). The w-shaped character should have 4 nodes total, not 6.
Hi, thank you for sharing this great python code.
I am trying to compute skeleton networks for images of handwritten characters (Omniglot dataset) and I've experienced strange behavior with some images. See figure below for a few examples. It seems that the network misses important edges in some cases; e.g. for the first character (column 1), the network misses the top-right curve completely. Do you know why this might be happening?