Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
ecf770d4
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,发现更多精彩内容 >>
提交
ecf770d4
编写于
3月 14, 2013
作者:
A
Andrey Kamaev
提交者:
OpenCV Buildbot
3月 14, 2013
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #638 from bitwangyaoyao:2.4_fixErode
上级
5f3eb0fc
084385cf
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
9 addition
and
15 deletion
+9
-15
modules/ocl/src/filtering.cpp
modules/ocl/src/filtering.cpp
+8
-10
modules/ocl/src/kernels/filtering_morph.cl
modules/ocl/src/kernels/filtering_morph.cl
+1
-5
未找到文件。
modules/ocl/src/filtering.cpp
浏览文件 @
ecf770d4
...
...
@@ -195,7 +195,7 @@ public:
namespace
{
typedef
void
(
*
GPUMorfFilter_t
)(
const
oclMat
&
,
oclMat
&
,
oclMat
&
,
Size
&
,
const
Point
,
bool
rectKernel
,
bool
usrROI
);
typedef
void
(
*
GPUMorfFilter_t
)(
const
oclMat
&
,
oclMat
&
,
oclMat
&
,
Size
&
,
const
Point
,
bool
rectKernel
);
class
MorphFilter_GPU
:
public
BaseFilter_GPU
{
...
...
@@ -205,7 +205,7 @@ public:
virtual
void
operator
()(
const
oclMat
&
src
,
oclMat
&
dst
)
{
func
(
src
,
dst
,
kernel
,
ksize
,
anchor
,
rectKernel
,
false
)
;
func
(
src
,
dst
,
kernel
,
ksize
,
anchor
,
rectKernel
)
;
}
oclMat
kernel
;
...
...
@@ -220,7 +220,7 @@ public:
**Note that the kernel need to be further refined.
*/
static
void
GPUErode
(
const
oclMat
&
src
,
oclMat
&
dst
,
oclMat
&
mat_kernel
,
Size
&
ksize
,
const
Point
anchor
,
bool
rectKernel
,
bool
useROI
)
Size
&
ksize
,
const
Point
anchor
,
bool
rectKernel
)
{
//Normalize the result by default
//float alpha = ksize.height * ksize.width;
...
...
@@ -276,11 +276,10 @@ static void GPUErode(const oclMat &src, oclMat &dst, oclMat &mat_kernel,
}
char
compile_option
[
128
];
sprintf
(
compile_option
,
"-D RADIUSX=%d -D RADIUSY=%d -D LSIZE0=%d -D LSIZE1=%d -D ERODE %s %s
%s
"
,
sprintf
(
compile_option
,
"-D RADIUSX=%d -D RADIUSY=%d -D LSIZE0=%d -D LSIZE1=%d -D ERODE %s %s"
,
anchor
.
x
,
anchor
.
y
,
(
int
)
localThreads
[
0
],
(
int
)
localThreads
[
1
],
rectKernel
?
"-D RECTKERNEL"
:
""
,
useROI
?
"-D USEROI"
:
""
,
s
);
rectKernel
?
"-D RECTKERNEL"
:
""
,
s
);
vector
<
pair
<
size_t
,
const
void
*>
>
args
;
args
.
push_back
(
make_pair
(
sizeof
(
cl_mem
),
(
void
*
)
&
src
.
data
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_mem
),
(
void
*
)
&
dst
.
data
));
...
...
@@ -300,7 +299,7 @@ static void GPUErode(const oclMat &src, oclMat &dst, oclMat &mat_kernel,
//! data type supported: CV_8UC1, CV_8UC4, CV_32FC1, CV_32FC4
static
void
GPUDilate
(
const
oclMat
&
src
,
oclMat
&
dst
,
oclMat
&
mat_kernel
,
Size
&
ksize
,
const
Point
anchor
,
bool
rectKernel
,
bool
useROI
)
Size
&
ksize
,
const
Point
anchor
,
bool
rectKernel
)
{
//Normalize the result by default
//float alpha = ksize.height * ksize.width;
...
...
@@ -357,10 +356,9 @@ static void GPUDilate(const oclMat &src, oclMat &dst, oclMat &mat_kernel,
}
char
compile_option
[
128
];
sprintf
(
compile_option
,
"-D RADIUSX=%d -D RADIUSY=%d -D LSIZE0=%d -D LSIZE1=%d -D DILATE %s %s
%s
"
,
sprintf
(
compile_option
,
"-D RADIUSX=%d -D RADIUSY=%d -D LSIZE0=%d -D LSIZE1=%d -D DILATE %s %s"
,
anchor
.
x
,
anchor
.
y
,
(
int
)
localThreads
[
0
],
(
int
)
localThreads
[
1
],
rectKernel
?
"-D RECTKERNEL"
:
""
,
useROI
?
"-D USEROI"
:
""
,
s
);
vector
<
pair
<
size_t
,
const
void
*>
>
args
;
args
.
push_back
(
make_pair
(
sizeof
(
cl_mem
),
(
void
*
)
&
src
.
data
));
...
...
modules/ocl/src/kernels/filtering_morph.cl
浏览文件 @
ecf770d4
...
...
@@ -120,8 +120,7 @@ __kernel void morph_C1_D0(__global const uchar * restrict src,
int
gidy
=
get_global_id
(
1
)
;
int
out_addr
=
mad24
(
gidy,dst_step_in_pixel,gidx+dst_offset_in_pixel
)
;
#
ifdef
USEROI
if
(
gidx+3<cols
&&
gidy<rows
&&
(
dst_offset_in_pixel&3==0
))
if
(
gidx+3<cols
&&
gidy<rows
&&
(
dst_offset_in_pixel&3
)
==0
)
{
*
(
__global
uchar4*
)
&dst[out_addr]
=
res
;
}
...
...
@@ -150,9 +149,6 @@ __kernel void morph_C1_D0(__global const uchar * restrict src,
dst[out_addr]
=
res.x
;
}
}
#
else
*
(
__global
uchar4*
)
&dst[out_addr]
=
res
;
#
endif
}
#
else
__kernel
void
morph
(
__global
const
GENTYPE
*
restrict
src,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录