Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
5dddb478
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,发现更多精彩内容 >>
提交
5dddb478
编写于
6月 30, 2015
作者:
S
Seon-Wook Park
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
spatialGradient: Remove pointers caching
上级
cf0fdfa2
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
24 addition
and
21 deletion
+24
-21
modules/imgproc/src/spatialgradient.cpp
modules/imgproc/src/spatialgradient.cpp
+24
-21
未找到文件。
modules/imgproc/src/spatialgradient.cpp
浏览文件 @
5dddb478
...
...
@@ -102,12 +102,7 @@ void spatialGradient( InputArray _src, OutputArray _dx, OutputArray _dy,
int
i
=
0
,
j
=
0
;
// Store pointers to rows of input/output data
// Padded by two rows for border handling
std
::
vector
<
uchar
*>
P_src
(
H
+
2
);
std
::
vector
<
short
*>
P_dx
(
H
+
2
);
std
::
vector
<
short
*>
P_dy
(
H
+
2
);
// Handle border types
int
i_top
=
0
,
// Case for H == 1 && W == 1 && BORDER_REPLICATE
i_bottom
=
H
-
1
,
j_offl
=
0
,
// j offset from 0th pixel to reach -1st pixel
...
...
@@ -127,16 +122,6 @@ void spatialGradient( InputArray _src, OutputArray _dx, OutputArray _dy,
}
}
P_src
[
0
]
=
src
.
ptr
<
uchar
>
(
i_top
);
// Mirrored top border
P_src
[
H
+
1
]
=
src
.
ptr
<
uchar
>
(
i_bottom
);
// Mirrored bottom border
for
(
i
=
0
;
i
<
H
;
i
++
)
{
P_src
[
i
+
1
]
=
src
.
ptr
<
uchar
>
(
i
);
P_dx
[
i
]
=
dx
.
ptr
<
short
>
(
i
);
P_dy
[
i
]
=
dy
.
ptr
<
short
>
(
i
);
}
// Pointer to row vectors
uchar
*
p_src
,
*
c_src
,
*
n_src
;
// previous, current, next row
short
*
c_dx
,
*
c_dy
;
...
...
@@ -158,8 +143,19 @@ void spatialGradient( InputArray _src, OutputArray _dx, OutputArray _dy,
// Example: umn is offset -1 in row and offset 0 in column
for
(
i
=
0
;
i
<
H
-
1
;
i
+=
2
)
{
p_src
=
P_src
[
i
];
c_src
=
P_src
[
i
+
1
];
n_src
=
P_src
[
i
+
2
];
m_src
=
P_src
[
i
+
3
];
c_dx
=
P_dx
[
i
];
c_dy
=
P_dy
[
i
];
n_dx
=
P_dx
[
i
+
1
];
n_dy
=
P_dy
[
i
+
1
];
if
(
i
==
0
)
p_src
=
src
.
ptr
<
uchar
>
(
i_top
);
else
p_src
=
src
.
ptr
<
uchar
>
(
i
-
1
);
c_src
=
src
.
ptr
<
uchar
>
(
i
);
n_src
=
src
.
ptr
<
uchar
>
(
i
+
1
);
if
(
i
==
H
-
2
)
m_src
=
src
.
ptr
<
uchar
>
(
i_bottom
);
else
m_src
=
src
.
ptr
<
uchar
>
(
i
+
2
);
c_dx
=
dx
.
ptr
<
short
>
(
i
);
c_dy
=
dy
.
ptr
<
short
>
(
i
);
n_dx
=
dx
.
ptr
<
short
>
(
i
+
1
);
n_dy
=
dy
.
ptr
<
short
>
(
i
+
1
);
// Process rest of columns 16-column chunks at a time
for
(
j
=
1
;
j
<
W
-
16
;
j
+=
16
)
...
...
@@ -266,9 +262,16 @@ void spatialGradient( InputArray _src, OutputArray _dx, OutputArray _dy,
uchar
v00
,
v01
,
v02
,
v10
,
v11
,
v12
,
v20
,
v21
,
v22
;
for
(
i
=
0
;
i
<
H
;
i
++
)
{
p_src
=
P_src
[
i
];
c_src
=
P_src
[
i
+
1
];
n_src
=
P_src
[
i
+
2
];
c_dx
=
P_dx
[
i
];
c_dy
=
P_dy
[
i
];
if
(
i
==
0
)
p_src
=
src
.
ptr
<
uchar
>
(
i_top
);
else
p_src
=
src
.
ptr
<
uchar
>
(
i
-
1
);
c_src
=
src
.
ptr
<
uchar
>
(
i
);
if
(
i
==
H
-
1
)
n_src
=
src
.
ptr
<
uchar
>
(
i_bottom
);
else
n_src
=
src
.
ptr
<
uchar
>
(
i
+
1
);
c_dx
=
dx
.
ptr
<
short
>
(
i
);
c_dy
=
dy
.
ptr
<
short
>
(
i
);
// Process left-most column
j
=
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录