Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
3e574cd2
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,发现更多精彩内容 >>
提交
3e574cd2
编写于
9月 01, 2014
作者:
V
Vadim Pisarevsky
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3173 from rokm:cuda-6.5
上级
1f85ffa1
eb3cb772
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
44 addition
and
44 deletion
+44
-44
modules/cudalegacy/src/cuda/NCVPixelOperations.hpp
modules/cudalegacy/src/cuda/NCVPixelOperations.hpp
+41
-41
modules/cudastereo/src/cuda/stereocsbp.cu
modules/cudastereo/src/cuda/stereocsbp.cu
+3
-3
未找到文件。
modules/cudalegacy/src/cuda/NCVPixelOperations.hpp
浏览文件 @
3e574cd2
...
...
@@ -48,24 +48,24 @@
#include "opencv2/cudalegacy/NCV.hpp"
template
<
typename
TBase
>
inline
__host__
__device__
TBase
_pixMaxVal
();
template
<
>
static
inline
__host__
__device__
Ncv8u
_pixMaxVal
<
Ncv8u
>
()
{
return
UCHAR_MAX
;}
template
<
>
static
inline
__host__
__device__
Ncv16u
_pixMaxVal
<
Ncv16u
>
()
{
return
USHRT_MAX
;}
template
<
>
static
inline
__host__
__device__
Ncv32u
_pixMaxVal
<
Ncv32u
>
()
{
return
UINT_MAX
;}
template
<
>
static
inline
__host__
__device__
Ncv8s
_pixMaxVal
<
Ncv8s
>
()
{
return
SCHAR_MAX
;}
template
<
>
static
inline
__host__
__device__
Ncv16s
_pixMaxVal
<
Ncv16s
>
()
{
return
SHRT_MAX
;}
template
<
>
static
inline
__host__
__device__
Ncv32s
_pixMaxVal
<
Ncv32s
>
()
{
return
INT_MAX
;}
template
<
>
static
inline
__host__
__device__
Ncv32f
_pixMaxVal
<
Ncv32f
>
()
{
return
FLT_MAX
;}
template
<
>
static
inline
__host__
__device__
Ncv64f
_pixMaxVal
<
Ncv64f
>
()
{
return
DBL_MAX
;}
template
<
>
inline
__host__
__device__
Ncv8u
_pixMaxVal
<
Ncv8u
>
()
{
return
UCHAR_MAX
;}
template
<
>
inline
__host__
__device__
Ncv16u
_pixMaxVal
<
Ncv16u
>
()
{
return
USHRT_MAX
;}
template
<
>
inline
__host__
__device__
Ncv32u
_pixMaxVal
<
Ncv32u
>
()
{
return
UINT_MAX
;}
template
<
>
inline
__host__
__device__
Ncv8s
_pixMaxVal
<
Ncv8s
>
()
{
return
SCHAR_MAX
;}
template
<
>
inline
__host__
__device__
Ncv16s
_pixMaxVal
<
Ncv16s
>
()
{
return
SHRT_MAX
;}
template
<
>
inline
__host__
__device__
Ncv32s
_pixMaxVal
<
Ncv32s
>
()
{
return
INT_MAX
;}
template
<
>
inline
__host__
__device__
Ncv32f
_pixMaxVal
<
Ncv32f
>
()
{
return
FLT_MAX
;}
template
<
>
inline
__host__
__device__
Ncv64f
_pixMaxVal
<
Ncv64f
>
()
{
return
DBL_MAX
;}
template
<
typename
TBase
>
inline
__host__
__device__
TBase
_pixMinVal
();
template
<
>
static
inline
__host__
__device__
Ncv8u
_pixMinVal
<
Ncv8u
>
()
{
return
0
;}
template
<
>
static
inline
__host__
__device__
Ncv16u
_pixMinVal
<
Ncv16u
>
()
{
return
0
;}
template
<
>
static
inline
__host__
__device__
Ncv32u
_pixMinVal
<
Ncv32u
>
()
{
return
0
;}
template
<
>
static
inline
__host__
__device__
Ncv8s
_pixMinVal
<
Ncv8s
>
()
{
return
SCHAR_MIN
;}
template
<
>
static
inline
__host__
__device__
Ncv16s
_pixMinVal
<
Ncv16s
>
()
{
return
SHRT_MIN
;}
template
<
>
static
inline
__host__
__device__
Ncv32s
_pixMinVal
<
Ncv32s
>
()
{
return
INT_MIN
;}
template
<
>
static
inline
__host__
__device__
Ncv32f
_pixMinVal
<
Ncv32f
>
()
{
return
FLT_MIN
;}
template
<
>
static
inline
__host__
__device__
Ncv64f
_pixMinVal
<
Ncv64f
>
()
{
return
DBL_MIN
;}
template
<
>
inline
__host__
__device__
Ncv8u
_pixMinVal
<
Ncv8u
>
()
{
return
0
;}
template
<
>
inline
__host__
__device__
Ncv16u
_pixMinVal
<
Ncv16u
>
()
{
return
0
;}
template
<
>
inline
__host__
__device__
Ncv32u
_pixMinVal
<
Ncv32u
>
()
{
return
0
;}
template
<
>
inline
__host__
__device__
Ncv8s
_pixMinVal
<
Ncv8s
>
()
{
return
SCHAR_MIN
;}
template
<
>
inline
__host__
__device__
Ncv16s
_pixMinVal
<
Ncv16s
>
()
{
return
SHRT_MIN
;}
template
<
>
inline
__host__
__device__
Ncv32s
_pixMinVal
<
Ncv32s
>
()
{
return
INT_MIN
;}
template
<
>
inline
__host__
__device__
Ncv32f
_pixMinVal
<
Ncv32f
>
()
{
return
FLT_MIN
;}
template
<
>
inline
__host__
__device__
Ncv64f
_pixMinVal
<
Ncv64f
>
()
{
return
DBL_MIN
;}
template
<
typename
Tvec
>
struct
TConvVec2Base
;
template
<
>
struct
TConvVec2Base
<
uchar1
>
{
typedef
Ncv8u
TBase
;};
...
...
@@ -104,33 +104,33 @@ template<> struct TConvBase2Vec<Ncv64f, 3> {typedef double3 TVec;};
template
<
>
struct
TConvBase2Vec
<
Ncv64f
,
4
>
{
typedef
double4
TVec
;};
//TODO: consider using CUDA intrinsics to avoid branching
template
<
typename
Tin
>
static
inline
__host__
__device__
void
_TDemoteClampZ
(
Tin
&
a
,
Ncv8u
&
out
)
{
out
=
(
Ncv8u
)
CLAMP_0_255
(
a
);}
template
<
typename
Tin
>
static
inline
__host__
__device__
void
_TDemoteClampZ
(
Tin
&
a
,
Ncv16u
&
out
)
{
out
=
(
Ncv16u
)
CLAMP
(
a
,
0
,
USHRT_MAX
);}
template
<
typename
Tin
>
static
inline
__host__
__device__
void
_TDemoteClampZ
(
Tin
&
a
,
Ncv32u
&
out
)
{
out
=
(
Ncv32u
)
CLAMP
(
a
,
0
,
UINT_MAX
);}
template
<
typename
Tin
>
static
inline
__host__
__device__
void
_TDemoteClampZ
(
Tin
&
a
,
Ncv32f
&
out
)
{
out
=
(
Ncv32f
)
a
;}
template
<
typename
Tin
>
inline
__host__
__device__
void
_TDemoteClampZ
(
Tin
&
a
,
Ncv8u
&
out
)
{
out
=
(
Ncv8u
)
CLAMP_0_255
(
a
);}
template
<
typename
Tin
>
inline
__host__
__device__
void
_TDemoteClampZ
(
Tin
&
a
,
Ncv16u
&
out
)
{
out
=
(
Ncv16u
)
CLAMP
(
a
,
0
,
USHRT_MAX
);}
template
<
typename
Tin
>
inline
__host__
__device__
void
_TDemoteClampZ
(
Tin
&
a
,
Ncv32u
&
out
)
{
out
=
(
Ncv32u
)
CLAMP
(
a
,
0
,
UINT_MAX
);}
template
<
typename
Tin
>
inline
__host__
__device__
void
_TDemoteClampZ
(
Tin
&
a
,
Ncv32f
&
out
)
{
out
=
(
Ncv32f
)
a
;}
//TODO: consider using CUDA intrinsics to avoid branching
template
<
typename
Tin
>
static
inline
__host__
__device__
void
_TDemoteClampNN
(
Tin
&
a
,
Ncv8u
&
out
)
{
out
=
(
Ncv8u
)
CLAMP_0_255
(
a
+
0.5
f
);}
template
<
typename
Tin
>
static
inline
__host__
__device__
void
_TDemoteClampNN
(
Tin
&
a
,
Ncv16u
&
out
)
{
out
=
(
Ncv16u
)
CLAMP
(
a
+
0.5
f
,
0
,
USHRT_MAX
);}
template
<
typename
Tin
>
static
inline
__host__
__device__
void
_TDemoteClampNN
(
Tin
&
a
,
Ncv32u
&
out
)
{
out
=
(
Ncv32u
)
CLAMP
(
a
+
0.5
f
,
0
,
UINT_MAX
);}
template
<
typename
Tin
>
static
inline
__host__
__device__
void
_TDemoteClampNN
(
Tin
&
a
,
Ncv32f
&
out
)
{
out
=
(
Ncv32f
)
a
;}
template
<
typename
Tin
>
inline
__host__
__device__
void
_TDemoteClampNN
(
Tin
&
a
,
Ncv8u
&
out
)
{
out
=
(
Ncv8u
)
CLAMP_0_255
(
a
+
0.5
f
);}
template
<
typename
Tin
>
inline
__host__
__device__
void
_TDemoteClampNN
(
Tin
&
a
,
Ncv16u
&
out
)
{
out
=
(
Ncv16u
)
CLAMP
(
a
+
0.5
f
,
0
,
USHRT_MAX
);}
template
<
typename
Tin
>
inline
__host__
__device__
void
_TDemoteClampNN
(
Tin
&
a
,
Ncv32u
&
out
)
{
out
=
(
Ncv32u
)
CLAMP
(
a
+
0.5
f
,
0
,
UINT_MAX
);}
template
<
typename
Tin
>
inline
__host__
__device__
void
_TDemoteClampNN
(
Tin
&
a
,
Ncv32f
&
out
)
{
out
=
(
Ncv32f
)
a
;}
template
<
typename
Tout
>
inline
Tout
_pixMakeZero
();
template
<
>
static
inline
__host__
__device__
uchar1
_pixMakeZero
<
uchar1
>
()
{
return
make_uchar1
(
0
);}
template
<
>
static
inline
__host__
__device__
uchar3
_pixMakeZero
<
uchar3
>
()
{
return
make_uchar3
(
0
,
0
,
0
);}
template
<
>
static
inline
__host__
__device__
uchar4
_pixMakeZero
<
uchar4
>
()
{
return
make_uchar4
(
0
,
0
,
0
,
0
);}
template
<
>
static
inline
__host__
__device__
ushort1
_pixMakeZero
<
ushort1
>
()
{
return
make_ushort1
(
0
);}
template
<
>
static
inline
__host__
__device__
ushort3
_pixMakeZero
<
ushort3
>
()
{
return
make_ushort3
(
0
,
0
,
0
);}
template
<
>
static
inline
__host__
__device__
ushort4
_pixMakeZero
<
ushort4
>
()
{
return
make_ushort4
(
0
,
0
,
0
,
0
);}
template
<
>
static
inline
__host__
__device__
uint1
_pixMakeZero
<
uint1
>
()
{
return
make_uint1
(
0
);}
template
<
>
static
inline
__host__
__device__
uint3
_pixMakeZero
<
uint3
>
()
{
return
make_uint3
(
0
,
0
,
0
);}
template
<
>
static
inline
__host__
__device__
uint4
_pixMakeZero
<
uint4
>
()
{
return
make_uint4
(
0
,
0
,
0
,
0
);}
template
<
>
static
inline
__host__
__device__
float1
_pixMakeZero
<
float1
>
()
{
return
make_float1
(
0.
f
);}
template
<
>
static
inline
__host__
__device__
float3
_pixMakeZero
<
float3
>
()
{
return
make_float3
(
0.
f
,
0.
f
,
0.
f
);}
template
<
>
static
inline
__host__
__device__
float4
_pixMakeZero
<
float4
>
()
{
return
make_float4
(
0.
f
,
0.
f
,
0.
f
,
0.
f
);}
template
<
>
static
inline
__host__
__device__
double1
_pixMakeZero
<
double1
>
()
{
return
make_double1
(
0.
);}
template
<
>
static
inline
__host__
__device__
double3
_pixMakeZero
<
double3
>
()
{
return
make_double3
(
0.
,
0.
,
0.
);}
template
<
>
static
inline
__host__
__device__
double4
_pixMakeZero
<
double4
>
()
{
return
make_double4
(
0.
,
0.
,
0.
,
0.
);}
template
<
>
inline
__host__
__device__
uchar1
_pixMakeZero
<
uchar1
>
()
{
return
make_uchar1
(
0
);}
template
<
>
inline
__host__
__device__
uchar3
_pixMakeZero
<
uchar3
>
()
{
return
make_uchar3
(
0
,
0
,
0
);}
template
<
>
inline
__host__
__device__
uchar4
_pixMakeZero
<
uchar4
>
()
{
return
make_uchar4
(
0
,
0
,
0
,
0
);}
template
<
>
inline
__host__
__device__
ushort1
_pixMakeZero
<
ushort1
>
()
{
return
make_ushort1
(
0
);}
template
<
>
inline
__host__
__device__
ushort3
_pixMakeZero
<
ushort3
>
()
{
return
make_ushort3
(
0
,
0
,
0
);}
template
<
>
inline
__host__
__device__
ushort4
_pixMakeZero
<
ushort4
>
()
{
return
make_ushort4
(
0
,
0
,
0
,
0
);}
template
<
>
inline
__host__
__device__
uint1
_pixMakeZero
<
uint1
>
()
{
return
make_uint1
(
0
);}
template
<
>
inline
__host__
__device__
uint3
_pixMakeZero
<
uint3
>
()
{
return
make_uint3
(
0
,
0
,
0
);}
template
<
>
inline
__host__
__device__
uint4
_pixMakeZero
<
uint4
>
()
{
return
make_uint4
(
0
,
0
,
0
,
0
);}
template
<
>
inline
__host__
__device__
float1
_pixMakeZero
<
float1
>
()
{
return
make_float1
(
0.
f
);}
template
<
>
inline
__host__
__device__
float3
_pixMakeZero
<
float3
>
()
{
return
make_float3
(
0.
f
,
0.
f
,
0.
f
);}
template
<
>
inline
__host__
__device__
float4
_pixMakeZero
<
float4
>
()
{
return
make_float4
(
0.
f
,
0.
f
,
0.
f
,
0.
f
);}
template
<
>
inline
__host__
__device__
double1
_pixMakeZero
<
double1
>
()
{
return
make_double1
(
0.
);}
template
<
>
inline
__host__
__device__
double3
_pixMakeZero
<
double3
>
()
{
return
make_double3
(
0.
,
0.
,
0.
);}
template
<
>
inline
__host__
__device__
double4
_pixMakeZero
<
double4
>
()
{
return
make_double4
(
0.
,
0.
,
0.
,
0.
);}
static
inline
__host__
__device__
uchar1
_pixMake
(
Ncv8u
x
)
{
return
make_uchar1
(
x
);}
static
inline
__host__
__device__
uchar3
_pixMake
(
Ncv8u
x
,
Ncv8u
y
,
Ncv8u
z
)
{
return
make_uchar3
(
x
,
y
,
z
);}
...
...
@@ -180,7 +180,7 @@ static __host__ __device__ Tout _pixDemoteClampZ_CN(Tin &pix)
return
out
;
}};
template
<
typename
Tin
,
typename
Tout
>
static
inline
__host__
__device__
Tout
_pixDemoteClampZ
(
Tin
&
pix
)
template
<
typename
Tin
,
typename
Tout
>
inline
__host__
__device__
Tout
_pixDemoteClampZ
(
Tin
&
pix
)
{
return
__pixDemoteClampZ_CN
<
Tin
,
Tout
,
NC
(
Tin
)
>::
_pixDemoteClampZ_CN
(
pix
);
}
...
...
@@ -217,7 +217,7 @@ static __host__ __device__ Tout _pixDemoteClampNN_CN(Tin &pix)
return
out
;
}};
template
<
typename
Tin
,
typename
Tout
>
static
inline
__host__
__device__
Tout
_pixDemoteClampNN
(
Tin
&
pix
)
template
<
typename
Tin
,
typename
Tout
>
inline
__host__
__device__
Tout
_pixDemoteClampNN
(
Tin
&
pix
)
{
return
__pixDemoteClampNN_CN
<
Tin
,
Tout
,
NC
(
Tin
)
>::
_pixDemoteClampNN_CN
(
pix
);
}
...
...
modules/cudastereo/src/cuda/stereocsbp.cu
浏览文件 @
3e574cd2
...
...
@@ -59,11 +59,11 @@ namespace cv { namespace cuda { namespace device
///////////////////////////////////////////////////////////////
template
<
int
channels
>
static
float
__device__
pixeldiff
(
const
uchar
*
left
,
const
uchar
*
right
,
float
max_data_term
);
template
<
>
__device__
__forceinline__
static
float
pixeldiff
<
1
>
(
const
uchar
*
left
,
const
uchar
*
right
,
float
max_data_term
)
template
<
>
__device__
__forceinline__
float
pixeldiff
<
1
>
(
const
uchar
*
left
,
const
uchar
*
right
,
float
max_data_term
)
{
return
fminf
(
::
abs
((
int
)
*
left
-
*
right
),
max_data_term
);
}
template
<
>
__device__
__forceinline__
static
float
pixeldiff
<
3
>
(
const
uchar
*
left
,
const
uchar
*
right
,
float
max_data_term
)
template
<
>
__device__
__forceinline__
float
pixeldiff
<
3
>
(
const
uchar
*
left
,
const
uchar
*
right
,
float
max_data_term
)
{
float
tb
=
0.114
f
*
::
abs
((
int
)
left
[
0
]
-
right
[
0
]);
float
tg
=
0.587
f
*
::
abs
((
int
)
left
[
1
]
-
right
[
1
]);
...
...
@@ -71,7 +71,7 @@ namespace cv { namespace cuda { namespace device
return
fminf
(
tr
+
tg
+
tb
,
max_data_term
);
}
template
<
>
__device__
__forceinline__
static
float
pixeldiff
<
4
>
(
const
uchar
*
left
,
const
uchar
*
right
,
float
max_data_term
)
template
<
>
__device__
__forceinline__
float
pixeldiff
<
4
>
(
const
uchar
*
left
,
const
uchar
*
right
,
float
max_data_term
)
{
uchar4
l
=
*
((
const
uchar4
*
)
left
);
uchar4
r
=
*
((
const
uchar4
*
)
right
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录