Image-Py / sknw

build net work from skeleton image (2D-3D)
BSD 3-Clause "New" or "Revised" License
224 stars 48 forks source link

Missing edge in edge-loop-edge structure. #17

Open charliebudd opened 3 years ago

charliebudd commented 3 years ago

I have a case where there is a single edge which splits into two before rejoining into a final edge, forming a loop.

I would expect a node to be formed at each intersection before and after the loop, and an edge following each side of the loop. However one edge of the loop is ommited from the resulting graph. Whats strange is the nodes are included suggesting the structure has been correctly picked up but the edge is just missing?

image image

I printed out the nodes and edges which shows the same as the images... Nodes: 0, 1, 2, 3 Edges: (0, 1), (1, 2), (2, 3)

I did think the connections of the skeleton may be broken so I tried cropping out the node at the end of the loop but the graph comes out as well in these cases... image image

yxdragon commented 3 years ago

def build_sknw(ske, multi=False, iso=True, ring=True, full=True):

please try multi=True