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

#include <spp_seg_cc_2d.h>

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

Public 成员函数

 SppCCDetector ()=default
 
 ~SppCCDetector ()
 
void Init (int rows, int cols)
 
void SetData (const float *const *prob_map, const float *offset_map, float scale, float objectness_threshold)
 
size_t Detect (SppLabelImage *labels)
 

详细描述

在文件 spp_seg_cc_2d.h 第 28 行定义.

构造及析构函数说明

◆ SppCCDetector()

apollo::perception::lidar::SppCCDetector::SppCCDetector ( )
default

◆ ~SppCCDetector()

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

在文件 spp_seg_cc_2d.h 第 32 行定义.

32 {
33 if (nodes_ != nullptr) {
34 algorithm::IFree2(&nodes_);
35 }
36 }

成员函数说明

◆ Detect()

size_t apollo::perception::lidar::SppCCDetector::Detect ( SppLabelImage *  labels)

在文件 spp_seg_cc_2d.cc 第 68 行定义.

68 {
69 Timer timer;
70 if (!first_process_) {
71 worker_.Join(); // sync for cleaning nodes
72 }
73 first_process_ = false;
74 BuildNodes(0, rows_);
75 double init_time = timer.toc(true);
76
77 double sync_time = timer.toc(true);
78
79 TraverseNodes();
80 double traverse_time = timer.toc(true);
81
82 UnionNodes();
83 double union_time = timer.toc(true);
84
85 size_t num = ToLabelMap(labels);
86 worker_.WakeUp(); // for next use
87 double collect_time = timer.toc(true);
88
89 AINFO << "SppSegCC2D: init: " << init_time << "\tsync: " << sync_time
90 << "\ttraverse: " << traverse_time << "\tunion: " << union_time
91 << "\tcollect: " << collect_time << "\t#obj: " << num;
92
93 return num;
94}
#define AINFO
Definition log.h:42

◆ Init()

void apollo::perception::lidar::SppCCDetector::Init ( int  rows,
int  cols 
)
inline

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

40 {
41 if (rows_ * cols_ != rows * cols) {
42 if (nodes_ != nullptr) {
43 algorithm::IFree2(&nodes_);
44 }
45 nodes_ = algorithm::IAlloc2<Node>(rows, cols);
46 rows_ = static_cast<int>(rows);
47 cols_ = static_cast<int>(cols);
48 }
49 CleanNodes();
50 }

◆ SetData()

void apollo::perception::lidar::SppCCDetector::SetData ( const float *const *  prob_map,
const float *  offset_map,
float  scale,
float  objectness_threshold 
)

在文件 spp_seg_cc_2d.cc 第 26 行定义.

28 {
29 prob_map_ = prob_map;
30 offset_map_ = offset_map;
31 scale_ = scale;
32 objectness_threshold_ = objectness_threshold;
33 worker_.Bind(std::bind(&SppCCDetector::CleanNodes, this));
34 worker_.Start();
35}
void Bind(const std::function< bool()> &func)

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