Reputation: 131
We have a point cloud which has points which lie in the same plane. They are distributed similar to the red dots in the image below, we want to fit rectangles denoted by the yellow boxes. These rectangles should be fitted in a way that they should cover the entire distribution of points in least number of instances/rectangles as tightly around the points as possible.
The Blue box denotes a minimal bounding box which we can easily obtained using something like open3d's get_minimal_oriented_bounding_box() function.
Planar patch detection by Arujo And Oliveira can be a good approach to solve this in cases where the three sets of points (sets separated by yellow boxes) are disjoint (have some separation in between them).
Using a octree to decimate data into small chunks and then drawing bounding boxes around them is another approach, but might produce many smaller rectangles which is not a optimal result.
Upvotes: 2
Views: 158
Reputation: 133
Have you tried using k-means clustering to partition your data and then computing the bounding box of each cluster? You can run it for a few different number of clusters (initial parameter) and then compare the total surface covered by your bounding boxes.
For example, scikit-learn provides a fairly easy to implement KMeans algorithm.
Also, would it be possible to provide an example of the data you're dealing with?
Upvotes: 0