Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
a380c473
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,发现更多精彩内容 >>
提交
a380c473
编写于
5月 08, 2013
作者:
V
Vladislav Vinogradov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
switched to Input/Output Array in reprojectImageTo3D & drawColorDisp
上级
3a02e599
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
25 addition
and
20 deletion
+25
-20
modules/gpustereo/include/opencv2/gpustereo.hpp
modules/gpustereo/include/opencv2/gpustereo.hpp
+4
-5
modules/gpustereo/src/util.cpp
modules/gpustereo/src/util.cpp
+21
-15
未找到文件。
modules/gpustereo/include/opencv2/gpustereo.hpp
浏览文件 @
a380c473
...
...
@@ -172,21 +172,20 @@ public:
CV_EXPORTS
Ptr
<
gpu
::
DisparityBilateralFilter
>
createDisparityBilateralFilter
(
int
ndisp
=
64
,
int
radius
=
3
,
int
iters
=
1
);
/////////////////////////////////////////
// Utility
//! Reprojects disparity image to 3D space.
//! Supports CV_8U and CV_16S types of input disparity.
//! The output is a 3- or 4-channel floating-point matrix.
//! Each element of this matrix will contain the 3D coordinates of the point (x,y,z,1), computed from the disparity map.
//! Q is the 4x4 perspective transformation matrix that can be obtained with cvStereoRectify.
CV_EXPORTS
void
reprojectImageTo3D
(
const
GpuMat
&
disp
,
GpuMat
&
xyzw
,
const
Mat
&
Q
,
int
dst_cn
=
4
,
Stream
&
stream
=
Stream
::
Null
());
CV_EXPORTS
void
reprojectImageTo3D
(
InputArray
disp
,
OutputArray
xyzw
,
InputArray
Q
,
int
dst_cn
=
4
,
Stream
&
stream
=
Stream
::
Null
());
//! Does coloring of disparity image: [0..ndisp) -> [0..240, 1, 1] in HSV.
//! Supported types of input disparity: CV_8U, CV_16S.
//! Output disparity has CV_8UC4 type in BGRA format (alpha = 255).
CV_EXPORTS
void
drawColorDisp
(
const
GpuMat
&
src_disp
,
GpuMat
&
dst_disp
,
int
ndisp
,
Stream
&
stream
=
Stream
::
Null
());
CV_EXPORTS
void
drawColorDisp
(
InputArray
src_disp
,
OutputArray
dst_disp
,
int
ndisp
,
Stream
&
stream
=
Stream
::
Null
());
}}
// namespace cv { namespace gpu {
...
...
modules/gpustereo/src/util.cpp
浏览文件 @
a380c473
...
...
@@ -47,8 +47,8 @@ using namespace cv::gpu;
#if !defined HAVE_CUDA || defined(CUDA_DISABLER)
void
cv
::
gpu
::
reprojectImageTo3D
(
const
GpuMat
&
,
GpuMat
&
,
const
Mat
&
,
int
,
Stream
&
)
{
throw_no_cuda
();
}
void
cv
::
gpu
::
drawColorDisp
(
const
GpuMat
&
,
GpuMat
&
,
int
,
Stream
&
)
{
throw_no_cuda
();
}
void
cv
::
gpu
::
reprojectImageTo3D
(
InputArray
,
OutputArray
,
InputArray
,
int
,
Stream
&
)
{
throw_no_cuda
();
}
void
cv
::
gpu
::
drawColorDisp
(
InputArray
,
OutputArray
,
int
,
Stream
&
)
{
throw_no_cuda
();
}
#else
...
...
@@ -61,7 +61,7 @@ namespace cv { namespace gpu { namespace cudev
void
reprojectImageTo3D_gpu
(
const
PtrStepSzb
disp
,
PtrStepSzb
xyz
,
const
float
*
q
,
cudaStream_t
stream
);
}}}
void
cv
::
gpu
::
reprojectImageTo3D
(
const
GpuMat
&
disp
,
GpuMat
&
xyz
,
const
Mat
&
Q
,
int
dst_cn
,
Stream
&
stream
)
void
cv
::
gpu
::
reprojectImageTo3D
(
InputArray
_disp
,
OutputArray
_xyz
,
InputArray
_
Q
,
int
dst_cn
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
cudev
;
...
...
@@ -72,11 +72,15 @@ void cv::gpu::reprojectImageTo3D(const GpuMat& disp, GpuMat& xyz, const Mat& Q,
{
reprojectImageTo3D_gpu
<
uchar
,
float4
>
,
0
,
0
,
reprojectImageTo3D_gpu
<
short
,
float4
>
}
};
CV_Assert
(
disp
.
type
()
==
CV_8U
||
disp
.
type
()
==
CV_16S
);
CV_Assert
(
Q
.
type
()
==
CV_32F
&&
Q
.
rows
==
4
&&
Q
.
cols
==
4
&&
Q
.
isContinuous
());
CV_Assert
(
dst_cn
==
3
||
dst_cn
==
4
);
GpuMat
disp
=
_disp
.
getGpuMat
();
Mat
Q
=
_Q
.
getMat
();
xyz
.
create
(
disp
.
size
(),
CV_MAKE_TYPE
(
CV_32F
,
dst_cn
));
CV_Assert
(
disp
.
type
()
==
CV_8U
||
disp
.
type
()
==
CV_16S
);
CV_Assert
(
Q
.
type
()
==
CV_32F
&&
Q
.
rows
==
4
&&
Q
.
cols
==
4
&&
Q
.
isContinuous
()
);
CV_Assert
(
dst_cn
==
3
||
dst_cn
==
4
);
_xyz
.
create
(
disp
.
size
(),
CV_MAKE_TYPE
(
CV_32F
,
dst_cn
));
GpuMat
xyz
=
_xyz
.
getGpuMat
();
funcs
[
dst_cn
==
4
][
disp
.
type
()](
disp
,
xyz
,
Q
.
ptr
<
float
>
(),
StreamAccessor
::
getStream
(
stream
));
}
...
...
@@ -93,23 +97,25 @@ namespace cv { namespace gpu { namespace cudev
namespace
{
template
<
typename
T
>
void
drawColorDisp_caller
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
ndisp
,
const
cudaStream_t
&
stream
)
void
drawColorDisp_caller
(
const
GpuMat
&
src
,
OutputArray
_
dst
,
int
ndisp
,
const
cudaStream_t
&
stream
)
{
using
namespace
::
cv
::
gpu
::
cudev
;
dst
.
create
(
src
.
size
(),
CV_8UC4
);
_dst
.
create
(
src
.
size
(),
CV_8UC4
);
GpuMat
dst
=
_dst
.
getGpuMat
();
drawColorDisp_gpu
((
PtrStepSz
<
T
>
)
src
,
dst
,
ndisp
,
stream
);
}
typedef
void
(
*
drawColorDisp_caller_t
)(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
ndisp
,
const
cudaStream_t
&
stream
);
const
drawColorDisp_caller_t
drawColorDisp_callers
[]
=
{
drawColorDisp_caller
<
unsigned
char
>
,
0
,
0
,
drawColorDisp_caller
<
short
>
,
0
,
0
,
0
,
0
};
}
void
cv
::
gpu
::
drawColorDisp
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
ndisp
,
Stream
&
stream
)
void
cv
::
gpu
::
drawColorDisp
(
InputArray
_src
,
OutputArray
dst
,
int
ndisp
,
Stream
&
stream
)
{
CV_Assert
(
src
.
type
()
==
CV_8U
||
src
.
type
()
==
CV_16S
);
typedef
void
(
*
drawColorDisp_caller_t
)(
const
GpuMat
&
src
,
OutputArray
dst
,
int
ndisp
,
const
cudaStream_t
&
stream
);
const
drawColorDisp_caller_t
drawColorDisp_callers
[]
=
{
drawColorDisp_caller
<
unsigned
char
>
,
0
,
0
,
drawColorDisp_caller
<
short
>
,
0
,
0
,
0
,
0
};
GpuMat
src
=
_src
.
getGpuMat
();
CV_Assert
(
src
.
type
()
==
CV_8U
||
src
.
type
()
==
CV_16S
);
drawColorDisp_callers
[
src
.
type
()](
src
,
dst
,
ndisp
,
StreamAccessor
::
getStream
(
stream
));
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录