Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
za0612
pcl
提交
fce4141a
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,发现更多精彩内容 >>
未验证
提交
fce4141a
编写于
1月 31, 2020
作者:
K
Kunal Tyagi
提交者:
GitHub
1月 31, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3574 from office-florian-hubner/index_issue_IntegralImageNormalEstimation
Fix indexing in IntegralImageNormalEstimation #3573
上级
a551526b
98c02b06
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
82 addition
and
4 deletion
+82
-4
features/include/pcl/features/impl/integral_image_normal.hpp
features/include/pcl/features/impl/integral_image_normal.hpp
+4
-4
test/features/test_normal_estimation.cpp
test/features/test_normal_estimation.cpp
+78
-0
未找到文件。
features/include/pcl/features/impl/integral_image_normal.hpp
浏览文件 @
fce4141a
...
...
@@ -1047,7 +1047,7 @@ pcl::IntegralImageNormalEstimation<PointInT, PointOutT>::computeFeaturePart (con
continue
;
}
if
(
u
<
border
||
v
>
right
)
if
(
u
<
border
||
u
>
right
)
{
output
.
points
[
idx
].
getNormalVector3fMap
().
setConstant
(
bad_point
);
output
.
points
[
idx
].
curvature
=
bad_point
;
...
...
@@ -1091,7 +1091,7 @@ pcl::IntegralImageNormalEstimation<PointInT, PointOutT>::computeFeaturePart (con
continue
;
}
if
(
u
<
border
||
v
>
right
)
if
(
u
<
border
||
u
>
right
)
{
output
.
points
[
idx
].
getNormalVector3fMap
().
setConstant
(
bad_point
);
output
.
points
[
idx
].
curvature
=
bad_point
;
...
...
@@ -1114,8 +1114,8 @@ pcl::IntegralImageNormalEstimation<PointInT, PointOutT>::computeFeaturePart (con
}
else
{
output
[
pt_inde
x
].
getNormalVector3fMap
().
setConstant
(
bad_point
);
output
[
pt_inde
x
].
curvature
=
bad_point
;
output
[
id
x
].
getNormalVector3fMap
().
setConstant
(
bad_point
);
output
[
id
x
].
curvature
=
bad_point
;
}
}
}
...
...
test/features/test_normal_estimation.cpp
浏览文件 @
fce4141a
...
...
@@ -41,6 +41,7 @@
#include <pcl/point_cloud.h>
#include <pcl/features/normal_3d.h>
#include <pcl/features/normal_3d_omp.h>
#include <pcl/features/integral_image_normal.h>
#include <pcl/io/pcd_io.h>
using
namespace
pcl
;
...
...
@@ -213,6 +214,83 @@ TEST (PCL, NormalEstimationOpenMP)
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// This tests the indexing issue from #3573
// In certain cases when you used a subset of the indices
// and set the depth dependent smoothing to false the
// IntegralImageNormalEstimation could crash or produce
// incorrect normals.
// This test reproduces the issue.
TEST
(
PCL
,
IntegralImageNormalEstimationIndexingIssue
)
{
PointCloud
<
PointXYZ
>::
Ptr
cloudptr
(
new
PointCloud
<
PointXYZ
>
());
cloudptr
->
width
=
100
;
cloudptr
->
height
=
100
;
cloudptr
->
points
.
clear
();
cloudptr
->
points
.
resize
(
cloudptr
->
width
*
cloudptr
->
height
);
int
centerX
=
cloudptr
->
width
>>
1
;
int
centerY
=
cloudptr
->
height
>>
1
;
int
idx
=
0
;
for
(
int
ypos
=
-
centerY
;
ypos
<
centerY
;
ypos
++
)
{
for
(
int
xpos
=
-
centerX
;
xpos
<
centerX
;
xpos
++
)
{
double
z
=
xpos
<
0.0
?
1.0
:
0.0
;
double
y
=
ypos
;
double
x
=
xpos
;
cloudptr
->
points
[
idx
++
]
=
PointXYZ
(
float
(
x
),
float
(
y
),
float
(
z
));
}
}
pcl
::
IndicesPtr
indicesptr
(
new
pcl
::
Indices
());
indicesptr
->
resize
(
cloudptr
->
size
()
/
2
);
for
(
int
i
=
0
;
i
<
cloudptr
->
size
()
/
2
;
++
i
)
{
(
*
indicesptr
)[
i
]
=
i
+
cloudptr
->
size
()
/
2
;
}
IntegralImageNormalEstimation
<
PointXYZ
,
Normal
>
n
;
// Object
PointCloud
<
Normal
>::
Ptr
normals
(
new
PointCloud
<
Normal
>
());
// set parameters
n
.
setInputCloud
(
cloudptr
);
n
.
setIndices
(
indicesptr
);
n
.
setDepthDependentSmoothing
(
false
);
// estimate
n
.
compute
(
*
normals
);
std
::
vector
<
PointXYZ
>
normalsVec
;
normalsVec
.
resize
(
normals
->
size
());
for
(
int
i
=
0
;
i
<
normals
->
size
();
++
i
)
{
normalsVec
[
i
].
x
=
normals
->
points
[
i
].
normal_x
;
normalsVec
[
i
].
y
=
normals
->
points
[
i
].
normal_y
;
normalsVec
[
i
].
z
=
normals
->
points
[
i
].
normal_z
;
}
for
(
const
auto
&
point
:
normals
->
points
)
{
if
(
std
::
isnan
(
point
.
normal_x
)
||
std
::
isnan
(
point
.
normal_y
)
||
std
::
isnan
(
point
.
normal_z
))
{
continue
;
}
EXPECT_NEAR
(
point
.
normal
[
0
],
0.0
,
1e-4
);
EXPECT_NEAR
(
point
.
normal
[
1
],
0.0
,
1e-4
);
EXPECT_NEAR
(
point
.
normal
[
2
],
-
1.0
,
1e-4
);
EXPECT_TRUE
(
std
::
isnan
(
point
.
curvature
));
}
}
/* ---[ */
int
main
(
int
argc
,
char
**
argv
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录