69 {
70
71 float x_max = -std::numeric_limits<float>::max();
72 float y_max = -std::numeric_limits<float>::max();
73 float z_max = -std::numeric_limits<float>::max();
74 float x_min = std::numeric_limits<float>::max();
75 float y_min = std::numeric_limits<float>::max();
76 float z_min = std::numeric_limits<float>::max();
77 for (size_t i = 0; i < cloud->size(); ++i) {
78 auto pt = (*cloud)[i];
79 x_min = std::min(x_min, pt.x);
80 x_max = std::max(x_max, pt.x);
81 y_min = std::min(y_min, pt.y);
82 y_max = std::max(y_max, pt.y);
83 z_min = std::min(z_min, pt.z);
84 z_max = std::max(z_max, pt.z);
85 }
86 Eigen::Vector3f fea = {x_max - x_min, y_max - y_min, z_max - z_min};
87 Eigen::VectorXf response = fea.transpose() * _lr_parameters;
88 int type = 0;
89 response.maxCoeff(&type);
90 return _labels[type];
91 }