背景:
当我手写获取点云的bounding box的时候,发现找点云bounding box最大最小值时候,需要对最大最小初始为float的理论数值上下界。
1. 如何获得数据类型(int, float ...)的理论数值上下界:
max_point = std::numeric_limits <float>::max();
2. 用处何在:
如下,可以为找最大最小初始数值。
void getBoundingBox(pcl::PointCloud<PointTypeIO>::Ptr cloud_in, PointTypeIO& min_point, PointTypeIO& max_point, Eigen::Vector3f &mass_center){
max_point.x = -std::numeric_limits <float>::max();
max_point.y = -std::numeric_limits <float>::max();
max_point.z = -std::numeric_limits <float>::max();
min_point.x = std::numeric_limits <float>::max();
min_point.y = std::numeric_limits <float>::max();
min_point.z = std::numeric_limits <float>::max();
float x_sum = 0;
&