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

Remove excess and fragmented shoots from the skeleton #40

Open
jokermaster83 opened this issue Jun 13, 2023 · 3 comments
Open

Remove excess and fragmented shoots from the skeleton #40

jokermaster83 opened this issue Jun 13, 2023 · 3 comments

Comments

@jokermaster83
Copy link

Hello, first of all, thank you very much for your efforts and results, so that I successfully achieved the extraction goal of the three-dimensional point cloud tree skeleton, your algorithm is simple and efficient, personally I think it is very good.

But I also encountered a small problem in the process of use, that is, the branches in the model of the original point cloud ply file I entered have some breaks, so I don't want to skeletonize these fractured and incomplete branch parts, of course, I also see that the mesh shrinkage function defines the function of removing the broken part, but after practice, I don't seem to see the application of this parameter in the mesh shrinkage function definition, maybe I made a mistake, and I hope you can give me some advice, Let me successfully achieve only the skeleton process of the complete branch, below is my code and the point cloud after skeletonization, thank you in advance!

1
2

@schlegelp
Copy link
Collaborator

Hi! Looking at your code I see two issues:

  1. When you run fix_mesh you use remove_disconnected=3 which means it will drop any fragment consisting of 3 vertices or less. In your screenshot it looks like the encircled branch has way more than 3 vertices. Bottom line: you likely need to increase remove_disconnected
  2. You use the original mesh (mesh in your code) instead of the fixed mesh (fixed) for the skeletonization.

Try something like this:

fixed = sk.pre.fix(mesh, remove_disconnected=50, inplace=False)
cont = sk.pre.contract(fide, iter_lim=50, epsilon=.1)
skel = sk.skeletonize.by_vertex_cluster(cont, sampling_dist=1, cluster_pos='median')
sk.post.clean_up(skel, inplace=True)
skel.show(mesh=True)

@jokermaster83
Copy link
Author

Wow, thank you so much for your prompt response and helpful advice! According to the problem you pointed out, I immediately adjusted the corresponding parameters for debugging effect, and the result is indeed much better!
But it doesn't matter how big I adjust the parameter remove_disconnected (50, 70, 90), the generated tree skeleton is still fractured in many areas, because I have to perform topological analysis and calculate length, corner and other information on this skeleton later, so these fractured areas will have a greater impact on my subsequent research, I don't know if you have also encountered this problem, I'm curious to know if you already have a way to repair or extend the areas connecting these broken branches.
For skeleton extraction and even point cloud fields, I am still just a beginner in front of you, please advise! Thank you again for your timely reply and wish you a happy life and a happy day!
From top to bottom, the code block, the original point cloud map, and the tree skeleton diagram:
5
3
4

@jokermaster83
Copy link
Author

In addition, I have a request, after reading your article (Skeleton Extraction by Mesh Contraction), I found that it mentions shrinking meshes and converting them into a 1D curveskeleton by connecting to remove all collapsed surfaces during surgery while maintaining the shrinked mesh and the shape of the original topology. Refine the centering of the skeleton by utilizing induced skeleton mesh mapping. Finally, embed it in the source point cloud.
I searched through the source code and related documentation you published, and I couldn't find the implementation functions and methods related to these three, and given my limited programming knowledge, I am ashamed that I cannot reproduce their functionality.Therefore, I want to ask you for help, whether there is a skeleton connection, centering, embedded related implementation code, do not completely write a new one for my problem, just provide the code you study and use, the main guide is good, if convenient, please help, again heartfelt thanks to you and your team for all your efforts!
6

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

2 participants