strayrobots / 3d-annotation-tool

A graphical user interface to annotate point clouds and 3D data.
MIT License
76 stars 8 forks source link

Normal fix #51

Closed kekeblom closed 2 years ago

kekeblom commented 2 years ago

Properly computes the normal when placing bounding boxes in point clouds.

Not the most elegant solution, but it works decently well and fast. Ideally the same acceleration data structure would be used for finding nearest neighbors in the point cloud as for ray tracing, but it didn't look like it would have been quite a bit more work to extend nanort to do nearest neighbor searches.

In this case, a KDTree is created for fast nearest neighbor lookups. To estimate the normal, we find N closest points, fit a plane to the points and get the normal.