最近遇到一个计算点云最小包围盒的应用,查询资料后,发现vtk有现成的API,vtkOBBTree提供了非常方便的便捷的方法 ComputeOBB,其API的描述如下。
/**
* Compute an OBB from the list of points given. Return the corner point
* and the three axes defining the orientation of the OBB. Also return
* a sorted list of relative "sizes" of axes for comparison purposes.
*/
static void ComputeOBB(
vtkPoints* pts, double corner[3], double max[3], double mid[3], double min[3], double size[3]);
输入参数 | 说明 |
pts | 待计算的输入点云数据 |
输出参数 | 说明 |