Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
08f50314
O
Opencv
项目概览
Greenplum
/
Opencv
11 个月 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
08f50314
编写于
1月 11, 2014
作者:
A
Anatoly Baksheev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
updated cylinder and cube
上级
c0cc5512
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
22 addition
and
12 deletion
+22
-12
modules/viz/doc/widget.rst
modules/viz/doc/widget.rst
+3
-3
modules/viz/include/opencv2/viz/widgets.hpp
modules/viz/include/opencv2/viz/widgets.hpp
+2
-2
modules/viz/src/shapes.cpp
modules/viz/src/shapes.cpp
+14
-7
modules/viz/test/tests_simple.cpp
modules/viz/test/tests_simple.cpp
+3
-0
未找到文件。
modules/viz/doc/widget.rst
浏览文件 @
08f50314
...
...
@@ -390,7 +390,7 @@ This 3D Widget defines a cylinder. ::
class CV_EXPORTS WCylinder : public Widget3D
{
public:
WCylinder(const Point3
f& pt_on_axis, const Point3f& axis_direction
, double radius, int numsides = 30, const Color &color = Color::white());
WCylinder(const Point3
d& axis_point1, const Point3d& axis_point2
, double radius, int numsides = 30, const Color &color = Color::white());
};
viz::WCylinder::WCylinder
...
...
@@ -399,8 +399,8 @@ Constructs a WCylinder.
.. ocv:function:: WCylinder(const Point3f& pt_on_axis, const Point3f& axis_direction, double radius, int numsides = 30, const Color &color = Color::white())
:param
pt_on_axis: A point
on the axis of the cylinder.
:param axis_
direction: Direction of
the axis of the cylinder.
:param
axis_point1: A point1
on the axis of the cylinder.
:param axis_
point2: A point2 on
the axis of the cylinder.
:param radius: Radius of the cylinder.
:param numsides: Resolution of the cylinder.
:param color: :ocv:class:`Color` of the cylinder.
...
...
modules/viz/include/opencv2/viz/widgets.hpp
浏览文件 @
08f50314
...
...
@@ -164,7 +164,7 @@ namespace cv
class
CV_EXPORTS
WCircle
:
public
Widget3D
{
public:
//! creates default
circle centred at origin with
normal along z-axis
//! creates default
planar circle centred at origin with plane
normal along z-axis
WCircle
(
double
radius
,
double
thickness
=
0.01
,
const
Color
&
color
=
Color
::
white
());
//! creates repositioned circle
...
...
@@ -174,7 +174,7 @@ namespace cv
class
CV_EXPORTS
WCylinder
:
public
Widget3D
{
public:
WCylinder
(
const
Point3d
&
pt_on_axis
,
const
Point3d
&
axis_direction
,
double
radius
,
int
numsides
=
30
,
const
Color
&
color
=
Color
::
white
());
WCylinder
(
const
Point3d
&
axis_point1
,
const
Point3d
&
axis_point2
,
double
radius
,
int
numsides
=
30
,
const
Color
&
color
=
Color
::
white
());
};
class
CV_EXPORTS
WCube
:
public
Widget3D
...
...
modules/viz/src/shapes.cpp
浏览文件 @
08f50314
...
...
@@ -256,17 +256,16 @@ template<> cv::viz::WCircle cv::viz::Widget::cast<cv::viz::WCircle>()
///////////////////////////////////////////////////////////////////////////////////////////////
/// cylinder widget implementation
cv
::
viz
::
WCylinder
::
WCylinder
(
const
Point3d
&
pt_on_axis
,
const
Point3d
&
axis_direction
,
double
radius
,
int
numsides
,
const
Color
&
color
)
cv
::
viz
::
WCylinder
::
WCylinder
(
const
Point3d
&
axis_point1
,
const
Point3d
&
axis_point2
,
double
radius
,
int
numsides
,
const
Color
&
color
)
{
const
Point3d
pt2
=
pt_on_axis
+
axis_direction
;
vtkSmartPointer
<
vtkLineSource
>
line
=
vtkSmartPointer
<
vtkLineSource
>::
New
();
line
->
SetPoint1
(
pt_on_axis
.
x
,
pt_on_axis
.
y
,
pt_on_axis
.
z
);
line
->
SetPoint2
(
pt2
.
x
,
pt2
.
y
,
p
t2
.
z
);
line
->
SetPoint1
(
axis_point1
.
x
,
axis_point1
.
y
,
axis_point1
.
z
);
line
->
SetPoint2
(
axis_point2
.
x
,
axis_point2
.
y
,
axis_poin
t2
.
z
);
vtkSmartPointer
<
vtkTubeFilter
>
tuber
=
vtkSmartPointer
<
vtkTubeFilter
>::
New
();
tuber
->
SetInputConnection
(
line
->
GetOutputPort
());
tuber
->
SetRadius
(
radius
);
tuber
->
SetNumberOfSides
(
numsides
);
tuber
->
SetRadius
(
radius
);
tuber
->
Update
();
vtkSmartPointer
<
vtkPolyDataMapper
>
mapper
=
vtkSmartPointer
<
vtkPolyDataMapper
>::
New
();
...
...
@@ -290,16 +289,24 @@ template<> cv::viz::WCylinder cv::viz::Widget::cast<cv::viz::WCylinder>()
cv
::
viz
::
WCube
::
WCube
(
const
Point3d
&
min_point
,
const
Point3d
&
max_point
,
bool
wire_frame
,
const
Color
&
color
)
{
double
bounds
[
6
];
bounds
[
0
]
=
std
::
min
(
min_point
.
x
,
max_point
.
x
);
bounds
[
1
]
=
std
::
max
(
min_point
.
x
,
max_point
.
x
);
bounds
[
2
]
=
std
::
min
(
min_point
.
y
,
max_point
.
y
);
bounds
[
3
]
=
std
::
max
(
min_point
.
y
,
max_point
.
y
);
bounds
[
4
]
=
std
::
min
(
min_point
.
z
,
max_point
.
z
);
bounds
[
5
]
=
std
::
max
(
min_point
.
z
,
max_point
.
z
);
vtkSmartPointer
<
vtkPolyDataAlgorithm
>
cube
;
if
(
wire_frame
)
{
cube
=
vtkSmartPointer
<
vtkOutlineSource
>::
New
();
vtkOutlineSource
::
SafeDownCast
(
cube
)
->
SetBounds
(
min_point
.
x
,
max_point
.
x
,
min_point
.
y
,
max_point
.
y
,
min_point
.
z
,
max_point
.
z
);
vtkOutlineSource
::
SafeDownCast
(
cube
)
->
SetBounds
(
bounds
);
}
else
{
cube
=
vtkSmartPointer
<
vtkCubeSource
>::
New
();
vtkCubeSource
::
SafeDownCast
(
cube
)
->
SetBounds
(
min_point
.
x
,
max_point
.
x
,
min_point
.
y
,
max_point
.
y
,
min_point
.
z
,
max_point
.
z
);
vtkCubeSource
::
SafeDownCast
(
cube
)
->
SetBounds
(
bounds
);
}
cube
->
Update
();
...
...
modules/viz/test/tests_simple.cpp
浏览文件 @
08f50314
...
...
@@ -293,9 +293,12 @@ TEST(Viz, show_simple_widgets)
Viz3d
viz
(
"show_simple_widgets"
);
viz
.
showWidget
(
"coos"
,
WCoordinateSystem
());
viz
.
showWidget
(
"cube"
,
WCube
());
viz
.
showWidget
(
"cub0"
,
WCube
(
Vec3d
::
all
(
-
1.0
),
Vec3d
::
all
(
-
0.5
),
false
,
Color
::
indigo
()));
viz
.
showWidget
(
"arro"
,
WArrow
(
Vec3d
::
all
(
-
0.5
),
Vec3d
::
all
(
0.5
),
0.009
,
Color
::
raspberry
()));
viz
.
showWidget
(
"cir1"
,
WCircle
(
0.5
,
0.01
,
Color
::
bluberry
()));
viz
.
showWidget
(
"cir2"
,
WCircle
(
0.5
,
Point3d
(
0.5
,
0.0
,
0.0
),
Vec3d
(
1.0
,
0.0
,
0.0
),
0.01
,
Color
::
apricot
()));
viz
.
showWidget
(
"cyl0"
,
WCylinder
(
Vec3d
(
-
0.5
,
0.5
,
-
0.5
),
Vec3d
(
0.5
,
0.5
,
-
0.5
),
0.125
,
30
,
Color
::
brown
()));
viz
.
spin
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录