Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
za0612
pcl
提交
1d482d52
P
pcl
项目概览
za0612
/
pcl
与 Fork 源项目一致
从无法访问的项目Fork
通知
13
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
pcl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
1d482d52
编写于
1月 27, 2021
作者:
M
Markus Vieth
提交者:
GitHub
1月 27, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #4574 from mvieth/indices_test
[test] Use more pcl::Indices and pcl::index_t
上级
10c2c2c4
598c4bcd
变更
29
隐藏空白更改
内联
并排
Showing
29 changed file
with
77 addition
and
84 deletion
+77
-84
test/common/test_io.cpp
test/common/test_io.cpp
+1
-1
test/features/test_base_feature.cpp
test/features/test_base_feature.cpp
+1
-1
test/features/test_board_estimation.cpp
test/features/test_board_estimation.cpp
+1
-1
test/features/test_boundary_estimation.cpp
test/features/test_boundary_estimation.cpp
+1
-1
test/features/test_curvatures_estimation.cpp
test/features/test_curvatures_estimation.cpp
+1
-1
test/features/test_cvfh_estimation.cpp
test/features/test_cvfh_estimation.cpp
+1
-1
test/features/test_flare_estimation.cpp
test/features/test_flare_estimation.cpp
+1
-1
test/features/test_grsd_estimation.cpp
test/features/test_grsd_estimation.cpp
+0
-1
test/features/test_invariants_estimation.cpp
test/features/test_invariants_estimation.cpp
+1
-1
test/features/test_normal_estimation.cpp
test/features/test_normal_estimation.cpp
+3
-3
test/features/test_pfh_estimation.cpp
test/features/test_pfh_estimation.cpp
+1
-1
test/features/test_rsd_estimation.cpp
test/features/test_rsd_estimation.cpp
+0
-1
test/features/test_shot_estimation.cpp
test/features/test_shot_estimation.cpp
+2
-2
test/features/test_shot_lrf_estimation.cpp
test/features/test_shot_lrf_estimation.cpp
+1
-1
test/features/test_spin_estimation.cpp
test/features/test_spin_estimation.cpp
+1
-1
test/filters/test_clipper.cpp
test/filters/test_clipper.cpp
+2
-2
test/filters/test_filters.cpp
test/filters/test_filters.cpp
+1
-6
test/filters/test_model_outlier_removal.cpp
test/filters/test_model_outlier_removal.cpp
+1
-1
test/io/test_io.cpp
test/io/test_io.cpp
+1
-1
test/kdtree/test_kdtree.cpp
test/kdtree/test_kdtree.cpp
+5
-5
test/keypoints/test_keypoints.cpp
test/keypoints/test_keypoints.cpp
+3
-3
test/recognition/test_recognition_cg.cpp
test/recognition/test_recognition_cg.cpp
+2
-2
test/sample_consensus/test_sample_consensus_line_models.cpp
test/sample_consensus/test_sample_consensus_line_models.cpp
+5
-5
test/sample_consensus/test_sample_consensus_plane_models.cpp
test/sample_consensus/test_sample_consensus_plane_models.cpp
+8
-8
test/sample_consensus/test_sample_consensus_quadric_models.cpp
...sample_consensus/test_sample_consensus_quadric_models.cpp
+14
-14
test/search/test_flann_search.cpp
test/search/test_flann_search.cpp
+9
-9
test/search/test_kdtree.cpp
test/search/test_kdtree.cpp
+4
-4
test/search/test_octree.cpp
test/search/test_octree.cpp
+2
-2
test/search/test_search.cpp
test/search/test_search.cpp
+4
-4
未找到文件。
test/common/test_io.cpp
浏览文件 @
1d482d52
...
...
@@ -106,7 +106,7 @@ TEST (PCL, copyPointCloud)
EXPECT_EQ
(
cloud_xyz_rgba
[
i
].
rgba
,
cloud_xyz_rgb_normal
[
i
].
rgba
);
}
IndicesAllocator
<
Eigen
::
aligned_allocator
<
in
t
>
>
indices_aligned
;
IndicesAllocator
<
Eigen
::
aligned_allocator
<
pcl
::
index_
t
>
>
indices_aligned
;
indices_aligned
.
push_back
(
1
);
indices_aligned
.
push_back
(
2
);
indices_aligned
.
push_back
(
3
);
pcl
::
copyPointCloud
(
cloud_xyz_rgba
,
indices_aligned
,
cloud_xyz_rgb_normal
);
ASSERT_EQ
(
int
(
cloud_xyz_rgb_normal
.
size
()),
3
);
...
...
test/features/test_base_feature.cpp
浏览文件 @
1d482d52
...
...
@@ -49,7 +49,7 @@ using namespace pcl::io;
using
KdTreePtr
=
search
::
KdTree
<
PointXYZ
>::
Ptr
;
PointCloud
<
PointXYZ
>
cloud
;
std
::
vector
<
int
>
indices
;
pcl
::
Indices
indices
;
KdTreePtr
tree
;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
...
...
test/features/test_board_estimation.cpp
浏览文件 @
1d482d52
...
...
@@ -51,7 +51,7 @@ using namespace pcl::io;
using
KdTreePtr
=
search
::
KdTree
<
PointXYZ
>::
Ptr
;
PointCloud
<
PointXYZ
>
cloud
;
std
::
vector
<
int
>
indices
;
pcl
::
Indices
indices
;
KdTreePtr
tree
;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
...
...
test/features/test_boundary_estimation.cpp
浏览文件 @
1d482d52
...
...
@@ -49,7 +49,7 @@ using namespace pcl::io;
using
KdTreePtr
=
search
::
KdTree
<
PointXYZ
>::
Ptr
;
PointCloud
<
PointXYZ
>
cloud
;
std
::
vector
<
int
>
indices
;
pcl
::
Indices
indices
;
KdTreePtr
tree
;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
...
...
test/features/test_curvatures_estimation.cpp
浏览文件 @
1d482d52
...
...
@@ -49,7 +49,7 @@ using namespace pcl::io;
using
KdTreePtr
=
search
::
KdTree
<
PointXYZ
>::
Ptr
;
PointCloud
<
PointXYZ
>
cloud
;
std
::
vector
<
int
>
indices
;
pcl
::
Indices
indices
;
KdTreePtr
tree
;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
...
...
test/features/test_cvfh_estimation.cpp
浏览文件 @
1d482d52
...
...
@@ -51,7 +51,7 @@ using KdTreePtr = search::KdTree<PointXYZ>::Ptr;
using
CloudPtr
=
PointCloud
<
PointXYZ
>::
Ptr
;
PointCloud
<
PointXYZ
>
cloud
;
std
::
vector
<
int
>
indices
;
pcl
::
Indices
indices
;
KdTreePtr
tree
;
CloudPtr
cloud_milk
;
...
...
test/features/test_flare_estimation.cpp
浏览文件 @
1d482d52
...
...
@@ -164,7 +164,7 @@ main (int argc, char** argv)
sampled_cloud
.
reset
(
new
pcl
::
PointCloud
<
pcl
::
PointXYZ
>
());
std
::
vector
<
int
>
sampled_indices
;
pcl
::
Indices
sampled_indices
;
for
(
float
sa
=
0.0
f
;
sa
<
(
float
)
cloud
->
size
();
sa
+=
sampling_incr
)
sampled_indices
.
push_back
(
static_cast
<
int
>
(
sa
));
copyPointCloud
(
*
cloud
,
sampled_indices
,
*
sampled_cloud
);
...
...
test/features/test_grsd_estimation.cpp
浏览文件 @
1d482d52
...
...
@@ -49,7 +49,6 @@ using namespace pcl::io;
search
::
KdTree
<
PointXYZ
>::
Ptr
tree
(
new
search
::
KdTree
<
PointXYZ
>
());
PointCloud
<
PointXYZ
>::
Ptr
cloud
(
new
PointCloud
<
PointXYZ
>
());
std
::
vector
<
int
>
indices
;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
TEST
(
PCL
,
GRSDEstimation
)
...
...
test/features/test_invariants_estimation.cpp
浏览文件 @
1d482d52
...
...
@@ -48,7 +48,7 @@ using namespace pcl::io;
using
KdTreePtr
=
search
::
KdTree
<
PointXYZ
>::
Ptr
;
PointCloud
<
PointXYZ
>
cloud
;
std
::
vector
<
int
>
indices
;
pcl
::
Indices
indices
;
KdTreePtr
tree
;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
...
...
test/features/test_normal_estimation.cpp
浏览文件 @
1d482d52
...
...
@@ -51,7 +51,7 @@ using namespace pcl::io;
using
KdTreePtr
=
search
::
KdTree
<
PointXYZ
>::
Ptr
;
PointCloud
<
PointXYZ
>
cloud
;
std
::
vector
<
int
>
indices
;
pcl
::
Indices
indices
;
KdTreePtr
tree
;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
...
...
@@ -192,7 +192,7 @@ template<typename PointT>
class
DummySearch
:
public
pcl
::
search
::
Search
<
PointT
>
{
public:
virtual
int
nearestKSearch
(
const
PointT
&
point
,
int
k
,
std
::
vector
<
int
>
&
k_indices
,
virtual
int
nearestKSearch
(
const
PointT
&
point
,
int
k
,
pcl
::
Indices
&
k_indices
,
std
::
vector
<
float
>
&
k_sqr_distances
)
const
{
pcl
::
utils
::
ignore
(
point
);
...
...
@@ -203,7 +203,7 @@ class DummySearch : public pcl::search::Search<PointT>
return
k
;
}
virtual
int
radiusSearch
(
const
PointT
&
point
,
double
radius
,
std
::
vector
<
int
>
&
k_indices
,
virtual
int
radiusSearch
(
const
PointT
&
point
,
double
radius
,
pcl
::
Indices
&
k_indices
,
std
::
vector
<
float
>&
k_sqr_distances
,
unsigned
int
max_nn
=
0
)
const
{
pcl
::
utils
::
ignore
(
point
,
radius
,
k_indices
,
k_sqr_distances
);
...
...
test/features/test_pfh_estimation.cpp
浏览文件 @
1d482d52
...
...
@@ -56,7 +56,7 @@ using KdTreePtr = pcl::search::KdTree<PointT>::Ptr;
using
pcl
::
PointCloud
;
static
PointCloud
<
PointT
>::
Ptr
cloud
(
new
PointCloud
<
PointT
>
());
static
std
::
vector
<
int
>
indices
;
static
pcl
::
Indices
indices
;
static
KdTreePtr
tree
;
///////////////////////////////////////////////////////////////////////////////////
...
...
test/features/test_rsd_estimation.cpp
浏览文件 @
1d482d52
...
...
@@ -49,7 +49,6 @@ using namespace pcl::io;
search
::
KdTree
<
PointXYZ
>::
Ptr
tree
(
new
search
::
KdTree
<
PointXYZ
>
());
PointCloud
<
PointXYZ
>::
Ptr
cloud
(
new
PointCloud
<
PointXYZ
>
());
std
::
vector
<
int
>
indices
;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
TEST
(
PCL
,
RSDEstimation
)
...
...
test/features/test_shot_estimation.cpp
浏览文件 @
1d482d52
...
...
@@ -53,12 +53,12 @@ using namespace pcl::io;
using
KdTreePtr
=
search
::
KdTree
<
PointXYZ
>::
Ptr
;
PointCloud
<
PointXYZ
>
cloud
;
std
::
vector
<
int
>
indices
;
pcl
::
Indices
indices
;
KdTreePtr
tree
;
///////////////////////////////////////////////////////////////////////////////////
template
<
typename
PointT
>
void
shotCopyPointCloud
(
const
PointCloud
<
PointT
>
&
cloud_in
,
const
std
::
vector
<
int
>
&
indices
,
shotCopyPointCloud
(
const
PointCloud
<
PointT
>
&
cloud_in
,
const
pcl
::
Indices
&
indices
,
PointCloud
<
PointT
>
&
cloud_out
)
{
pcl
::
copyPointCloud
<
PointT
>
(
cloud_in
,
indices
,
cloud_out
);
...
...
test/features/test_shot_lrf_estimation.cpp
浏览文件 @
1d482d52
...
...
@@ -50,7 +50,7 @@ using namespace pcl::io;
using
KdTreePtr
=
search
::
KdTree
<
PointXYZ
>::
Ptr
;
PointCloud
<
PointXYZ
>
cloud
;
std
::
vector
<
int
>
indices
;
pcl
::
Indices
indices
;
KdTreePtr
tree
;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
...
...
test/features/test_spin_estimation.cpp
浏览文件 @
1d482d52
...
...
@@ -50,7 +50,7 @@ using namespace pcl::io;
using
KdTreePtr
=
search
::
KdTree
<
PointXYZ
>::
Ptr
;
PointCloud
<
PointXYZ
>
cloud
;
std
::
vector
<
int
>
indices
;
pcl
::
Indices
indices
;
KdTreePtr
tree
;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
...
...
test/filters/test_clipper.cpp
浏览文件 @
1d482d52
...
...
@@ -159,7 +159,7 @@ TEST (CropBox, Filters)
cropBoxFilter
.
setMax
(
max_pt
);
// Indices
std
::
vector
<
int
>
indices
;
pcl
::
Indices
indices
;
cropBoxFilter
.
filter
(
indices
);
// Cloud
...
...
@@ -483,7 +483,7 @@ TEST (CropBox, Filters)
cropBoxFilter2
.
setMax
(
max_pt
);
// Indices
std
::
vector
<
int
>
indices2
;
pcl
::
Indices
indices2
;
cropBoxFilter2
.
filter
(
indices2
);
// Cloud
...
...
test/filters/test_filters.cpp
浏览文件 @
1d482d52
...
...
@@ -69,7 +69,6 @@ using namespace Eigen;
PCLPointCloud2
::
Ptr
cloud_blob
(
new
PCLPointCloud2
);
PointCloud
<
PointXYZ
>::
Ptr
cloud
(
new
PointCloud
<
PointXYZ
>
);
std
::
vector
<
int
>
indices_
;
PointCloud
<
PointXYZRGB
>::
Ptr
cloud_organized
(
new
PointCloud
<
PointXYZRGB
>
);
...
...
@@ -2152,7 +2151,7 @@ TEST (NormalRefinement, Filters)
// Input without NaN
pcl
::
PointCloud
<
pcl
::
PointXYZRGB
>
cloud_organized_nonan
;
std
::
vector
<
int
>
dummy
;
pcl
::
Indices
dummy
;
pcl
::
removeNaNFromPointCloud
<
pcl
::
PointXYZRGB
>
(
*
cloud_organized
,
cloud_organized_nonan
,
dummy
);
// Viewpoint
...
...
@@ -2335,10 +2334,6 @@ main (int argc, char** argv)
loadPCDFile
(
file_name
,
*
cloud_blob
);
fromPCLPointCloud2
(
*
cloud_blob
,
*
cloud
);
indices_
.
resize
(
cloud
->
size
());
for
(
index_t
i
=
0
;
i
<
static_cast
<
index_t
>
(
indices_
.
size
());
++
i
)
indices_
[
i
]
=
i
;
loadPCDFile
(
argv
[
2
],
*
cloud_organized
);
...
...
test/filters/test_model_outlier_removal.cpp
浏览文件 @
1d482d52
...
...
@@ -54,7 +54,7 @@ PointCloud<PointXYZ>::Ptr cloud_in (new PointCloud<PointXYZ>);
TEST
(
ModelOutlierRemoval
,
Model_Outlier_Filter
)
{
PointCloud
<
PointXYZ
>::
Ptr
cloud_filter_out
(
new
PointCloud
<
PointXYZ
>
);
std
::
vector
<
int
>
ransac_inliers
;
pcl
::
Indices
ransac_inliers
;
float
thresh
=
0.01
;
//run ransac
Eigen
::
VectorXf
model_coefficients
;
...
...
test/io/test_io.cpp
浏览文件 @
1d482d52
...
...
@@ -593,7 +593,7 @@ TEST (PCL, IO)
EXPECT_FLOAT_EQ
(
cloud
[
nr_p
-
1
].
z
,
last
.
z
);
// test for fromPCLPointCloud2 ()
EXPECT_FLOAT_EQ
(
float
(
cloud
[
nr_p
-
1
].
intensity
),
float
(
last
.
intensity
));
// test for fromPCLPointCloud2 ()
std
::
vector
<
int
>
indices
(
cloud
.
width
*
cloud
.
height
/
2
);
pcl
::
Indices
indices
(
cloud
.
width
*
cloud
.
height
/
2
);
for
(
int
i
=
0
;
i
<
static_cast
<
int
>
(
indices
.
size
());
++
i
)
indices
[
i
]
=
i
;
// Save as ASCII
try
...
...
test/kdtree/test_kdtree.cpp
浏览文件 @
1d482d52
...
...
@@ -99,7 +99,7 @@ TEST (PCL, KdTreeFLANN_radiusSearch)
for
(
std
::
size_t
i
=
0
;
i
<
cloud
.
size
();
++
i
)
if
(
euclideanDistance
(
cloud
[
i
],
test_point
)
<
max_dist
)
brute_force_result
.
insert
(
i
);
std
::
vector
<
int
>
k_indices
;
pcl
::
Indices
k_indices
;
std
::
vector
<
float
>
k_distances
;
kdtree
.
radiusSearch
(
test_point
,
max_dist
,
k_indices
,
k_distances
,
100
);
...
...
@@ -178,7 +178,7 @@ TEST (PCL, KdTreeFLANN_nearestKSearch)
++
counter
;
}
std
::
vector
<
int
>
k_indices
;
pcl
::
Indices
k_indices
;
k_indices
.
resize
(
no_of_neighbors
);
std
::
vector
<
float
>
k_distances
;
k_distances
.
resize
(
no_of_neighbors
);
...
...
@@ -243,7 +243,7 @@ TEST (PCL, KdTreeFLANN_setPointRepresentation)
// Find k nearest neighbors
const
int
k
=
10
;
std
::
vector
<
int
>
k_indices
(
k
);
pcl
::
Indices
k_indices
(
k
);
std
::
vector
<
float
>
k_distances
(
k
);
kdtree
.
nearestKSearch
(
p
,
k
,
k_indices
,
k_distances
);
for
(
int
i
=
0
;
i
<
k
;
++
i
)
...
...
@@ -294,11 +294,11 @@ TEST (PCL, KdTreeFLANN_32_vs_64_bit)
KdTreeFLANN
<
PointXYZ
>
tree
;
tree
.
setInputCloud
(
cloud_in
);
std
::
vector
<
std
::
vector
<
int
>
>
nn_indices_vector
;
std
::
vector
<
pcl
::
Indices
>
nn_indices_vector
;
for
(
std
::
size_t
i
=
0
;
i
<
cloud_in
->
size
();
++
i
)
if
(
isFinite
((
*
cloud_in
)[
i
]))
{
std
::
vector
<
int
>
nn_indices
;
pcl
::
Indices
nn_indices
;
std
::
vector
<
float
>
nn_dists
;
tree
.
radiusSearch
((
*
cloud_in
)[
i
],
0.02
,
nn_indices
,
nn_dists
);
...
...
test/keypoints/test_keypoints.cpp
浏览文件 @
1d482d52
...
...
@@ -147,7 +147,7 @@ TEST (PCL, SIFTKeypoint_radiusSearch)
}
Eigen
::
MatrixXf
diff_of_gauss
;
std
::
vector
<
int
>
nn_indices
;
pcl
::
Indices
nn_indices
;
std
::
vector
<
float
>
nn_dist
;
diff_of_gauss
.
resize
(
input
.
size
(),
scales
.
size
()
-
1
);
...
...
@@ -157,8 +157,8 @@ TEST (PCL, SIFTKeypoint_radiusSearch)
tree
.
radiusSearch
(
i_point
,
max_radius
,
nn_indices
,
nn_dist
);
// Are they all unique?
std
::
set
<
in
t
>
unique_indices
;
for
(
const
int
&
nn_index
:
nn_indices
)
std
::
set
<
pcl
::
index_
t
>
unique_indices
;
for
(
const
auto
&
nn_index
:
nn_indices
)
{
unique_indices
.
insert
(
nn_index
);
}
...
...
test/recognition/test_recognition_cg.cpp
浏览文件 @
1d482d52
...
...
@@ -79,7 +79,7 @@ computeRmsE (const PointCloud<PointType>::ConstPtr &model, const PointCloud<Poin
double
sqr_norm_sum
=
0
;
int
found_points
=
0
;
std
::
vector
<
int
>
neigh_indices
(
1
);
pcl
::
Indices
neigh_indices
(
1
);
std
::
vector
<
float
>
neigh_sqr_dists
(
1
);
for
(
const
auto
&
model
:
transformed_model
)
{
...
...
@@ -221,7 +221,7 @@ main (int argc, char** argv)
{
if
(
std
::
isfinite
(
scene_descriptors_
->
at
(
i
).
descriptor
[
0
]
)
)
{
std
::
vector
<
int
>
neigh_indices
(
1
);
pcl
::
Indices
neigh_indices
(
1
);
std
::
vector
<
float
>
neigh_sqr_dists
(
1
);
int
found_neighs
=
match_search
.
nearestKSearch
(
scene_descriptors_
->
at
(
i
),
1
,
neigh_indices
,
neigh_sqr_dists
);
if
(
found_neighs
==
1
&&
neigh_sqr_dists
[
0
]
<
0.25
f
)
...
...
test/sample_consensus/test_sample_consensus_line_models.cpp
浏览文件 @
1d482d52
...
...
@@ -78,11 +78,11 @@ TEST (SampleConsensusModelLine, RANSAC)
bool
result
=
sac
.
computeModel
();
ASSERT_TRUE
(
result
);
std
::
vector
<
int
>
sample
;
pcl
::
Indices
sample
;
sac
.
getModel
(
sample
);
EXPECT_EQ
(
2
,
sample
.
size
());
std
::
vector
<
int
>
inliers
;
pcl
::
Indices
inliers
;
sac
.
getInliers
(
inliers
);
EXPECT_EQ
(
8
,
inliers
.
size
());
...
...
@@ -136,7 +136,7 @@ TEST (SampleConsensusModelLine, OnGroundPlane)
bool
result
=
sac
.
computeModel
();
ASSERT_TRUE
(
result
);
std
::
vector
<
int
>
inliers
;
pcl
::
Indices
inliers
;
sac
.
getInliers
(
inliers
);
EXPECT_EQ
(
6
,
inliers
.
size
());
...
...
@@ -188,11 +188,11 @@ TEST (SampleConsensusModelParallelLine, RANSAC)
bool
result
=
sac
.
computeModel
();
ASSERT_TRUE
(
result
);
std
::
vector
<
int
>
sample
;
pcl
::
Indices
sample
;
sac
.
getModel
(
sample
);
EXPECT_EQ
(
2
,
sample
.
size
());
std
::
vector
<
int
>
inliers
;
pcl
::
Indices
inliers
;
sac
.
getInliers
(
inliers
);
EXPECT_EQ
(
6
,
inliers
.
size
());
...
...
test/sample_consensus/test_sample_consensus_plane_models.cpp
浏览文件 @
1d482d52
...
...
@@ -61,7 +61,7 @@ using SampleConsensusModelNormalParallelPlanePtr = SampleConsensusModelNormalPar
PointCloud
<
PointXYZ
>::
Ptr
cloud_
(
new
PointCloud
<
PointXYZ
>
());
PointCloud
<
Normal
>::
Ptr
normals_
(
new
PointCloud
<
Normal
>
());
std
::
vector
<
int
>
indices_
;
pcl
::
Indices
indices_
;
float
plane_coeffs_
[]
=
{
-
0.8964
f
,
-
0.5868
f
,
-
1.208
f
};
template
<
typename
ModelType
,
typename
SacType
>
...
...
@@ -76,11 +76,11 @@ void verifyPlaneSac (ModelType& model,
bool
result
=
sac
.
computeModel
();
ASSERT_TRUE
(
result
);
std
::
vector
<
int
>
sample
;
pcl
::
Indices
sample
;
sac
.
getModel
(
sample
);
EXPECT_EQ
(
3
,
sample
.
size
());
std
::
vector
<
int
>
inliers
;
pcl
::
Indices
inliers
;
sac
.
getInliers
(
inliers
);
EXPECT_LT
(
inlier_number
,
inliers
.
size
());
...
...
@@ -276,7 +276,7 @@ TEST (SampleConsensusModelNormalParallelPlane, RANSAC)
RandomSampleConsensus
<
PointXYZ
>
sac
(
model
,
0.03
);
sac
.
computeModel
();
std
::
vector
<
int
>
inliers
;
pcl
::
Indices
inliers
;
sac
.
getInliers
(
inliers
);
ASSERT_EQ
(
cloud
.
size
(),
inliers
.
size
());
}
...
...
@@ -287,7 +287,7 @@ TEST (SampleConsensusModelNormalParallelPlane, RANSAC)
RandomSampleConsensus
<
PointXYZ
>
sac
(
model
,
0.03
);
sac
.
computeModel
();
std
::
vector
<
int
>
inliers
;
pcl
::
Indices
inliers
;
sac
.
getInliers
(
inliers
);
ASSERT_EQ
(
cloud
.
size
(),
inliers
.
size
());
}
...
...
@@ -298,7 +298,7 @@ TEST (SampleConsensusModelNormalParallelPlane, RANSAC)
RandomSampleConsensus
<
PointXYZ
>
sac
(
model
,
0.03
);
sac
.
computeModel
();
std
::
vector
<
int
>
inliers
;
pcl
::
Indices
inliers
;
sac
.
getInliers
(
inliers
);
ASSERT_EQ
(
0
,
inliers
.
size
());
}
...
...
@@ -327,7 +327,7 @@ TEST (SampleConsensusModelPlane, SIMD_countWithinDistance) // Test if all countW
{
// Generate a cloud with 1000 random points
PointCloud
<
PointXYZ
>
cloud
;
std
::
vector
<
int
>
indices
;
pcl
::
Indices
indices
;
cloud
.
resize
(
1000
);
for
(
std
::
size_t
idx
=
0
;
idx
<
cloud
.
size
();
++
idx
)
{
...
...
@@ -392,7 +392,7 @@ TEST (SampleConsensusModelNormalPlane, SIMD_countWithinDistance) // Test if all
// Generate a cloud with 10000 random points
PointCloud
<
PointXYZ
>
cloud
;
PointCloud
<
Normal
>
normal_cloud
;
std
::
vector
<
int
>
indices
;
pcl
::
Indices
indices
;
cloud
.
resize
(
10000
);
normal_cloud
.
resize
(
10000
);
for
(
std
::
size_t
idx
=
0
;
idx
<
cloud
.
size
();
++
idx
)
...
...
test/sample_consensus/test_sample_consensus_quadric_models.cpp
浏览文件 @
1d482d52
...
...
@@ -84,11 +84,11 @@ TEST (SampleConsensusModelSphere, RANSAC)
bool
result
=
sac
.
computeModel
();
ASSERT_TRUE
(
result
);
std
::
vector
<
int
>
sample
;
pcl
::
Indices
sample
;
sac
.
getModel
(
sample
);
EXPECT_EQ
(
4
,
sample
.
size
());
std
::
vector
<
int
>
inliers
;
pcl
::
Indices
inliers
;
sac
.
getInliers
(
inliers
);
EXPECT_EQ
(
9
,
inliers
.
size
());
...
...
@@ -130,7 +130,7 @@ TEST (SampleConsensusModelSphere, SIMD_countWithinDistance) // Test if all count
{
// Generate a cloud with 1000 random points
PointCloud
<
PointXYZ
>
cloud
;
std
::
vector
<
int
>
indices
;
pcl
::
Indices
indices
;
cloud
.
resize
(
1000
);
for
(
std
::
size_t
idx
=
0
;
idx
<
cloud
.
size
();
++
idx
)
{
...
...
@@ -244,11 +244,11 @@ TEST (SampleConsensusModelNormalSphere, RANSAC)
bool
result
=
sac
.
computeModel
();
ASSERT_TRUE
(
result
);
std
::
vector
<
int
>
sample
;
pcl
::
Indices
sample
;
sac
.
getModel
(
sample
);
EXPECT_EQ
(
4
,
sample
.
size
());
std
::
vector
<
int
>
inliers
;
pcl
::
Indices
inliers
;
sac
.
getInliers
(
inliers
);
EXPECT_EQ
(
27
,
inliers
.
size
());
...
...
@@ -353,11 +353,11 @@ TEST (SampleConsensusModelCone, RANSAC)
bool
result
=
sac
.
computeModel
();
ASSERT_TRUE
(
result
);
std
::
vector
<
int
>
sample
;
pcl
::
Indices
sample
;
sac
.
getModel
(
sample
);
EXPECT_EQ
(
3
,
sample
.
size
());
std
::
vector
<
int
>
inliers
;
pcl
::
Indices
inliers
;
sac
.
getInliers
(
inliers
);
EXPECT_EQ
(
31
,
inliers
.
size
());
...
...
@@ -437,11 +437,11 @@ TEST (SampleConsensusModelCylinder, RANSAC)
bool
result
=
sac
.
computeModel
();
ASSERT_TRUE
(
result
);
std
::
vector
<
int
>
sample
;
pcl
::
Indices
sample
;
sac
.
getModel
(
sample
);
EXPECT_EQ
(
2
,
sample
.
size
());
std
::
vector
<
int
>
inliers
;
pcl
::
Indices
inliers
;
sac
.
getInliers
(
inliers
);
EXPECT_EQ
(
20
,
inliers
.
size
());
...
...
@@ -496,11 +496,11 @@ TEST (SampleConsensusModelCircle2D, RANSAC)
bool
result
=
sac
.
computeModel
();
ASSERT_TRUE
(
result
);
std
::
vector
<
int
>
sample
;
pcl
::
Indices
sample
;
sac
.
getModel
(
sample
);
EXPECT_EQ
(
3
,
sample
.
size
());
std
::
vector
<
int
>
inliers
;
pcl
::
Indices
inliers
;
sac
.
getInliers
(
inliers
);
EXPECT_EQ
(
17
,
inliers
.
size
());
...
...
@@ -542,7 +542,7 @@ TEST (SampleConsensusModelCircle2D, SIMD_countWithinDistance) // Test if all cou
{
// Generate a cloud with 1000 random points
PointCloud
<
PointXYZ
>
cloud
;
std
::
vector
<
int
>
indices
;
pcl
::
Indices
indices
;
cloud
.
resize
(
1000
);
for
(
std
::
size_t
idx
=
0
;
idx
<
cloud
.
size
();
++
idx
)
{
...
...
@@ -619,11 +619,11 @@ TEST (SampleConsensusModelCircle3D, RANSAC)
bool
result
=
sac
.
computeModel
();
ASSERT_TRUE
(
result
);
std
::
vector
<
int
>
sample
;
pcl
::
Indices
sample
;
sac
.
getModel
(
sample
);
EXPECT_EQ
(
3
,
sample
.
size
());
std
::
vector
<
int
>
inliers
;
pcl
::
Indices
inliers
;
sac
.
getInliers
(
inliers
);
EXPECT_EQ
(
18
,
inliers
.
size
());
...
...
test/search/test_flann_search.cpp
浏览文件 @
1d482d52
...
...
@@ -94,7 +94,7 @@ TEST (PCL, FlannSearch_nearestKSearch)
++
counter
;
}
std
::
vector
<
int
>
k_indices
;
pcl
::
Indices
k_indices
;
k_indices
.
resize
(
no_of_neighbors
);
std
::
vector
<
float
>
k_distances
;
k_distances
.
resize
(
no_of_neighbors
);
...
...
@@ -146,12 +146,12 @@ TEST (PCL, FlannSearch_differentPointT)
std
::
vector
<
std
::
vector
<
int
>
>
indices
;
FlannSearch
.
nearestKSearchT
(
cloud_rgb
,
std
::
vector
<
int
>
(),
no_of_neighbors
,
indices
,
dists
);
std
::
vector
<
int
>
k_indices
;
pcl
::
Indices
k_indices
;
k_indices
.
resize
(
no_of_neighbors
);
std
::
vector
<
float
>
k_distances
;
k_distances
.
resize
(
no_of_neighbors
);
//
vector<int>
k_indices_t;
//
pcl::Indices
k_indices_t;
//k_indices_t.resize (no_of_neighbors);
//vector<float> k_distances_t;
//k_distances_t.resize (no_of_neighbors);
...
...
@@ -187,7 +187,7 @@ TEST (PCL, FlannSearch_multipointKnnSearch)
std
::
vector
<
std
::
vector
<
int
>
>
indices
;
FlannSearch
.
nearestKSearch
(
cloud_big
,
std
::
vector
<
int
>
(),
no_of_neighbors
,
indices
,
dists
);
std
::
vector
<
int
>
k_indices
;
pcl
::
Indices
k_indices
;
k_indices
.
resize
(
no_of_neighbors
);
std
::
vector
<
float
>
k_distances
;
k_distances
.
resize
(
no_of_neighbors
);
...
...
@@ -225,7 +225,7 @@ TEST (PCL, FlannSearch_knnByIndex)
}
flann_search
.
nearestKSearch
(
cloud_big
,
query_indices
,
no_of_neighbors
,
indices
,
dists
);
std
::
vector
<
int
>
k_indices
;
pcl
::
Indices
k_indices
;
k_indices
.
resize
(
no_of_neighbors
);
std
::
vector
<
float
>
k_distances
;
k_distances
.
resize
(
no_of_neighbors
);
...
...
@@ -256,7 +256,7 @@ TEST (PCL, FlannSearch_compareToKdTreeFlann)
{
int
no_of_neighbors
=
3
;
std
::
vector
<
int
>
k_indices
;
pcl
::
Indices
k_indices
;
k_indices
.
resize
(
no_of_neighbors
);
std
::
vector
<
float
>
k_distances
;
k_distances
.
resize
(
no_of_neighbors
);
...
...
@@ -289,9 +289,9 @@ TEST (PCL, FlannSearch_compareToKdTreeFlann)
kdtree_search
->
nearestKSearch
(
point
,
no_of_neighbors
,
k_indices
,
k_distances
);
}
std
::
vector
<
std
::
vector
<
int
>
>
indices_flann
;
std
::
vector
<
pcl
::
Indices
>
indices_flann
;
std
::
vector
<
std
::
vector
<
float
>
>
dists_flann
;
std
::
vector
<
std
::
vector
<
int
>
>
indices_tree
;
std
::
vector
<
pcl
::
Indices
>
indices_tree
;
std
::
vector
<
std
::
vector
<
float
>
>
dists_tree
;
indices_flann
.
resize
(
cloud_big
.
size
());
dists_flann
.
resize
(
cloud_big
.
size
());
...
...
@@ -332,7 +332,7 @@ TEST (PCL, FlannSearch_compareToKdTreeFlann)
}
std
::
vector
<
int
>
query_indices
;
pcl
::
Indices
query_indices
;
for
(
std
::
size_t
i
=
0
;
i
<
cloud_big
.
size
();
i
+=
2
)
query_indices
.
push_back
(
int
(
i
));
...
...
test/search/test_kdtree.cpp
浏览文件 @
1d482d52
...
...
@@ -90,7 +90,7 @@ init ()
++
counter
;
}
std
::
vector
<
int
>
k_indices
;
pcl
::
Indices
k_indices
;
k_indices
.
resize
(
no_of_neighbors
);
std
::
vector
<
float
>
k_distances
;
k_distances
.
resize
(
no_of_neighbors
);
...
...
@@ -140,12 +140,12 @@ TEST (PCL, KdTree_differentPointT)
std
::
vector
<
std
::
vector
<
int
>
>
indices
;
kdtree
.
nearestKSearchT
(
cloud_rgb
,
std
::
vector
<
int
>
(),
no_of_neighbors
,
indices
,
dists
);
std
::
vector
<
int
>
k_indices
;
pcl
::
Indices
k_indices
;
k_indices
.
resize
(
no_of_neighbors
);
std
::
vector
<
float
>
k_distances
;
k_distances
.
resize
(
no_of_neighbors
);
std
::
vector
<
int
>
k_indices_t
;
pcl
::
Indices
k_indices_t
;
k_indices_t
.
resize
(
no_of_neighbors
);
std
::
vector
<
float
>
k_distances_t
;
k_distances_t
.
resize
(
no_of_neighbors
);
...
...
@@ -178,7 +178,7 @@ TEST (PCL, KdTree_multipointKnnSearch)
std
::
vector
<
std
::
vector
<
int
>
>
indices
;
kdtree
.
nearestKSearch
(
cloud_big
,
std
::
vector
<
int
>
(),
no_of_neighbors
,
indices
,
dists
);
std
::
vector
<
int
>
k_indices
;
pcl
::
Indices
k_indices
;
k_indices
.
resize
(
no_of_neighbors
);
std
::
vector
<
float
>
k_distances
;
k_distances
.
resize
(
no_of_neighbors
);
...
...
test/search/test_octree.cpp
浏览文件 @
1d482d52
...
...
@@ -83,7 +83,7 @@ TEST (PCL, Octree_Pointcloud_Nearest_K_Neighbour_Search)
// create octree
pcl
::
search
::
Octree
<
PointXYZ
>
octree
(
0.1
);
std
::
vector
<
int
>
k_indices
;
pcl
::
Indices
k_indices
;
std
::
vector
<
float
>
k_sqr_distances
;
std
::
vector
<
int
>
k_indices_bruteforce
;
...
...
@@ -259,7 +259,7 @@ TEST (PCL, Octree_RadiusSearch_GPU)
radiuses.push_back(radius);
radiuses.push_back(radius);
radiuses.push_back(radius);
std::vector<
std::vector<int>
> k_indices;
std::vector<
pcl::Indices
> k_indices;
std::vector<std::vector<float> > k_distances;
int max_nn = -1;
...
...
test/search/test_search.cpp
浏览文件 @
1d482d52
...
...
@@ -294,7 +294,7 @@ testKNNSearch (typename PointCloud<PointT>::ConstPtr point_cloud, std::vector<se
if
(
!
input_indices
.
empty
())
{
indices_mask
.
assign
(
point_cloud
->
size
(),
false
);
for
(
const
int
&
input_index
:
input_indices
)
for
(
const
auto
&
input_index
:
input_indices
)
indices_mask
[
input_index
]
=
true
;
}
...
...
@@ -322,7 +322,7 @@ testKNNSearch (typename PointCloud<PointT>::ConstPtr point_cloud, std::vector<se
for
(
unsigned
knn
=
1
;
knn
<=
512
;
knn
<<=
3
)
{
// find nn for each point in the cloud
for
(
const
int
&
query_index
:
query_indices
)
for
(
const
auto
&
query_index
:
query_indices
)
{
#pragma omp parallel for \
shared(indices, input_indices, indices_mask, distances, knn, nan_mask, passed, point_cloud, query_index, search_methods) \
...
...
@@ -372,7 +372,7 @@ testRadiusSearch (typename PointCloud<PointT>::ConstPtr point_cloud, std::vector
if
(
!
input_indices
.
empty
())
{
indices_mask
.
assign
(
point_cloud
->
size
(),
false
);
for
(
const
int
&
input_index
:
input_indices
)
for
(
const
auto
&
input_index
:
input_indices
)
indices_mask
[
input_index
]
=
true
;
}
...
...
@@ -401,7 +401,7 @@ testRadiusSearch (typename PointCloud<PointT>::ConstPtr point_cloud, std::vector
{
//std::cout << radius << std::endl;
// find nn for each point in the cloud
for
(
const
int
&
query_index
:
query_indices
)
for
(
const
auto
&
query_index
:
query_indices
)
{
#pragma omp parallel for \
default(none) \
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录