letmp / dx11-pointcloud

dx11-pointcloud
Other
29 stars 6 forks source link

The plugin "CCL" in BlobExtraction works slowly,How can I move the code to a shader? #3

Closed agalloch21 closed 9 years ago

agalloch21 commented 9 years ago

I have worked on it for a few hours and didn't find a way...I noticed there is a loop for finding edges and wondered if it's possible to move the code to a dx11 shader?

agalloch21 commented 9 years ago

by the way, the group id is not necessary for me.

letmp commented 9 years ago

The used algorithm cannot be realized on GPU. You can find some approaches on connected component labeling out there. For example this one: http://www.mirrorservice.org/sites/downloads.sourceforge.net/g/gp/gpucl/paper_draft.pdf I had no time to try it out, yet. But perhaps you find some time for it ;) The current CCL algorithm works on CPU and it is highly recommended to use a small resolution. In my cases 160x120px were a good way to go.

"by the way, the group id is not necessary for me." There are alot of cases where you need groupIds. For example when you are going to use analysis nodes like Bounds, Centroid and HitTest. Or if you want to filter the pointcloud by groupId.

agalloch21 commented 9 years ago

Thanks for your reply, letmp. I didn't make myself clear about " the group id is not necessary for me." I wanted to ask if it's possible to move the ccl code to a shader given that I don't need the group id for this installation.

I do know the group id is useful and I do appreciate your work. :)

letmp commented 9 years ago

If you dont need groupIds you can try to use the texture that is generated by the "Analysis_BlobExtraction_AsBinaryImage" node inside the BlobExtraction patch. Depends on what you want to achieve.