Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
2d63f60d
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,发现更多精彩内容 >>
提交
2d63f60d
编写于
11月 30, 2013
作者:
A
Anatoly Baksheev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
minor changes, opencv cross-branch code
上级
15fd3faa
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
19 addition
and
43 deletion
+19
-43
modules/viz/include/opencv2/viz/viz3d.hpp
modules/viz/include/opencv2/viz/viz3d.hpp
+1
-0
modules/viz/include/opencv2/viz/widgets.hpp
modules/viz/include/opencv2/viz/widgets.hpp
+1
-1
modules/viz/src/cloud_widgets.cpp
modules/viz/src/cloud_widgets.cpp
+6
-6
modules/viz/src/interactor_style.cpp
modules/viz/src/interactor_style.cpp
+11
-36
未找到文件。
modules/viz/include/opencv2/viz/viz3d.hpp
浏览文件 @
2d63f60d
...
...
@@ -64,6 +64,7 @@ namespace cv
class
CV_EXPORTS
Viz3d
{
public:
typedef
cv
::
viz
::
Color
Color
;
typedef
void
(
*
KeyboardCallback
)(
const
KeyboardEvent
&
,
void
*
);
typedef
void
(
*
MouseCallback
)(
const
MouseEvent
&
,
void
*
);
...
...
modules/viz/include/opencv2/viz/widgets.hpp
浏览文件 @
2d63f60d
...
...
@@ -219,7 +219,7 @@ namespace cv
class
CV_EXPORTS
WText
:
public
Widget2D
{
public:
WText
(
const
String
&
text
,
const
Point2i
&
pos
,
int
font_size
=
1
0
,
const
Color
&
color
=
Color
::
white
());
WText
(
const
String
&
text
,
const
Point2i
&
pos
,
int
font_size
=
2
0
,
const
Color
&
color
=
Color
::
white
());
void
setText
(
const
String
&
text
);
String
getText
()
const
;
...
...
modules/viz/src/cloud_widgets.cpp
浏览文件 @
2d63f60d
...
...
@@ -124,7 +124,7 @@ struct cv::viz::WCloud::CreateCloudWidget
cells
->
SetNumberOfTuples
(
nr_points
);
vtkIdType
*
cell
=
cells
->
GetPointer
(
0
);
// Fill it with 1s
std
::
fill
_n
(
cell
,
nr_points
*
2
,
1
);
std
::
fill
(
cell
,
cell
+
nr_points
*
2
,
1
);
cell
++
;
for
(
vtkIdType
i
=
0
;
i
<
nr_points
;
++
i
,
cell
+=
2
)
*
cell
=
i
;
...
...
@@ -155,8 +155,8 @@ cv::viz::WCloud::WCloud(InputArray _cloud, InputArray _colors)
if
(
cloud
.
isContinuous
()
&&
colors
.
isContinuous
())
{
cloud
.
reshape
(
cloud
.
channels
(),
1
);
colors
.
reshape
(
colors
.
channels
(),
1
);
cloud
=
cloud
.
reshape
(
cloud
.
channels
(),
1
);
colors
=
colors
.
reshape
(
colors
.
channels
(),
1
);
}
vtkIdType
nr_points
;
...
...
@@ -307,7 +307,7 @@ struct cv::viz::WCloudCollection::CreateCloudWidget
cells
->
SetNumberOfTuples
(
nr_points
);
vtkIdType
*
cell
=
cells
->
GetPointer
(
0
);
// Fill it with 1s
std
::
fill
_n
(
cell
,
nr_points
*
2
,
1
);
std
::
fill
(
cell
,
cell
+
nr_points
*
2
,
1
);
cell
++
;
for
(
vtkIdType
i
=
0
;
i
<
nr_points
;
++
i
,
cell
+=
2
)
*
cell
=
i
;
...
...
@@ -392,8 +392,8 @@ void cv::viz::WCloudCollection::addCloud(InputArray _cloud, InputArray _colors,
if
(
cloud
.
isContinuous
()
&&
colors
.
isContinuous
())
{
cloud
.
reshape
(
cloud
.
channels
(),
1
);
colors
.
reshape
(
colors
.
channels
(),
1
);
cloud
=
cloud
.
reshape
(
cloud
.
channels
(),
1
);
colors
=
colors
.
reshape
(
colors
.
channels
(),
1
);
}
vtkIdType
nr_points
;
...
...
modules/viz/src/interactor_style.cpp
浏览文件 @
2d63f60d
...
...
@@ -236,7 +236,7 @@ cv::viz::InteractorStyle::OnKeyDown()
"
\n
"
" j, J : take a .PNG snapshot of the current window view
\n
"
" c, C : display current camera/window parameters
\n
"
" f, F : fly to point mode
\n
"
" f, F : fly to point mode
, hold the key and move mouse where to fly
\n
"
"
\n
"
" e, E : exit the interactor
\n
"
" q, Q : stop and call VTK's TerminateApp
\n
"
...
...
@@ -271,28 +271,8 @@ cv::viz::InteractorStyle::OnKeyDown()
{
unsigned
int
t
=
static_cast
<
unsigned
int
>
(
time
(
0
));
String
png_file
=
cv
::
format
(
"screenshot-%d.png"
,
t
);
String
cam_file
=
cv
::
format
(
"screenshot-%d.cam"
,
t
);
vtkSmartPointer
<
vtkCamera
>
cam
=
Interactor
->
GetRenderWindow
()
->
GetRenderers
()
->
GetFirstRenderer
()
->
GetActiveCamera
();
Vec2d
clip
;
Vec3d
focal
,
pos
,
view
;
cam
->
GetClippingRange
(
clip
.
val
);
cam
->
GetFocalPoint
(
focal
.
val
);
cam
->
GetPosition
(
pos
.
val
);
cam
->
GetViewUp
(
view
.
val
);
Vec2i
win_pos
(
Interactor
->
GetRenderWindow
()
->
GetPosition
());
Vec2i
win_size
(
Interactor
->
GetRenderWindow
()
->
GetSize
());
double
angle
=
cam
->
GetViewAngle
()
/
180.0
*
CV_PI
;
String
data
=
cv
::
format
(
"%f,%f/%f,%f,%f/%f,%f,%f/%f,%f,%f/%f/%d,%d/%d,%d"
,
clip
[
0
],
clip
[
1
],
focal
[
0
],
focal
[
1
],
focal
[
2
],
pos
[
0
],
pos
[
1
],
pos
[
2
],
view
[
0
],
view
[
1
],
view
[
2
],
angle
,
win_size
[
0
],
win_size
[
1
],
win_pos
[
0
],
win_pos
[
1
]);
saveScreenshot
(
png_file
);
ofstream
ofs_cam
(
cam_file
.
c_str
());
ofs_cam
<<
data
.
c_str
()
<<
endl
;
ofs_cam
.
close
();
cout
<<
"Screenshot ("
<<
png_file
.
c_str
()
<<
") and camera information ("
<<
cam_file
.
c_str
()
<<
") successfully captured."
<<
endl
;
cout
<<
"Screenshot ("
<<
png_file
.
c_str
()
<<
") successfully captured."
<<
endl
;
break
;
}
// display current camera settings/parameters
...
...
@@ -301,26 +281,21 @@ cv::viz::InteractorStyle::OnKeyDown()
vtkSmartPointer
<
vtkCamera
>
cam
=
Interactor
->
GetRenderWindow
()
->
GetRenderers
()
->
GetFirstRenderer
()
->
GetActiveCamera
();
Vec2d
clip
;
Vec3d
focal
,
pos
e
,
view
;
Vec3d
focal
,
pos
,
view
;
cam
->
GetClippingRange
(
clip
.
val
);
cam
->
GetFocalPoint
(
focal
.
val
);
cam
->
GetPosition
(
pos
e
.
val
);
cam
->
GetPosition
(
pos
.
val
);
cam
->
GetViewUp
(
view
.
val
);
Vec2i
win_pos
(
Interactor
->
GetRenderWindow
()
->
GetPosition
());
Vec2i
win_size
(
Interactor
->
GetRenderWindow
()
->
GetSize
());
double
angle
=
cam
->
GetViewAngle
()
/
180.0
*
CV_PI
;
String
data
=
cv
::
format
(
"clip(%f,%f) focal(%f,%f,%f) pos(%f,%f,%f) view(%f,%f,%f) angle(%f) winsz(%d,%d) winpos(%d,%d)"
,
clip
[
0
],
clip
[
1
],
focal
[
0
],
focal
[
1
],
focal
[
2
],
pos
[
0
],
pos
[
1
],
pos
[
2
],
view
[
0
],
view
[
1
],
view
[
2
],
angle
,
win_size
[
0
],
win_size
[
1
],
win_pos
[
0
],
win_pos
[
1
]);
std
::
cout
<<
data
.
c_str
()
<<
std
::
endl
;
cv
::
print
(
Mat
(
clip
,
false
).
reshape
(
1
,
1
));
std
::
cout
<<
"/"
;
cv
::
print
(
Mat
(
focal
,
false
).
reshape
(
1
,
1
));
std
::
cout
<<
"/"
;
cv
::
print
(
Mat
(
pose
,
false
).
reshape
(
1
,
1
));
std
::
cout
<<
"/"
;
cv
::
print
(
Mat
(
view
,
false
).
reshape
(
1
,
1
));
std
::
cout
<<
"/"
<<
cam
->
GetViewAngle
()
/
180.0
*
CV_PI
;
cv
::
print
(
Mat
(
win_size
,
false
).
reshape
(
1
,
1
));
std
::
cout
<<
"/"
;
cv
::
print
(
Mat
(
win_pos
,
false
).
reshape
(
1
,
1
));
std
::
cout
<<
std
::
endl
;
break
;
}
case
'='
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录