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

#include <cloud_mask.h>

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

Public 成员函数

 CloudMask ()=default
 
 ~CloudMask ()=default
 
void Set (size_t size, int init_value)
 
void Fill (int value)
 
const std::vector< int > & mask () const
 
int & operator[] (int id)
 
const int & operator[] (int id) const
 
size_t size () const
 
void clear ()
 
size_t ValidIndicesCount () const
 
template<typename IntegerType >
size_t ValidIndicesCount (const std::vector< IntegerType > &indices) const
 
void GetValidCloud (const base::AttributePointCloud< base::PointF > &source_cloud, base::AttributePointCloud< base::PointF > *target_cloud) const
 
void GetValidIndices (base::PointIndices *indices)
 
void Flip ()
 
void AddIndices (const base::PointIndices &indices, int value=1)
 
template<typename IntegerType >
void AddIndices (const std::vector< IntegerType > &indices, int value=1)
 
void AddIndicesOfIndices (const base::PointIndices &indices, const base::PointIndices &indices_of_indices, int value=1)
 
void RemoveIndices (const base::PointIndices &indices)
 
template<typename IntegerType >
void RemoveIndices (const std::vector< IntegerType > &indices)
 
void RemoveIndicesOfIndices (const base::PointIndices &indices, const base::PointIndices &indices_of_indices)
 
void GetValidMask (CloudMask *rhs) const
 
void ResetValue (int source_value, int target_value)
 
std::vector< int > GetValidIndices ()
 

详细描述

在文件 cloud_mask.h 第 26 行定义.

构造及析构函数说明

◆ CloudMask()

apollo::perception::lidar::CloudMask::CloudMask ( )
default

◆ ~CloudMask()

apollo::perception::lidar::CloudMask::~CloudMask ( )
default

成员函数说明

◆ AddIndices() [1/2]

void apollo::perception::lidar::CloudMask::AddIndices ( const base::PointIndices &  indices,
int  value = 1 
)

在文件 cloud_mask.cc 第 66 行定义.

66 {
67 AddIndices(indices.indices, value);
68}
void AddIndices(const base::PointIndices &indices, int value=1)
Definition cloud_mask.cc:66

◆ AddIndices() [2/2]

template<typename IntegerType >
void apollo::perception::lidar::CloudMask::AddIndices ( const std::vector< IntegerType > &  indices,
int  value = 1 
)

在文件 cloud_mask.h 第 142 行定义.

142 {
143 for (auto& id : indices) {
144 mask_[id] = value;
145 }
146}

◆ AddIndicesOfIndices()

void apollo::perception::lidar::CloudMask::AddIndicesOfIndices ( const base::PointIndices &  indices,
const base::PointIndices &  indices_of_indices,
int  value = 1 
)

在文件 cloud_mask.cc 第 70 行定义.

72 {
73 for (auto& id : indices_of_indices.indices) {
74 mask_[indices.indices[id]] = value;
75 }
76}

◆ clear()

void apollo::perception::lidar::CloudMask::clear ( )
inline

在文件 cloud_mask.h 第 61 行定义.

61{ mask_.clear(); }

◆ Fill()

void apollo::perception::lidar::CloudMask::Fill ( int  value)
inline

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

40{ std::fill(mask_.begin(), mask_.end(), value); }

◆ Flip()

void apollo::perception::lidar::CloudMask::Flip ( )

在文件 cloud_mask.cc 第 60 行定义.

60 {
61 for (auto& i : mask_) {
62 i = i > 0 ? 0 : 1;
63 }
64}

◆ GetValidCloud()

void apollo::perception::lidar::CloudMask::GetValidCloud ( const base::AttributePointCloud< base::PointF > &  source_cloud,
base::AttributePointCloud< base::PointF > *  target_cloud 
) const

在文件 cloud_mask.cc 第 35 行定义.

36 {
37 if (target_cloud == nullptr) {
38 return;
39 }
40 indices_.clear();
41 indices_.reserve(mask_.size());
42 for (size_t i = 0; i < mask_.size(); ++i) {
43 if (mask_[i] > 0) {
44 indices_.push_back(static_cast<int>(i));
45 }
46 }
47 target_cloud->CopyPointCloud(source_cloud, indices_);
48}

◆ GetValidIndices() [1/2]

std::vector< int > apollo::perception::lidar::CloudMask::GetValidIndices ( )

◆ GetValidIndices() [2/2]

void apollo::perception::lidar::CloudMask::GetValidIndices ( base::PointIndices *  indices)

在文件 cloud_mask.cc 第 50 行定义.

50 {
51 indices->indices.clear();
52 indices->indices.reserve(mask_.size());
53 for (size_t i = 0; i < mask_.size(); ++i) {
54 if (mask_[i] > 0) {
55 indices->indices.push_back(static_cast<int>(i));
56 }
57 }
58}

◆ GetValidMask()

void apollo::perception::lidar::CloudMask::GetValidMask ( CloudMask *  rhs) const

在文件 cloud_mask.cc 第 90 行定义.

90 {
91 if (rhs == nullptr) {
92 return;
93 }
94 rhs->clear();
95 for (const auto& i : mask_) {
96 if (i > 0) {
97 rhs->mask_.push_back(i);
98 }
99 }
100}

◆ mask()

const std::vector< int > & apollo::perception::lidar::CloudMask::mask ( ) const
inline

在文件 cloud_mask.h 第 44 行定义.

44{ return mask_; }

◆ operator[]() [1/2]

int & apollo::perception::lidar::CloudMask::operator[] ( int  id)
inline

在文件 cloud_mask.h 第 49 行定义.

49{ return mask_[id]; }

◆ operator[]() [2/2]

const int & apollo::perception::lidar::CloudMask::operator[] ( int  id) const
inline

在文件 cloud_mask.h 第 54 行定义.

54{ return mask_[id]; }

◆ RemoveIndices() [1/2]

void apollo::perception::lidar::CloudMask::RemoveIndices ( const base::PointIndices &  indices)

在文件 cloud_mask.cc 第 78 行定义.

78 {
79 RemoveIndices(indices.indices);
80}
void RemoveIndices(const base::PointIndices &indices)
Definition cloud_mask.cc:78

◆ RemoveIndices() [2/2]

template<typename IntegerType >
void apollo::perception::lidar::CloudMask::RemoveIndices ( const std::vector< IntegerType > &  indices)

在文件 cloud_mask.h 第 149 行定义.

149 {
150 for (auto& id : indices) {
151 mask_[id] = 0;
152 }
153}

◆ RemoveIndicesOfIndices()

void apollo::perception::lidar::CloudMask::RemoveIndicesOfIndices ( const base::PointIndices &  indices,
const base::PointIndices &  indices_of_indices 
)

在文件 cloud_mask.cc 第 82 行定义.

84 {
85 for (auto& id : indices_of_indices.indices) {
86 mask_[indices.indices[id]] = 0;
87 }
88}

◆ ResetValue()

void apollo::perception::lidar::CloudMask::ResetValue ( int  source_value,
int  target_value 
)

在文件 cloud_mask.cc 第 102 行定义.

102 {
103 for (auto& i : mask_) {
104 if (i == source_value) {
105 i = target_value;
106 }
107 }
108}

◆ Set()

void apollo::perception::lidar::CloudMask::Set ( size_t  size,
int  init_value 
)
inline

在文件 cloud_mask.h 第 34 行定义.

34 {
35 mask_.assign(size, init_value);
36 }

◆ size()

size_t apollo::perception::lidar::CloudMask::size ( ) const
inline

在文件 cloud_mask.h 第 58 行定义.

58{ return mask_.size(); }

◆ ValidIndicesCount() [1/2]

size_t apollo::perception::lidar::CloudMask::ValidIndicesCount ( ) const

在文件 cloud_mask.cc 第 25 行定义.

25 {
26 size_t count = 0;
27 for (auto& i : mask_) {
28 if (i > 0) {
29 ++count;
30 }
31 }
32 return count;
33}

◆ ValidIndicesCount() [2/2]

template<typename IntegerType >
size_t apollo::perception::lidar::CloudMask::ValidIndicesCount ( const std::vector< IntegerType > &  indices) const

在文件 cloud_mask.h 第 156 行定义.

157 {
158 size_t count = 0;
159 for (const auto& id : indices) {
160 if (mask_[id]) {
161 ++count;
162 }
163 }
164 return count;
165}

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