I am just wondering if there is any code in PCL for fitting an oriented bounding box for a point cloud. For example, if you segment the point cloud to some primitives and then for each primitive (plane, cylinder, cylinder, ...) you can find an oriented bounding box.
This has already been discussed on the mailing list. Did you try using the search functionality? Even naively searching
for "oriented bounding box pcl" on any search engine returns the right results ;)
I already ran into this problem.
As there is no ready-to-use function in pcl, you have two options for oriented bounding boxes:
Using pcl::PCA and compute the OBB from the eigenvectors. However avoid the "reconstruction" and "projection" methods of the pcl::PCA class. I couldn't get them to work and some other people avoid them.
Another option is using this code which computes OBBs efficiently and is easy to use.
If you find another solution, please share it. At least I, may be interested in it.