Open siddagra opened 2 years ago
I am having an issue... Whether I use src or dst coords.. image- or otherwise, It often detects junctions as dst instead of the endpoints.
src
dst
image-
How do I specifically get the correct endpoints and junction points corresponding to those endpoints?
degree functionality also seems to be removed otherwise I could use that to check if a node has a degree higher than 2 as junction.
code:
skeleton = cv2.imread("skeletontest.png")[:, :, 1].astype(bool) pt, degrees = skeleton_to_csgraph(skeleton) df = summarize(Skeleton(skeleton)) branch1 = df[df['branch-type'] == 1] endpoints = branch1[["image-coord-dst-0", "image-coord-dst-1"]].values.astype(np.int64) # plot # (plotting has to interchange coordinates since the endpoints lists y coordinates first) for i, pnt in enumerate(endpoints): plt.scatter(pnt[1], pnt[0], color="red", s=3)
(plotting has to interchange coordinates since the endpoints lists y coordinates first)
I am having an issue... Whether I use
src
ordst
coords..image-
or otherwise, It often detects junctions asdst
instead of the endpoints.How do I specifically get the correct endpoints and junction points corresponding to those endpoints?
degree functionality also seems to be removed otherwise I could use that to check if a node has a degree higher than 2 as junction.
code:
(plotting has to interchange coordinates since the endpoints lists y coordinates first)