Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
b64bb958
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,发现更多精彩内容 >>
提交
b64bb958
编写于
7月 13, 2011
作者:
M
Maria Dimashova
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
added ability to reset view point of depth generator to normal one (#1195)
上级
4d8a261d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
50 addition
and
23 deletion
+50
-23
modules/highgui/include/opencv2/highgui/highgui_c.h
modules/highgui/include/opencv2/highgui/highgui_c.h
+4
-1
modules/highgui/src/cap_openni.cpp
modules/highgui/src/cap_openni.cpp
+46
-22
未找到文件。
modules/highgui/include/opencv2/highgui/highgui_c.h
浏览文件 @
b64bb958
...
...
@@ -360,7 +360,10 @@ enum
CV_CAP_PROP_OPENNI_FRAME_MAX_DEPTH
=
101
,
// in mm
CV_CAP_PROP_OPENNI_BASELINE
=
102
,
// in mm
CV_CAP_PROP_OPENNI_FOCAL_LENGTH
=
103
,
// in pixels
CV_CAP_PROP_OPENNI_REGISTRATION_ON
=
104
,
// flag
CV_CAP_PROP_OPENNI_REGISTRATION_ON
=
104
,
// flag
CV_CAP_PROP_OPENNI_REGISTRATION
=
CV_CAP_PROP_OPENNI_REGISTRATION_ON
,
// flag that synchronizes the remapping depth map to image map
// by changing depth generator's view point (if the flag is "on") or
// sets this view point to its normal one (if the flag is "off").
CV_CAP_OPENNI_IMAGE_GENERATOR_OUTPUT_MODE
=
CV_CAP_OPENNI_IMAGE_GENERATOR
+
CV_CAP_PROP_OPENNI_OUTPUT_MODE
,
CV_CAP_OPENNI_DEPTH_GENERATOR_BASELINE
=
CV_CAP_OPENNI_DEPTH_GENERATOR
+
CV_CAP_PROP_OPENNI_BASELINE
,
CV_CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH
=
CV_CAP_OPENNI_DEPTH_GENERATOR
+
CV_CAP_PROP_OPENNI_FOCAL_LENGTH
,
...
...
modules/highgui/src/cap_openni.cpp
浏览文件 @
b64bb958
...
...
@@ -228,7 +228,7 @@ CvCapture_OpenNI::CvCapture_OpenNI( int index )
// Set map output mode.
CV_Assert
(
depthGenerator
.
SetMapOutputMode
(
depthOutputMode
)
==
XN_STATUS_OK
);
// xn::DepthGenerator supports VGA only! (Jan 2011)
CV_Assert
(
imageGenerator
.
SetMapOutputMode
(
imageOutputMode
)
==
XN_STATUS_OK
);
CV_Assert
(
depthGenerator
.
GetAlternativeViewPointCap
().
SetViewPoint
(
imageGenerator
)
==
XN_STATUS_OK
);
CV_Assert
(
setProperty
(
CV_CAP_PROP_OPENNI_REGISTRATION
,
1.0
)
);
// Start generating data.
status
=
context
.
StartGeneratingAll
();
...
...
@@ -360,30 +360,48 @@ double CvCapture_OpenNI::getDepthGeneratorProperty( int propIdx )
bool
CvCapture_OpenNI
::
setDepthGeneratorProperty
(
int
propIdx
,
double
propValue
)
{
bool
res
=
false
;
CV_Assert
(
depthGenerator
.
IsValid
()
);
switch
(
propIdx
)
switch
(
propIdx
)
{
case
CV_CAP_PROP_OPENNI_REGISTRATION
_ON
:
case
CV_CAP_PROP_OPENNI_REGISTRATION
:
{
CV_Assert
(
imageGenerator
.
IsValid
()
);
if
(
!
depthGenerator
.
GetAlternativeViewPointCap
().
IsViewPointAs
(
imageGenerator
))
if
(
propValue
!=
0.0
)
// "on"
{
if
(
depthGenerator
.
GetAlternativeViewPointCap
().
IsViewPointSupported
(
imageGenerator
))
CV_Assert
(
imageGenerator
.
IsValid
()
);
if
(
!
depthGenerator
.
GetAlternativeViewPointCap
().
IsViewPointAs
(
imageGenerator
)
)
{
XnStatus
status
=
depthGenerator
.
GetAlternativeViewPointCap
().
SetViewPoint
(
imageGenerator
);
if
(
status
!=
XN_STATUS_OK
)
CV_Error
(
CV_StsError
,
std
::
string
(
"turning registration on failed. Reason: "
)
+
xnGetStatusString
(
status
));
if
(
depthGenerator
.
GetAlternativeViewPointCap
().
IsViewPointSupported
(
imageGenerator
)
)
{
XnStatus
status
=
depthGenerator
.
GetAlternativeViewPointCap
().
SetViewPoint
(
imageGenerator
);
if
(
status
!=
XN_STATUS_OK
)
std
::
cerr
<<
"CvCapture_OpenNI::setDepthGeneratorProperty : "
<<
xnGetStatusString
(
status
)
<<
std
::
endl
;
else
res
=
true
;
}
else
std
::
cerr
<<
"CvCapture_OpenNI::setDepthGeneratorProperty : Unsupported viewpoint."
<<
std
::
endl
;
}
else
CV_Error
(
CV_StsError
,
"turning registration on failed. Reason: unsupported viewpoint"
);
res
=
true
;
}
else
// "off"
{
XnStatus
status
=
depthGenerator
.
GetAlternativeViewPointCap
().
ResetViewPoint
();
if
(
status
!=
XN_STATUS_OK
)
std
::
cerr
<<
"CvCapture_OpenNI::setDepthGeneratorProperty : "
<<
xnGetStatusString
(
status
)
<<
std
::
endl
;
else
res
=
true
;
}
}
return
true
;
break
;
default:
CV_Error
(
CV_StsBadArg
,
"
Depth generator does not support such parameter for setting
.
\n
"
);
CV_Error
(
CV_StsBadArg
,
"
Unsupported depth generator property
.
\n
"
);
}
return
false
;
return
res
;
}
double
CvCapture_OpenNI
::
getImageGeneratorProperty
(
int
propIdx
)
...
...
@@ -414,10 +432,13 @@ bool CvCapture_OpenNI::setImageGeneratorProperty( int propIdx, double propValue
bool
res
=
false
;
CV_Assert
(
imageGenerator
.
IsValid
()
);
XnMapOutputMode
newImageOutputMode
=
imageOutputMode
;
switch
(
propIdx
)
{
case
CV_CAP_PROP_OPENNI_OUTPUT_MODE
:
{
XnMapOutputMode
newImageOutputMode
=
imageOutputMode
;
switch
(
cvRound
(
propValue
)
)
{
case
CV_CAP_OPENNI_VGA_30HZ
:
...
...
@@ -433,16 +454,19 @@ bool CvCapture_OpenNI::setImageGeneratorProperty( int propIdx, double propValue
default
:
CV_Error
(
CV_StsBadArg
,
"Unsupported image generator output mode.
\n
"
);
}
break
;
default:
CV_Error
(
CV_StsBadArg
,
"Image generator does not support such parameter for setting.
\n
"
);
XnStatus
status
=
imageGenerator
.
SetMapOutputMode
(
newImageOutputMode
);
if
(
status
!=
XN_STATUS_OK
)
std
::
cerr
<<
"CvCapture_OpenNI::setImageGeneratorProperty : "
<<
xnGetStatusString
(
status
)
<<
std
::
endl
;
else
{
imageOutputMode
=
newImageOutputMode
;
res
=
true
;
}
break
;
}
if
(
imageGenerator
.
SetMapOutputMode
(
newImageOutputMode
)
==
XN_STATUS_OK
)
{
imageOutputMode
=
newImageOutputMode
;
res
=
true
;
default:
CV_Error
(
CV_StsBadArg
,
"Unsupported image generator property.
\n
"
);
}
return
res
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录