Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
e62bf3a2
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,发现更多精彩内容 >>
提交
e62bf3a2
编写于
12月 20, 2010
作者:
A
Alexey Spizhevoy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
updated gpu bitwise operations
上级
0f30fe08
变更
2
展开全部
隐藏空白更改
内联
并排
Showing
2 changed file
with
183 addition
and
208 deletion
+183
-208
modules/gpu/src/arithm.cpp
modules/gpu/src/arithm.cpp
+95
-25
modules/gpu/src/cuda/mathfunc.cu
modules/gpu/src/cuda/mathfunc.cu
+88
-183
未找到文件。
modules/gpu/src/arithm.cpp
浏览文件 @
e62bf3a2
...
...
@@ -1002,18 +1002,25 @@ void cv::gpu::polarToCart(const GpuMat& magnitude, const GpuMat& angle, GpuMat&
namespace
cv
{
namespace
gpu
{
namespace
mathfunc
{
void
bitwise_not_caller
(
int
rows
,
int
cols
,
const
PtrStep
src
,
int
elemSize
,
PtrStep
dst
,
cudaStream_t
stream
);
void
bitwise_not_caller
(
int
rows
,
int
cols
,
const
PtrStep
src
,
int
elemSize
,
PtrStep
dst
,
const
PtrStep
mask
,
cudaStream_t
stream
);
void
bitwise_or_caller
(
int
rows
,
int
cols
,
const
PtrStep
src1
,
const
PtrStep
src2
,
int
elemSize
,
PtrStep
dst
,
cudaStream_t
stream
);
void
bitwise_or_caller
(
int
rows
,
int
cols
,
const
PtrStep
src1
,
const
PtrStep
src2
,
int
elemSize
,
PtrStep
dst
,
const
PtrStep
mask
,
cudaStream_t
stream
);
void
bitwise_and_caller
(
int
rows
,
int
cols
,
const
PtrStep
src1
,
const
PtrStep
src2
,
int
elemSize
,
PtrStep
dst
,
cudaStream_t
stream
);
void
bitwise_and_caller
(
int
rows
,
int
cols
,
const
PtrStep
src1
,
const
PtrStep
src2
,
int
elemSize
,
PtrStep
dst
,
const
PtrStep
mask
,
cudaStream_t
stream
);
void
bitwise_xor_caller
(
int
rows
,
int
cols
,
const
PtrStep
src1
,
const
PtrStep
src2
,
int
elemSize
,
PtrStep
dst
,
cudaStream_t
stream
);
void
bitwise_xor_caller
(
int
rows
,
int
cols
,
const
PtrStep
src1
,
const
PtrStep
src2
,
int
elemSize
,
PtrStep
dst
,
const
PtrStep
mask
,
cudaStream_t
stream
);
template
<
int
opid
,
typename
Mask
>
void
bitwise_bin_op
(
int
rows
,
int
cols
,
const
PtrStep
src1
,
const
PtrStep
src2
,
PtrStep
dst
,
int
elem_size
,
Mask
mask
,
cudaStream_t
stream
);
void
bitwise_not_caller
(
int
rows
,
int
cols
,
int
elem_size1
,
int
cn
,
const
PtrStep
src
,
PtrStep
dst
,
cudaStream_t
stream
);
template
<
typename
T
>
void
bitwise_mask_not_caller
(
int
rows
,
int
cols
,
int
cn
,
const
PtrStep
src
,
const
PtrStep
mask
,
PtrStep
dst
,
cudaStream_t
stream
);
void
bitwise_or_caller
(
int
rows
,
int
cols
,
int
elem_size1
,
int
cn
,
const
PtrStep
src1
,
const
PtrStep
src2
,
PtrStep
dst
,
cudaStream_t
stream
);
template
<
typename
T
>
void
bitwise_mask_or_caller
(
int
rows
,
int
cols
,
int
cn
,
const
PtrStep
src1
,
const
PtrStep
src2
,
const
PtrStep
mask
,
PtrStep
dst
,
cudaStream_t
stream
);
void
bitwise_and_caller
(
int
rows
,
int
cols
,
int
elem_size1
,
int
cn
,
const
PtrStep
src1
,
const
PtrStep
src2
,
PtrStep
dst
,
cudaStream_t
stream
);
template
<
typename
T
>
void
bitwise_mask_and_caller
(
int
rows
,
int
cols
,
int
cn
,
const
PtrStep
src1
,
const
PtrStep
src2
,
const
PtrStep
mask
,
PtrStep
dst
,
cudaStream_t
stream
);
void
bitwise_xor_caller
(
int
rows
,
int
cols
,
int
elem_size1
,
int
cn
,
const
PtrStep
src1
,
const
PtrStep
src2
,
PtrStep
dst
,
cudaStream_t
stream
);
template
<
typename
T
>
void
bitwise_mask_xor_caller
(
int
rows
,
int
cols
,
int
cn
,
const
PtrStep
src1
,
const
PtrStep
src2
,
const
PtrStep
mask
,
PtrStep
dst
,
cudaStream_t
stream
);
}}}
namespace
...
...
@@ -1021,60 +1028,123 @@ namespace
void
bitwise_not_caller
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
cudaStream_t
stream
)
{
dst
.
create
(
src
.
size
(),
src
.
type
());
mathfunc
::
bitwise_not_caller
(
src
.
rows
,
src
.
cols
,
src
,
src
.
elemSize
(),
dst
,
stream
);
cv
::
gpu
::
mathfunc
::
bitwise_not_caller
(
src
.
rows
,
src
.
cols
,
src
.
elemSize1
(),
dst
.
channels
(),
src
,
dst
,
stream
);
}
void
bitwise_not_caller
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
const
GpuMat
&
mask
,
cudaStream_t
stream
)
{
using
namespace
cv
::
gpu
;
typedef
void
(
*
Caller
)(
int
,
int
,
int
,
const
PtrStep
,
const
PtrStep
,
PtrStep
,
cudaStream_t
);
static
Caller
callers
[]
=
{
mathfunc
::
bitwise_mask_not_caller
<
unsigned
char
>
,
mathfunc
::
bitwise_mask_not_caller
<
unsigned
char
>
,
mathfunc
::
bitwise_mask_not_caller
<
unsigned
short
>
,
mathfunc
::
bitwise_mask_not_caller
<
unsigned
short
>
,
mathfunc
::
bitwise_mask_not_caller
<
unsigned
int
>
,
mathfunc
::
bitwise_mask_not_caller
<
unsigned
int
>
,
mathfunc
::
bitwise_mask_not_caller
<
unsigned
int
>
};
CV_Assert
(
mask
.
type
()
==
CV_8U
&&
mask
.
size
()
==
src
.
size
());
dst
.
create
(
src
.
size
(),
src
.
type
());
mathfunc
::
bitwise_not_caller
(
src
.
rows
,
src
.
cols
,
src
,
src
.
elemSize
(),
dst
,
mask
,
stream
);
Caller
caller
=
callers
[
src
.
depth
()];
CV_Assert
(
caller
);
int
cn
=
src
.
depth
()
!=
CV_64F
?
src
.
channels
()
:
src
.
channels
()
*
(
sizeof
(
double
)
/
sizeof
(
unsigned
int
));
caller
(
src
.
rows
,
src
.
cols
,
cn
,
src
,
mask
,
dst
,
stream
);
}
void
bitwise_or_caller
(
const
GpuMat
&
src1
,
const
GpuMat
&
src2
,
GpuMat
&
dst
,
cudaStream_t
stream
)
{
CV_Assert
(
src1
.
size
()
==
src2
.
size
()
&&
src1
.
type
()
==
src2
.
type
());
dst
.
create
(
src1
.
size
(),
src1
.
type
());
mathfunc
::
bitwise_or_caller
(
dst
.
rows
,
dst
.
cols
,
src1
,
src2
,
dst
.
elemSize
(),
dst
,
stream
);
cv
::
gpu
::
mathfunc
::
bitwise_or_caller
(
dst
.
rows
,
dst
.
cols
,
dst
.
elemSize1
(),
dst
.
channels
(),
src1
,
src2
,
dst
,
stream
);
}
void
bitwise_or_caller
(
const
GpuMat
&
src1
,
const
GpuMat
&
src2
,
GpuMat
&
dst
,
const
GpuMat
&
mask
,
cudaStream_t
stream
)
{
using
namespace
cv
::
gpu
;
typedef
void
(
*
Caller
)(
int
,
int
,
int
,
const
PtrStep
,
const
PtrStep
,
const
PtrStep
,
PtrStep
,
cudaStream_t
);
static
Caller
callers
[]
=
{
mathfunc
::
bitwise_mask_or_caller
<
unsigned
char
>
,
mathfunc
::
bitwise_mask_or_caller
<
unsigned
char
>
,
mathfunc
::
bitwise_mask_or_caller
<
unsigned
short
>
,
mathfunc
::
bitwise_mask_or_caller
<
unsigned
short
>
,
mathfunc
::
bitwise_mask_or_caller
<
unsigned
int
>
,
mathfunc
::
bitwise_mask_or_caller
<
unsigned
int
>
,
mathfunc
::
bitwise_mask_or_caller
<
unsigned
int
>
};
CV_Assert
(
src1
.
size
()
==
src2
.
size
()
&&
src1
.
type
()
==
src2
.
type
());
CV_Assert
(
mask
.
type
()
==
CV_8U
&&
mask
.
size
()
==
src1
.
size
());
dst
.
create
(
src1
.
size
(),
src1
.
type
());
mathfunc
::
bitwise_or_caller
(
dst
.
rows
,
dst
.
cols
,
src1
,
src2
,
dst
.
elemSize
(),
dst
,
mask
,
stream
);
Caller
caller
=
callers
[
src1
.
depth
()];
CV_Assert
(
caller
);
int
cn
=
dst
.
depth
()
!=
CV_64F
?
dst
.
channels
()
:
dst
.
channels
()
*
(
sizeof
(
double
)
/
sizeof
(
unsigned
int
));
caller
(
dst
.
rows
,
dst
.
cols
,
cn
,
src1
,
src2
,
mask
,
dst
,
stream
);
}
void
bitwise_and_caller
(
const
GpuMat
&
src1
,
const
GpuMat
&
src2
,
GpuMat
&
dst
,
cudaStream_t
stream
)
{
CV_Assert
(
src1
.
size
()
==
src2
.
size
()
&&
src1
.
type
()
==
src2
.
type
());
dst
.
create
(
src1
.
size
(),
src1
.
type
());
mathfunc
::
bitwise_and_caller
(
dst
.
rows
,
dst
.
cols
,
src1
,
src2
,
dst
.
elemSize
(),
dst
,
stream
);
cv
::
gpu
::
mathfunc
::
bitwise_and_caller
(
dst
.
rows
,
dst
.
cols
,
dst
.
elemSize1
(),
dst
.
channels
(),
src1
,
src2
,
dst
,
stream
);
}
void
bitwise_and_caller
(
const
GpuMat
&
src1
,
const
GpuMat
&
src2
,
GpuMat
&
dst
,
const
GpuMat
&
mask
,
cudaStream_t
stream
)
{
using
namespace
cv
::
gpu
;
typedef
void
(
*
Caller
)(
int
,
int
,
int
,
const
PtrStep
,
const
PtrStep
,
const
PtrStep
,
PtrStep
,
cudaStream_t
);
static
Caller
callers
[]
=
{
mathfunc
::
bitwise_mask_and_caller
<
unsigned
char
>
,
mathfunc
::
bitwise_mask_and_caller
<
unsigned
char
>
,
mathfunc
::
bitwise_mask_and_caller
<
unsigned
short
>
,
mathfunc
::
bitwise_mask_and_caller
<
unsigned
short
>
,
mathfunc
::
bitwise_mask_and_caller
<
unsigned
int
>
,
mathfunc
::
bitwise_mask_and_caller
<
unsigned
int
>
,
mathfunc
::
bitwise_mask_and_caller
<
unsigned
int
>
};
CV_Assert
(
src1
.
size
()
==
src2
.
size
()
&&
src1
.
type
()
==
src2
.
type
());
CV_Assert
(
mask
.
type
()
==
CV_8U
&&
mask
.
size
()
==
src1
.
size
());
dst
.
create
(
src1
.
size
(),
src1
.
type
());
mathfunc
::
bitwise_and_caller
(
dst
.
rows
,
dst
.
cols
,
src1
,
src2
,
dst
.
elemSize
(),
dst
,
mask
,
stream
);
Caller
caller
=
callers
[
src1
.
depth
()];
CV_Assert
(
caller
);
int
cn
=
dst
.
depth
()
!=
CV_64F
?
dst
.
channels
()
:
dst
.
channels
()
*
(
sizeof
(
double
)
/
sizeof
(
unsigned
int
));
caller
(
dst
.
rows
,
dst
.
cols
,
cn
,
src1
,
src2
,
mask
,
dst
,
stream
);
}
void
bitwise_xor_caller
(
const
GpuMat
&
src1
,
const
GpuMat
&
src2
,
GpuMat
&
dst
,
cudaStream_t
stream
)
{
CV_Assert
(
src1
.
size
()
==
src2
.
size
());
CV_Assert
(
src1
.
type
()
==
src2
.
type
());
CV_Assert
(
src1
.
size
()
==
src2
.
size
()
&&
src1
.
type
()
==
src2
.
type
());
dst
.
create
(
src1
.
size
(),
src1
.
type
());
mathfunc
::
bitwise_xor_caller
(
dst
.
rows
,
dst
.
cols
,
src1
,
src2
,
dst
.
elemSize
(),
dst
,
stream
);
cv
::
gpu
::
mathfunc
::
bitwise_xor_caller
(
dst
.
rows
,
dst
.
cols
,
dst
.
elemSize1
(),
dst
.
channels
(),
src1
,
src2
,
dst
,
stream
);
}
void
bitwise_xor_caller
(
const
GpuMat
&
src1
,
const
GpuMat
&
src2
,
GpuMat
&
dst
,
const
GpuMat
&
mask
,
cudaStream_t
stream
)
{
using
namespace
cv
::
gpu
;
typedef
void
(
*
Caller
)(
int
,
int
,
int
,
const
PtrStep
,
const
PtrStep
,
const
PtrStep
,
PtrStep
,
cudaStream_t
);
static
Caller
callers
[]
=
{
mathfunc
::
bitwise_mask_xor_caller
<
unsigned
char
>
,
mathfunc
::
bitwise_mask_xor_caller
<
unsigned
char
>
,
mathfunc
::
bitwise_mask_xor_caller
<
unsigned
short
>
,
mathfunc
::
bitwise_mask_xor_caller
<
unsigned
short
>
,
mathfunc
::
bitwise_mask_xor_caller
<
unsigned
int
>
,
mathfunc
::
bitwise_mask_xor_caller
<
unsigned
int
>
,
mathfunc
::
bitwise_mask_xor_caller
<
unsigned
int
>
};
CV_Assert
(
src1
.
size
()
==
src2
.
size
()
&&
src1
.
type
()
==
src2
.
type
());
CV_Assert
(
mask
.
type
()
==
CV_8U
&&
mask
.
size
()
==
src1
.
size
());
dst
.
create
(
src1
.
size
(),
src1
.
type
());
mathfunc
::
bitwise_xor_caller
(
dst
.
rows
,
dst
.
cols
,
src1
,
src2
,
dst
.
elemSize
(),
dst
,
mask
,
stream
);
Caller
caller
=
callers
[
src1
.
depth
()];
CV_Assert
(
caller
);
int
cn
=
dst
.
depth
()
!=
CV_64F
?
dst
.
channels
()
:
dst
.
channels
()
*
(
sizeof
(
double
)
/
sizeof
(
unsigned
int
));
caller
(
dst
.
rows
,
dst
.
cols
,
cn
,
src1
,
src2
,
mask
,
dst
,
stream
);
}
}
...
...
modules/gpu/src/cuda/mathfunc.cu
浏览文件 @
e62bf3a2
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录