Apollo 11.0
自动驾驶开放平台
apollo::perception::lidar::LRClassifier类 参考

#include <lr_classifier.h>

apollo::perception::lidar::LRClassifier 的协作图:

Public 成员函数

 LRClassifier ()=default
 
 ~LRClassifier ()
 
bool init ()
 Init LR classifier
 
std::string GetLabel (base::PointFCloudConstPtr cloud)
 Get the label of object
 

详细描述

在文件 lr_classifier.h 第 37 行定义.

构造及析构函数说明

◆ LRClassifier()

apollo::perception::lidar::LRClassifier::LRClassifier ( )
default

◆ ~LRClassifier()

apollo::perception::lidar::LRClassifier::~LRClassifier ( )
inline

在文件 lr_classifier.h 第 40 行定义.

40{}

成员函数说明

◆ GetLabel()

std::string apollo::perception::lidar::LRClassifier::GetLabel ( base::PointFCloudConstPtr  cloud)
inline

Get the label of object

参数
cloudpointcloud of object
返回
std::string

在文件 lr_classifier.h 第 69 行定义.

69 {
70 // point cloud should be rotated
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 }

◆ init()

bool apollo::perception::lidar::LRClassifier::init ( )
inline

Init LR classifier

返回
true
false

在文件 lr_classifier.h 第 47 行定义.

47 {
48 _lr_parameters.resize(3, 4);
49 _lr_parameters.coeffRef(0, 0) = 0.0510903f;
50 _lr_parameters.coeffRef(0, 1) = -1.00989f;
51 _lr_parameters.coeffRef(0, 2) = -1.6537f;
52 _lr_parameters.coeffRef(0, 3) = 0.130055f;
53 _lr_parameters.coeffRef(1, 0) = 0.266469f;
54 _lr_parameters.coeffRef(1, 1) = -0.538964f;
55 _lr_parameters.coeffRef(1, 2) = -0.291611f;
56 _lr_parameters.coeffRef(1, 3) = -0.070701f;
57 _lr_parameters.coeffRef(2, 0) = 0.497949f;
58 _lr_parameters.coeffRef(2, 1) = -0.504843f;
59 _lr_parameters.coeffRef(2, 2) = -0.152141f;
60 _lr_parameters.coeffRef(2, 3) = -1.38024f;
61 return true;
62 }

该类的文档由以下文件生成: