Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
75861452
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,发现更多精彩内容 >>
提交
75861452
编写于
4月 12, 2013
作者:
P
peng xiao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove unused kernels.
上级
aec7a67d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
0 addition
and
182 deletion
+0
-182
modules/ocl/src/opencl/imgproc_canny.cl
modules/ocl/src/opencl/imgproc_canny.cl
+0
-182
未找到文件。
modules/ocl/src/opencl/imgproc_canny.cl
浏览文件 @
75861452
...
...
@@ -360,188 +360,6 @@ __kernel
}
}
//
non
local
memory
version
__kernel
void
calcMap_2
(
__global
const
int
*
dx,
__global
const
int
*
dy,
__global
const
float
*
mag,
__global
int
*
map,
int
rows,
int
cols,
float
low_thresh,
float
high_thresh,
int
dx_step,
int
dx_offset,
int
dy_step,
int
dy_offset,
int
mag_step,
int
mag_offset,
int
map_step,
int
map_offset
)
{
dx_step
/=
sizeof
(
*dx
)
;
dx_offset
/=
sizeof
(
*dx
)
;
dy_step
/=
sizeof
(
*dy
)
;
dy_offset
/=
sizeof
(
*dy
)
;
mag_step
/=
sizeof
(
*mag
)
;
mag_offset
/=
sizeof
(
*mag
)
;
map_step
/=
sizeof
(
*map
)
;
map_offset
/=
sizeof
(
*map
)
;
int
gidx
=
get_global_id
(
0
)
;
int
gidy
=
get_global_id
(
1
)
;
if
(
gidy
<
rows
&&
gidx
<
cols
)
{
int
x
=
dx[gidx
+
gidy
*
dx_step]
;
int
y
=
dy[gidx
+
gidy
*
dy_step]
;
const
int
s
=
(
x
^
y
)
<
0
?
-1
:
1
;
const
float
m
=
mag[gidx
+
1
+
(
gidy
+
1
)
*
mag_step]
;
x
=
abs
(
x
)
;
y
=
abs
(
y
)
;
//
0
-
the
pixel
can
not
belong
to
an
edge
//
1
-
the
pixel
might
belong
to
an
edge
//
2
-
the
pixel
does
belong
to
an
edge
int
edge_type
=
0
;
if
(
m
>
low_thresh
)
{
const
int
tg22x
=
x
*
TG22
;
const
int
tg67x
=
tg22x
+
(
x
<<
(
1
+
CANNY_SHIFT
))
;
y
<<=
CANNY_SHIFT
;
if
(
y
<
tg22x
)
{
if
(
m
>
mag[gidx
+
(
gidy
+
1
)
*
mag_step]
&&
m
>=
mag[gidx
+
2
+
(
gidy
+
1
)
*
mag_step]
)
{
edge_type
=
1
+
(
int
)(
m
>
high_thresh
)
;
}
}
else
if
(
y
>
tg67x
)
{
if
(
m
>
mag[gidx
+
1
+
gidy*
mag_step]
&&
m
>=
mag[gidx
+
1
+
(
gidy
+
2
)
*
mag_step]
)
{
edge_type
=
1
+
(
int
)(
m
>
high_thresh
)
;
}
}
else
{
if
(
m
>
mag[gidx
+
1
-
s
+
gidy
*
mag_step]
&&
m
>
mag[gidx
+
1
+
s
+
(
gidy
+
2
)
*
mag_step]
)
{
edge_type
=
1
+
(
int
)(
m
>
high_thresh
)
;
}
}
}
map[gidx
+
1
+
(
gidy
+
1
)
*
map_step]
=
edge_type
;
}
}
//
[256,
1
,
1]
threaded,
local
memory
version
__kernel
void
calcMap_3
(
__global
const
int
*
dx,
__global
const
int
*
dy,
__global
const
float
*
mag,
__global
int
*
map,
int
rows,
int
cols,
float
low_thresh,
float
high_thresh,
int
dx_step,
int
dx_offset,
int
dy_step,
int
dy_offset,
int
mag_step,
int
mag_offset,
int
map_step,
int
map_offset
)
{
dx_step
/=
sizeof
(
*dx
)
;
dx_offset
/=
sizeof
(
*dx
)
;
dy_step
/=
sizeof
(
*dy
)
;
dy_offset
/=
sizeof
(
*dy
)
;
mag_step
/=
sizeof
(
*mag
)
;
mag_offset
/=
sizeof
(
*mag
)
;
map_step
/=
sizeof
(
*map
)
;
map_offset
/=
sizeof
(
*map
)
;
__local
float
smem[18][18]
;
int
lidx
=
get_local_id
(
0
)
%
16
;
int
lidy
=
get_local_id
(
0
)
/
16
;
int
grp_pix
=
get_global_id
(
0
)
; // identifies which pixel is processing currently in the target block
int
grp_ind
=
get_global_id
(
1
)
; // identifies which block of pixels is currently processing
int
grp_idx
=
(
grp_ind
%
(
cols/16
))
*
16
;
int
grp_idy
=
(
grp_ind
/
(
cols/16
))
*
16
; //(grp_ind / (cols/16)) * 16
int
gidx
=
grp_idx
+
lidx
;
int
gidy
=
grp_idy
+
lidy
;
int
tid
=
get_global_id
(
0
)
%
256
;
int
lx
=
tid
%
18
;
int
ly
=
tid
/
18
;
if
(
ly
<
14
)
{
smem[ly][lx]
=
mag[grp_idx
+
lx
+
(
grp_idy
+
ly
)
*
mag_step]
;
}
if
(
ly
<
4
&&
grp_idy
+
ly
+
14
<=
rows
&&
grp_idx
+
lx
<=
cols
)
{
smem[ly
+
14][lx]
=
mag[grp_idx
+
lx
+
(
grp_idy
+
ly
+
14
)
*
mag_step]
;
}
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
if
(
gidy
<
rows
&&
gidx
<
cols
)
{
int
x
=
dx[gidx
+
gidy
*
dx_step]
;
int
y
=
dy[gidx
+
gidy
*
dy_step]
;
const
int
s
=
(
x
^
y
)
<
0
?
-1
:
1
;
const
float
m
=
smem[lidy
+
1][lidx
+
1]
;
x
=
abs
(
x
)
;
y
=
abs
(
y
)
;
//
0
-
the
pixel
can
not
belong
to
an
edge
//
1
-
the
pixel
might
belong
to
an
edge
//
2
-
the
pixel
does
belong
to
an
edge
int
edge_type
=
0
;
if
(
m
>
low_thresh
)
{
const
int
tg22x
=
x
*
TG22
;
const
int
tg67x
=
tg22x
+
(
x
<<
(
1
+
CANNY_SHIFT
))
;
y
<<=
CANNY_SHIFT
;
if
(
y
<
tg22x
)
{
if
(
m
>
smem[lidy
+
1][lidx]
&&
m
>=
smem[lidy
+
1][lidx
+
2]
)
{
edge_type
=
1
+
(
int
)(
m
>
high_thresh
)
;
}
}
else
if
(
y
>
tg67x
)
{
if
(
m
>
smem[lidy][lidx
+
1]&&
m
>=
smem[lidy
+
2][lidx
+
1]
)
{
edge_type
=
1
+
(
int
)(
m
>
high_thresh
)
;
}
}
else
{
if
(
m
>
smem[lidy][lidx
+
1
-
s]&&
m
>
smem[lidy
+
2][lidx
+
1
+
s]
)
{
edge_type
=
1
+
(
int
)(
m
>
high_thresh
)
;
}
}
}
map[gidx
+
1
+
(
gidy
+
1
)
*
map_step]
=
edge_type
;
}
}
#
undef
CANNY_SHIFT
#
undef
TG22
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录