Closed researcherys closed 3 years ago
Hi @researcherys ,
Thanks for opening a descriptive issue! The images you've provided make it clear what you're talking about. However, you don't need to manually subtract the branch points from your skeleton, as we already have a function pcv.morphology.segment_skeleton
which you can use to break skeletons into their segments. Within this function, we dilate the branch points before subtracting in order to ensure disjunction will only take one step (in the majority of cases at least). Additionally, if you wish to both disjoint the skeleton and sort them into primary & secondary ranked segments, our pcv.morphology.segment_sort
will do this in one step.
Please let us know if this helps you achieve your desired result, or if you have any related things come up!
Describe the bug Running pcv.morphology.find_branch_pts does not find every Branch/Junction point in the skeletonized image. It took twice to run it to complete disjunction of all branches in the attached image.
To Reproduce img = cv2.imread("Initial.jpg", 0) binary = img >= 250 skeleton = pcv.morphology.skeletonize(mask=binary) plt.imshow(skeleton, interpolation='nearest') prunedskeleton, , _ = pcv.morphology.prune(skel_img=skeleton, size=10) br_points = pcv.morphology.find_branch_pts(skel_img=pruned_skeleton)
new_skel = pruned_skeleton - br_points plt.imshow(new_skel, interpolation='nearest') br_points = pcv.morphology.find_branch_pts(skel_img=new_skel) new_skel = new_skel - br_points plt.imshow(new_skel, interpolation='nearest') plt.show()
Local environment (please complete the following information):