Box selection itself is still very simple, as long as the division of each object after the point of the focus of the cloud, and then draw a frame, here I also added a PCA, the rectangular frame in accordance with the object point of the main axis of the direction of the adjustment, mainly reference to the http://pointclouds.org/ Documentation/tutorials/moment_of_inertia.php wrote here in detail, the main process is:
First, the covariance matrix of the point cloud is computed, and its eigenvalues and vectors are extracted. You can assume that the resulting eigenvector is normalized and always form the right-hand coordinate system (the main eigenvector represents the x-axis, and the secondary vector represents the z axis). In the next step, the iterative process occurs. Rotate the main eigenvector in each iteration. The rotation order is always the same and is performed around other eigenvectors, which provides the invariance of the rotation of the point cloud. Thereafter, we will refer to this rotational main vector as the current axis.
The box selection for the referenced article is this:
In the end, my results are:
Here my code is very redundant ... But my code ability is also general, do not post out.