Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
e45f92a9
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,发现更多精彩内容 >>
提交
e45f92a9
编写于
9月 04, 2013
作者:
P
pengxiao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix a bug of ocl retina on NVIDIA platform.
上级
00991987
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
47 addition
and
16 deletion
+47
-16
modules/bioinspired/src/opencl/retina_kernel.cl
modules/bioinspired/src/opencl/retina_kernel.cl
+45
-14
modules/bioinspired/src/retina_ocl.cpp
modules/bioinspired/src/retina_ocl.cpp
+1
-1
modules/bioinspired/test/test_retina_ocl.cpp
modules/bioinspired/test/test_retina_ocl.cpp
+1
-1
未找到文件。
modules/bioinspired/src/opencl/retina_kernel.cl
浏览文件 @
e45f92a9
...
...
@@ -114,19 +114,34 @@ kernel void horizontalAnticausalFilter(
global
float
*
optr
=
output
+
mad24
(
gid
+
1
,
elements_per_row,
-
1
+
out_offset
/
4
)
;
float4
result
=
(
float4
)(
0
)
,
out_v4
;
float4
result_v4
=
(
float4
)(
0
)
,
out_v4
;
float
result
=
0
;
//
we
assume
elements_per_row
is
multple
of
4
for
(
int
i
=
0
; i < elements_per_row / 4; ++i, optr -= 4)
for
(
int
i
=
0
; i < 4; ++ i, -- optr)
{
if
(
i
<
elements_per_row
-
cols
)
{
*optr
=
result
;
}
else
{
result
=
*optr
+
_a
*
result
;
*optr
=
result
;
}
}
result_v4.x
=
result
;
optr
-=
3
;
for
(
int
i
=
1
; i < elements_per_row / 4; ++i, optr -= 4)
{
//
shift
left,
`
offset
`
is
type
`
size_t
`
so
it
cannot
be
negative
out_v4
=
vload4
(
0
,
optr
-
3
)
;
out_v4
=
vload4
(
0
,
optr
)
;
result
.w
=
out_v4.w
+
_a
*
result
.x
;
result
.z
=
out_v4.z
+
_a
*
result
.w
;
result
.y
=
out_v4.y
+
_a
*
result
.z
;
result
.x
=
out_v4.x
+
_a
*
result
.y
;
result
_v4.w
=
out_v4.w
+
_a
*
result_v4
.x
;
result
_v4.z
=
out_v4.z
+
_a
*
result_v4
.w
;
result
_v4.y
=
out_v4.y
+
_a
*
result_v4
.z
;
result
_v4.x
=
out_v4.x
+
_a
*
result_v4
.y
;
vstore4
(
result
,
0
,
optr
-
3
)
;
vstore4
(
result
_v4,
0
,
optr
)
;
}
}
...
...
@@ -207,18 +222,34 @@ kernel void horizontalAnticausalFilter_Irregular(
buffer
+
mad24
(
rows
-
gid,
elements_per_row,
-1
+
buffer_offset
/
4
)
;
float4
buf_v4,
out_v4,
res_v4
=
(
float4
)(
0
)
;
for
(
int
i
=
0
; i < elements_per_row / 4; ++i, optr -= 4, bptr -= 4)
{
buf_v4
=
vload4
(
0
,
bptr
-
3
)
;
out_v4
=
vload4
(
0
,
optr
-
3
)
;
float
result
=
0
;
//
we
assume
elements_per_row
is
multple
of
4
for
(
int
i
=
0
; i < 4; ++ i, -- optr, -- bptr)
{
if
(
i
<
elements_per_row
-
cols
)
{
*optr
=
result
;
}
else
{
result
=
*optr
+
*bptr
*
result
;
*optr
=
result
;
}
}
res_v4.x
=
result
;
optr
-=
3
;
bptr
-=
3
;
for
(
int
i
=
0
; i < elements_per_row / 4 - 1; ++i, optr -= 4, bptr -= 4)
{
buf_v4
=
vload4
(
0
,
bptr
)
;
out_v4
=
vload4
(
0
,
optr
)
;
res_v4.w
=
out_v4.w
+
buf_v4.w
*
res_v4.x
;
res_v4.z
=
out_v4.z
+
buf_v4.z
*
res_v4.w
;
res_v4.y
=
out_v4.y
+
buf_v4.y
*
res_v4.z
;
res_v4.x
=
out_v4.x
+
buf_v4.x
*
res_v4.y
;
vstore4
(
res_v4,
0
,
optr
-
3
)
;
vstore4
(
res_v4,
0
,
optr
)
;
}
}
...
...
modules/bioinspired/src/retina_ocl.cpp
浏览文件 @
e45f92a9
...
...
@@ -1149,7 +1149,7 @@ void RetinaColor::_initColorSampling()
// computing photoreceptors local density
MAKE_OCLMAT_SLICES
(
_RGBmosaic
,
3
);
MAKE_OCLMAT_SLICES
(
_colorLocalDensity
,
3
);
_colorLocalDensity
.
setTo
(
0
);
_spatiotemporalLPfilter
(
_RGBmosaic_slices
[
0
],
_colorLocalDensity_slices
[
0
]);
_spatiotemporalLPfilter
(
_RGBmosaic_slices
[
1
],
_colorLocalDensity_slices
[
1
]);
_spatiotemporalLPfilter
(
_RGBmosaic_slices
[
2
],
_colorLocalDensity_slices
[
2
]);
...
...
modules/bioinspired/test/test_retina_ocl.cpp
浏览文件 @
e45f92a9
...
...
@@ -49,7 +49,7 @@
#include "opencv2/imgproc.hpp"
#include "opencv2/highgui.hpp"
#if defined(HAVE_OPENCV_OCL)
&& defined(HAVE_OPENCL)
#if defined(HAVE_OPENCV_OCL)
#include "opencv2/ocl.hpp"
#define RETINA_ITERATIONS 5
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录