We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello, thank you for this great package Is there a way to identify the pixels of branches that contain an endpoint? best valerian
The text was updated successfully, but these errors were encountered:
This works for me:
def find_endpoints(skel): # Define a kernel that counts the number of neighbors kernel = np.array([ [1, 1, 1], [1, 10, 1], [1, 1, 1] ]) neighbors_count = convolve(skel.astype(int), kernel, mode='constant', cval=0) # Endpoints are skeleton points with only one neighbor return (neighbors_count == 11) & skel
This works by checking each pixel in a skeleton image for neighbors. if there is only one neighbor, then you have an endpoint!
Note: if you have 2 neighbors, you would be part of a line and if you have 3+ neighbors you have a junction.
Sorry, something went wrong.
No branches or pull requests
Hello, thank you for this great package
Is there a way to identify the pixels of branches that contain an endpoint?
best
valerian
The text was updated successfully, but these errors were encountered: