Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
c16f96cb
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,发现更多精彩内容 >>
提交
c16f96cb
编写于
9月 06, 2016
作者:
M
Maksim Shabunin
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #7221 from terfendail:sepfilter_vec_kernel
上级
8b222ac0
f773f45d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
35 addition
and
37 deletion
+35
-37
3rdparty/carotene/hal/tegra_hal.hpp
3rdparty/carotene/hal/tegra_hal.hpp
+9
-9
modules/imgproc/include/opencv2/imgproc/hal/hal.hpp
modules/imgproc/include/opencv2/imgproc/hal/hal.hpp
+2
-4
modules/imgproc/src/filter.cpp
modules/imgproc/src/filter.cpp
+21
-17
modules/imgproc/src/hal_replacement.hpp
modules/imgproc/src/hal_replacement.hpp
+3
-7
未找到文件。
3rdparty/carotene/hal/tegra_hal.hpp
浏览文件 @
c16f96cb
...
...
@@ -1178,12 +1178,12 @@ struct SepFilterCtx
CAROTENE_NS
::
BORDER_MODE
border
;
};
inline
int
TEGRA_SEPFILTERINIT
(
cvhalFilter2D
**
context
,
int
src_type
,
int
dst_type
,
int
kernel_type
,
uchar
*
kernelx_data
,
size_t
,
int
kernelx_width
,
int
kernelx_height
,
uchar
*
kernely_data
,
size_t
kernely_step
,
int
kernely_width
,
int
kernely_height
,
uchar
*
kernelx_data
,
int
kernelx_length
,
uchar
*
kernely_data
,
int
kernely_length
,
int
anchor_x
,
int
anchor_y
,
double
delta
,
int
borderType
)
{
if
(
!
context
||
!
kernelx_data
||
!
kernely_data
||
src_type
!=
CV_8UC1
||
dst_type
!=
CV_16SC1
||
!
(
kernelx_width
==
3
&&
kernelx_height
==
1
)
||
!
(
kernely_width
==
1
&&
kernely_height
==
3
)
||
kernelx_length
!=
3
||
kernely_length
!=
3
||
delta
!=
0
||
anchor_x
!=
1
||
anchor_y
!=
1
)
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
...
...
@@ -1225,24 +1225,24 @@ inline int TEGRA_SEPFILTERINIT(cvhalFilter2D **context, int src_type, int dst_ty
ctx
->
kernelx_data
[
1
]
=
kernelx_data
[
1
];
ctx
->
kernelx_data
[
2
]
=
kernelx_data
[
2
];
ctx
->
kernely_data
[
0
]
=
kernely_data
[
0
];
ctx
->
kernely_data
[
1
]
=
kernely_data
[
kernely_step
];
ctx
->
kernely_data
[
2
]
=
kernely_data
[
2
*
kernely_step
];
ctx
->
kernely_data
[
1
]
=
kernely_data
[
1
];
ctx
->
kernely_data
[
2
]
=
kernely_data
[
2
];
break
;
case
CV_8SC1
:
ctx
->
kernelx_data
[
0
]
=
((
char
*
)
kernelx_data
)[
0
];
ctx
->
kernelx_data
[
1
]
=
((
char
*
)
kernelx_data
)[
1
];
ctx
->
kernelx_data
[
2
]
=
((
char
*
)
kernelx_data
)[
2
];
ctx
->
kernely_data
[
0
]
=
((
char
*
)
kernely_data
)[
0
];
ctx
->
kernely_data
[
1
]
=
((
char
*
)
(
kernely_data
+
kernely_step
))[
0
];
ctx
->
kernely_data
[
2
]
=
((
char
*
)
(
kernely_data
+
2
*
kernely_step
))[
0
];
ctx
->
kernely_data
[
1
]
=
((
char
*
)
kernely_data
)[
1
];
ctx
->
kernely_data
[
2
]
=
((
char
*
)
kernely_data
)[
2
];
break
;
case
CV_16UC1
:
ctx
->
kernelx_data
[
0
]
=
((
int16_t
*
)
kernelx_data
)[
0
];
ctx
->
kernelx_data
[
1
]
=
((
int16_t
*
)
kernelx_data
)[
1
];
ctx
->
kernelx_data
[
2
]
=
((
int16_t
*
)
kernelx_data
)[
2
];
ctx
->
kernely_data
[
0
]
=
((
int16_t
*
)
kernely_data
)[
0
];
ctx
->
kernely_data
[
1
]
=
((
int16_t
*
)
(
kernely_data
+
kernely_step
))[
0
];
ctx
->
kernely_data
[
2
]
=
((
int16_t
*
)
(
kernely_data
+
2
*
kernely_step
))[
0
];
ctx
->
kernely_data
[
1
]
=
((
int16_t
*
)
kernely_data
)[
1
];
ctx
->
kernely_data
[
2
]
=
((
int16_t
*
)
kernely_data
)[
2
];
default:
delete
ctx
;
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
...
...
modules/imgproc/include/opencv2/imgproc/hal/hal.hpp
浏览文件 @
c16f96cb
...
...
@@ -30,10 +30,8 @@ struct CV_EXPORTS Filter2D
struct
CV_EXPORTS
SepFilter2D
{
static
Ptr
<
hal
::
SepFilter2D
>
create
(
int
stype
,
int
dtype
,
int
ktype
,
uchar
*
kernelx_data
,
size_t
kernelx_step
,
int
kernelx_width
,
int
kernelx_height
,
uchar
*
kernely_data
,
size_t
kernely_step
,
int
kernely_width
,
int
kernely_height
,
uchar
*
kernelx_data
,
int
kernelx_len
,
uchar
*
kernely_data
,
int
kernely_len
,
int
anchor_x
,
int
anchor_y
,
double
delta
,
int
borderType
);
virtual
void
apply
(
uchar
*
src_data
,
size_t
src_step
,
...
...
modules/imgproc/src/filter.cpp
浏览文件 @
c16f96cb
...
...
@@ -4823,13 +4823,13 @@ struct ReplacementSepFilter : public hal::SepFilter2D
bool
isInitialized
;
ReplacementSepFilter
()
:
ctx
(
0
),
isInitialized
(
false
)
{}
bool
init
(
int
stype
,
int
dtype
,
int
ktype
,
uchar
*
kernelx_data
,
size_t
kernelx_step
,
int
kernelx_width
,
int
kernelx_height
,
uchar
*
kernely_data
,
size_t
kernely_step
,
int
kernely_width
,
int
kernely_height
,
uchar
*
kernelx_data
,
int
kernelx_len
,
uchar
*
kernely_data
,
int
kernely_len
,
int
anchor_x
,
int
anchor_y
,
double
delta
,
int
borderType
)
{
int
res
=
cv_hal_sepFilterInit
(
&
ctx
,
stype
,
dtype
,
ktype
,
kernelx_data
,
kernelx_
step
,
kernelx_width
,
kernelx_height
,
kernely_data
,
kernely_
step
,
kernely_width
,
kernely_height
,
kernelx_data
,
kernelx_
len
,
kernely_data
,
kernely_
len
,
anchor_x
,
anchor_y
,
delta
,
borderType
);
isInitialized
=
(
res
==
CV_HAL_ERROR_OK
);
return
isInitialized
;
...
...
@@ -4862,14 +4862,14 @@ struct OcvSepFilter : public hal::SepFilter2D
int
src_type
;
int
dst_type
;
bool
init
(
int
stype
,
int
dtype
,
int
ktype
,
uchar
*
kernelx_data
,
size_t
kernelx_step
,
int
kernelx_width
,
int
kernelx_height
,
uchar
*
kernely_data
,
size_t
kernely_step
,
int
kernely_width
,
int
kernely_height
,
uchar
*
kernelx_data
,
int
kernelx_len
,
uchar
*
kernely_data
,
int
kernely_len
,
int
anchor_x
,
int
anchor_y
,
double
delta
,
int
borderType
)
{
src_type
=
stype
;
dst_type
=
dtype
;
Mat
kernelX
(
Size
(
kernelx_
width
,
kernelx_height
),
ktype
,
kernelx_data
,
kernelx_step
);
Mat
kernelY
(
Size
(
kernely_
width
,
kernely_height
),
ktype
,
kernely_data
,
kernely_step
);
Mat
kernelX
(
Size
(
kernelx_
len
,
1
),
ktype
,
kernelx_data
);
Mat
kernelY
(
Size
(
kernely_
len
,
1
),
ktype
,
kernely_data
);
f
=
createSeparableLinearFilter
(
stype
,
dtype
,
kernelX
,
kernelY
,
Point
(
anchor_x
,
anchor_y
),
...
...
@@ -4958,15 +4958,15 @@ Ptr<hal::Filter2D> Filter2D::create(uchar* kernel_data, size_t kernel_step, int
//---------------------------------------------------------------
Ptr
<
SepFilter2D
>
SepFilter2D
::
create
(
int
stype
,
int
dtype
,
int
ktype
,
uchar
*
kernelx_data
,
size_t
kernelx_step
,
int
kernelx_width
,
int
kernelx_height
,
uchar
*
kernely_data
,
size_t
kernely_step
,
int
kernely_width
,
int
kernely_height
,
uchar
*
kernelx_data
,
int
kernelx_len
,
uchar
*
kernely_data
,
int
kernely_len
,
int
anchor_x
,
int
anchor_y
,
double
delta
,
int
borderType
)
{
{
ReplacementSepFilter
*
impl
=
new
ReplacementSepFilter
();
if
(
impl
->
init
(
stype
,
dtype
,
ktype
,
kernelx_data
,
kernelx_
step
,
kernelx_width
,
kernelx_height
,
kernely_data
,
kernely_
step
,
kernely_width
,
kernely_height
,
kernelx_data
,
kernelx_
len
,
kernely_data
,
kernely_
len
,
anchor_x
,
anchor_y
,
delta
,
borderType
))
{
return
Ptr
<
hal
::
SepFilter2D
>
(
impl
);
...
...
@@ -4976,8 +4976,8 @@ Ptr<SepFilter2D> SepFilter2D::create(int stype, int dtype, int ktype,
{
OcvSepFilter
*
impl
=
new
OcvSepFilter
();
impl
->
init
(
stype
,
dtype
,
ktype
,
kernelx_data
,
kernelx_
step
,
kernelx_width
,
kernelx_height
,
kernely_data
,
kernely_
step
,
kernely_width
,
kernely_height
,
kernelx_data
,
kernelx_
len
,
kernely_data
,
kernely_
len
,
anchor_x
,
anchor_y
,
delta
,
borderType
);
return
Ptr
<
hal
::
SepFilter2D
>
(
impl
);
}
...
...
@@ -5041,11 +5041,15 @@ void cv::sepFilter2D( InputArray _src, OutputArray _dst, int ddepth,
if
(
(
borderType
&
BORDER_ISOLATED
)
==
0
)
src
.
locateROI
(
wsz
,
ofs
);
CV_Assert
(
kernelX
.
type
()
==
kernelY
.
type
());
CV_Assert
(
kernelX
.
type
()
==
kernelY
.
type
()
&&
(
kernelX
.
cols
==
1
||
kernelX
.
rows
==
1
)
&&
(
kernelY
.
cols
==
1
||
kernelY
.
rows
==
1
)
);
Mat
contKernelX
=
kernelX
.
isContinuous
()
?
kernelX
:
kernelX
.
clone
();
Mat
contKernelY
=
kernelY
.
isContinuous
()
?
kernelY
:
kernelY
.
clone
();
Ptr
<
hal
::
SepFilter2D
>
c
=
hal
::
SepFilter2D
::
create
(
src
.
type
(),
dst
.
type
(),
kernelX
.
type
(),
kernelX
.
data
,
kernelX
.
step
,
kernelX
.
cols
,
kernelX
.
rows
,
kernelY
.
data
,
kernelY
.
step
,
kernelY
.
cols
,
kernelY
.
rows
,
contKernelX
.
data
,
kernelX
.
cols
+
kernelX
.
rows
-
1
,
contKernelY
.
data
,
kernelY
.
cols
+
kernelY
.
rows
-
1
,
anchor
.
x
,
anchor
.
y
,
delta
,
borderType
&
~
BORDER_ISOLATED
);
c
->
apply
(
src
.
data
,
src
.
step
,
dst
.
data
,
dst
.
step
,
dst
.
cols
,
dst
.
rows
,
wsz
.
width
,
wsz
.
height
,
ofs
.
x
,
ofs
.
y
);
}
...
...
modules/imgproc/src/hal_replacement.hpp
浏览文件 @
c16f96cb
...
...
@@ -140,20 +140,16 @@ inline int hal_ni_filterFree(cvhalFilter2D *context) { return CV_HAL_ERROR_NOT_I
@param dst_type destination image type
@param kernel_type kernels type
@param kernelx_data pointer to x-kernel data
@param kernelx_step x-kernel step
@param kernelx_width x-kernel width
@param kernelx_height x-kernel height
@param kernelx_length x-kernel vector length
@param kernely_data pointer to y-kernel data
@param kernely_step y-kernel step
@param kernely_width y-kernel width
@param kernely_height y-kernel height
@param kernely_length y-kernel vector length
@param anchor_x relative X position of center point within the kernel
@param anchor_y relative Y position of center point within the kernel
@param delta added to pixel values
@param borderType border processing mode (CV_HAL_BORDER_REFLECT, ...)
@sa cv::sepFilter2D, cv::hal::SepFilter2D
*/
inline
int
hal_ni_sepFilterInit
(
cvhalFilter2D
**
context
,
int
src_type
,
int
dst_type
,
int
kernel_type
,
uchar
*
kernelx_data
,
size_t
kernelx_step
,
int
kernelx_width
,
int
kernelx_height
,
uchar
*
kernely_data
,
size_t
kernely_step
,
int
kernely_width
,
int
kernely_height
,
int
anchor_x
,
int
anchor_y
,
double
delta
,
int
borderType
)
{
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
}
inline
int
hal_ni_sepFilterInit
(
cvhalFilter2D
**
context
,
int
src_type
,
int
dst_type
,
int
kernel_type
,
uchar
*
kernelx_data
,
int
kernelx_length
,
uchar
*
kernely_data
,
int
kernely_length
,
int
anchor_x
,
int
anchor_y
,
double
delta
,
int
borderType
)
{
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
}
/**
@brief hal_sepFilter
@param context pointer to user-defined context
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录