Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to find endpoints and junction points? #180

Open
siddagra opened this issue Jun 26, 2022 · 0 comments
Open

How to find endpoints and junction points? #180

siddagra opened this issue Jun 26, 2022 · 0 comments

Comments

@siddagra
Copy link

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.

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.

image

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant