Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
658f4a7d
O
Opencv
项目概览
Greenplum
/
Opencv
大约 1 年 前同步成功
通知
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,发现更多精彩内容 >>
提交
658f4a7d
编写于
1月 12, 2014
作者:
A
Anatoly Baksheev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactoed plane
上级
53b82186
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
54 addition
and
14 deletion
+54
-14
modules/viz/doc/widget.rst
modules/viz/doc/widget.rst
+15
-10
modules/viz/include/opencv2/viz/widgets.hpp
modules/viz/include/opencv2/viz/widgets.hpp
+5
-2
modules/viz/src/shapes.cpp
modules/viz/src/shapes.cpp
+30
-0
modules/viz/test/tests_simple.cpp
modules/viz/test/tests_simple.cpp
+4
-2
未找到文件。
modules/viz/doc/widget.rst
浏览文件 @
658f4a7d
...
...
@@ -274,25 +274,30 @@ This 3D Widget defines a finite plane. ::
class CV_EXPORTS WPlane : public Widget3D
{
public:
WPlane(const Vec4d& coefs, double size = 1.0, const Color &color = Color::white());
WPlane(const Vec4d& coefs, const Point3f& pt, double size = 1.0, const Color &color = Color::white());
//! created default plane with center point at origin and normal oriented along z-axis
WPlane(const Size2d& size = Size2d(1.0, 1.0), const Color &color = Color::white());
//! repositioned plane
WPlane(const Point3d& center, const Vec3d& normal, const Vec3d& new_plane_yaxis,const Size2d& size = Size2d(1.0, 1.0), const Color &color = Color::white());
};
viz::WPlane::WPlane
-------------------
Constructs a
WPlane
.
Constructs a
default plane with center point at origin and normal oriented along z-axis
.
.. ocv:function:: WPlane(const
Vec4d& coefs, double size = 1.0, const Color &color = Color::white())
.. ocv:function:: WPlane(const
Size2d& size = Size2d(1.0, 1.0), const Color &color = Color::white());
:param coefs: Plane coefficients as in (A,B,C,D) where Ax + By + Cz + D = 0.
:param size: Size of the plane.
:param size: Size of the plane
:param color: :ocv:class:`Color` of the plane.
.. ocv:function:: WPlane(const Vec4d& coefs, const Point3f& pt, double size = 1.0, const Color &color = Color::white())
viz::WPlane::WPlane
Constructs a repositioned plane
.. ocv:function:: WPlane(const Point3d& center, const Vec3d& normal, const Vec3d& new_plane_yaxis,const Size2d& size = Size2d(1.0, 1.0), const Color &color = Color::white());
:param c
oefs: Plane coefficients as in (A,B,C,D) where Ax + By + Cz + D = 0.
:param
pt: Position of the plane.
:param
size: Size of the plane
.
:param c
enter: Center of the plane
:param
normal: Plane normal orientation
:param
new_plane_yaxis: Up-vector. New orientation of plane y-axis
.
:param color: :ocv:class:`Color` of the plane.
viz::WSphere
...
...
modules/viz/include/opencv2/viz/widgets.hpp
浏览文件 @
658f4a7d
...
...
@@ -145,8 +145,11 @@ namespace cv
class
CV_EXPORTS
WPlane
:
public
Widget3D
{
public:
WPlane
(
const
Vec4d
&
coefs
,
double
size
=
1.0
,
const
Color
&
color
=
Color
::
white
());
WPlane
(
const
Vec4d
&
coefs
,
const
Point3d
&
pt
,
double
size
=
1.0
,
const
Color
&
color
=
Color
::
white
());
//! created default plane with center point at origin and normal oriented along z-axis
WPlane
(
const
Size2d
&
size
=
Size2d
(
1.0
,
1.0
),
const
Color
&
color
=
Color
::
white
());
//! repositioned plane
WPlane
(
const
Point3d
&
center
,
const
Vec3d
&
normal
,
const
Vec3d
&
new_plane_yaxis
,
const
Size2d
&
size
=
Size2d
(
1.0
,
1.0
),
const
Color
&
color
=
Color
::
white
());
};
class
CV_EXPORTS
WSphere
:
public
Widget3D
...
...
modules/viz/src/shapes.cpp
浏览文件 @
658f4a7d
...
...
@@ -125,6 +125,36 @@ namespace cv { namespace viz { namespace
};
}}}
cv
::
viz
::
WPlane
::
WPlane
(
const
Size2d
&
size
,
const
Color
&
color
)
{
vtkSmartPointer
<
vtkPlaneSource
>
plane
=
vtkSmartPointer
<
vtkPlaneSource
>::
New
();
plane
->
SetOrigin
(
-
0.5
*
size
.
width
,
-
0.5
*
size
.
height
,
0.0
);
plane
->
SetPoint1
(
0.5
*
size
.
width
,
-
0.5
*
size
.
height
,
0.0
);
plane
->
SetPoint2
(
-
0.5
*
size
.
width
,
0.5
*
size
.
height
,
0.0
);
plane
->
Update
();
vtkSmartPointer
<
vtkPolyDataMapper
>
mapper
=
vtkSmartPointer
<
vtkPolyDataMapper
>::
New
();
VtkUtils
::
SetInputData
(
mapper
,
plane
->
GetOutput
());
vtkSmartPointer
<
vtkActor
>
actor
=
vtkSmartPointer
<
vtkActor
>::
New
();
actor
->
SetMapper
(
mapper
);
actor
->
GetProperty
()
->
LightingOff
();
WidgetAccessor
::
setProp
(
*
this
,
actor
);
setColor
(
color
);
}
cv
::
viz
::
WPlane
::
WPlane
(
const
Point3d
&
center
,
const
Vec3d
&
normal
,
const
Vec3d
&
new_plane_yaxis
,
const
Size2d
&
size
,
const
Color
&
color
)
{
Vec3d
zvec
=
normalize
(
normal
);
Vec3d
xvec
=
normalize
(
new_plane_yaxis
.
cross
(
zvec
));
Vec3d
yvec
=
zvec
.
cross
(
xvec
);
WPlane
plane
(
size
,
color
);
plane
.
applyTransform
(
makeTransformToGlobal
(
xvec
,
yvec
,
zvec
,
center
));
*
this
=
plane
;
}
cv
::
viz
::
WPlane
::
WPlane
(
const
Vec4d
&
coefs
,
double
size
,
const
Color
&
color
)
{
vtkSmartPointer
<
vtkPlaneSource
>
plane
=
vtkSmartPointer
<
vtkPlaneSource
>::
New
();
...
...
modules/viz/test/tests_simple.cpp
浏览文件 @
658f4a7d
...
...
@@ -304,16 +304,18 @@ TEST(Viz, show_simple_widgets)
viz
.
showWidget
(
"con1"
,
WCone
(
0.125
,
Point3d
(
0.5
,
-
0.5
,
0.5
),
Point3d
(
0.5
,
-
1.0
,
0.5
),
6
,
Color
::
turquoise
()));
viz
.
showWidget
(
"text2d"
,
WText
(
"Simple text"
,
Point
(
20
,
20
),
20
,
Color
::
green
()));
viz
.
showWidget
(
"text3d"
,
WText3D
(
"Simple 3D text"
,
Point3d
(
0.5
,
0.5
,
0.5
),
0.125
,
false
,
Color
::
green
()));
viz
.
showWidget
(
"plane1"
,
WPlane
(
Size2d
(
0.25
,
0.75
)));
viz
.
showWidget
(
"plane2"
,
WPlane
(
Vec3d
(
0.5
,
-
0.5
,
-
0.5
),
Vec3d
(
0.0
,
1.0
,
1.0
),
Vec3d
(
1.0
,
1.0
,
0.0
),
Size2d
(
1.0
,
0.5
),
Color
::
gold
()));
viz
.
spinOnce
(
1500
,
true
);
viz
.
getWidget
(
"text2d"
).
cast
<
WText
>
().
setText
(
"New simple text"
);
viz
.
getWidget
(
"text3d"
).
cast
<
WText3D
>
().
setText
(
"Updated text 3D"
);
viz
.
spin
();
}
TEST
(
Viz
,
show_follower
)
TEST
(
Viz
,
DISABLED_
show_follower
)
{
Viz3d
viz
(
"show_follower"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录