Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
za0612
pcl
提交
ad739064
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 搜索 >>
提交
ad739064
编写于
3月 05, 2014
作者:
J
Jochen Sprickerhof
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #555 from nizar-sallem/mark_points_float
Add: markPoints with float coordinates for u and v
上级
12a6256d
e34e8d34
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
33 addition
and
11 deletion
+33
-11
visualization/include/pcl/visualization/image_viewer.h
visualization/include/pcl/visualization/image_viewer.h
+12
-0
visualization/src/image_viewer.cpp
visualization/src/image_viewer.cpp
+21
-11
未找到文件。
visualization/include/pcl/visualization/image_viewer.h
浏览文件 @
ad739064
...
...
@@ -441,6 +441,18 @@ namespace pcl
markPoints
(
const
std
::
vector
<
int
>&
uv
,
Vector3ub
fg_color
,
Vector3ub
bg_color
=
red_color
,
double
size
=
3.0
,
const
std
::
string
&
layer_id
=
"markers"
,
double
opacity
=
1.0
);
/** \brief Sets the pixel at coordinates(u,v) to color while setting the neighborhood to another (float coordinates version).
* \param[in] uv the u/x, v/y coordinate of the pixels to be marked
* \param[in] fg_color the pixel color
* \param[in] bg_color the neighborhood color
* \param[in] size edge of the square surrounding each pixel
* \param[in] layer_id the name of the layer (default: "markers")
* \param[in] opacity the opacity of the layer (default: 1.0)
*/
void
markPoints
(
const
std
::
vector
<
float
>&
uv
,
Vector3ub
fg_color
,
Vector3ub
bg_color
=
red_color
,
double
size
=
3.0
,
const
std
::
string
&
layer_id
=
"markers"
,
double
opacity
=
1.0
);
/** \brief Set the window title name
* \param[in] name the window title
*/
...
...
visualization/src/image_viewer.cpp
浏览文件 @
ad739064
...
...
@@ -936,6 +936,21 @@ pcl::visualization::ImageViewer::markPoints (
if
(
uv
.
size
()
==
0
)
return
;
std
::
vector
<
float
>
float_uv
(
uv
.
size
());
for
(
std
::
size_t
i
=
0
;
i
<
uv
.
size
();
++
i
)
float_uv
[
i
]
=
static_cast
<
float
>
(
uv
[
i
]);
return
(
markPoints
(
float_uv
,
fg_color
,
bg_color
,
size
,
layer_id
,
opacity
));
}
//////////////////////////////////////////////////////////////////////////////////////////
void
pcl
::
visualization
::
ImageViewer
::
markPoints
(
const
std
::
vector
<
float
>&
uv
,
Vector3ub
fg_color
,
Vector3ub
bg_color
,
double
size
,
const
std
::
string
&
layer_id
,
double
opacity
)
{
if
(
uv
.
size
()
==
0
)
return
;
// Check to see if this ID entry already exists (has it been already added to the visualizer?)
LayerMap
::
iterator
am_it
=
std
::
find_if
(
layer_map_
.
begin
(),
layer_map_
.
end
(),
LayerComparator
(
layer_id
));
if
(
am_it
==
layer_map_
.
end
())
...
...
@@ -949,20 +964,15 @@ pcl::visualization::ImageViewer::markPoints (
vtkSmartPointer
<
context_items
::
Markers
>
markers
=
vtkSmartPointer
<
context_items
::
Markers
>::
New
();
markers
->
setOpacity
(
opacity
);
std
::
vector
<
float
>
points
(
uv
.
size
());
std
::
size_t
nb_points
=
points
.
size
()
/
2
;
for
(
std
::
size_t
i
=
0
;
i
<
nb_points
;
++
i
)
{
std
::
size_t
ii
=
2
*
i
;
points
[
ii
]
=
static_cast
<
float
>
(
uv
[
ii
]);
#if ((VTK_MAJOR_VERSION == 5) && (VTK_MINOR_VERSION > 10))
points
[
ii
]
=
static_cast
<
float
>
(
uv
[
ii
+
1
]
);
markers
->
set
(
uv
);
#else
points
[
ii
+
1
]
=
static_cast
<
float
>
(
getSize
()[
1
]
-
uv
[
ii
+
1
]);
#endif
}
// translate v which is on odd indices
std
::
vector
<
float
>
points
=
uv
;
for
(
std
::
size_t
i
=
1
;
i
<
points
.
size
();
i
+=
2
)
points
[
i
]
=
getSize
()[
1
]
-
points
[
i
];
markers
->
set
(
points
);
#endif
markers
->
setSize
(
size
);
markers
->
setColors
(
bg_color
[
0
],
bg_color
[
1
],
bg_color
[
2
]);
markers
->
setPointColors
(
fg_color
[
0
],
fg_color
[
1
],
fg_color
[
2
]);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录