Template Function multisensor_calibration::utils::computeOrientedBoundingBox

Function Documentation

template<typename PointT>
inline void multisensor_calibration::utils::computeOrientedBoundingBox(const typename pcl::PointCloud<PointT>::Ptr ipCloud, const CalibrationTarget &iCalibTarget, const bool iTrueUp, float &oBboxWidth, float &oBboxHeight, float &oBboxDepth, Eigen::Matrix4f &oBboxTransform)

Function to compute the oriented bounding box for a given input point cloud.

This will first transform the point cloud according to its principal components into a local coordinate system, which axes are aligned along principal components. From the transformed point cloud it computes the width, height and length of bounding box. These correspond to the length of the point cloud along its ordered principal components. Furthermore the function computes the center point of the point cloud as well as the transformation of the bounding box so that it fits to the input cloud.

Template Parameters:

PointT – Point type of the point cloud.

Parameters:
  • ipCloud[in] Pointer to point cloud that for which the oriented bounding box is to be computed.

  • iCalibTarget[in] Object of CalibrationTarget for which a bounding box is to be computed.

  • iTrueUp[in] Flag to allow to estimate true up vector based on cutouts on calibration target

  • oBboxWidth[out] Width of the oriented bounding box. Since the point cloud is transformed according to its principal components prior to computation of the bounding box, the width will always be along the larges principal component.

  • oBboxHeight[out] Height of the oriented bounding box, i.e. length of the point cloud along its second larges principal component.

  • oBboxDepth[out] Depth of the oriented bounding box, i.e. length of the point cloud along its second smallest principal component.

  • oBboxTransform[out] Transformation of the bounding box to fit the input point cloud. This is equivalent to a transformation from a local to a reference coordinate system. Meaning, that the translational part is equivalent to the center of the bounding box as seen from the reference system and, that the column vectors of the rotation matrix represent the orientation of the axes of the local coordinate system as seen from the reference system. The rotation matrix is set in such a way, that the z-axis is pointing towards the center of the sensor.