Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
f40d7014
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,发现更多精彩内容 >>
提交
f40d7014
编写于
2月 05, 2016
作者:
M
Maksim Shabunin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
DFT: renamed HAL functions
上级
15783cf6
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
55 addition
and
55 deletion
+55
-55
modules/core/include/opencv2/core/hal/hal.hpp
modules/core/include/opencv2/core/hal/hal.hpp
+7
-7
modules/core/src/dxt.cpp
modules/core/src/dxt.cpp
+31
-31
modules/core/src/hal_replacement.hpp
modules/core/src/hal_replacement.hpp
+14
-14
modules/imgproc/src/templmatch.cpp
modules/imgproc/src/templmatch.cpp
+3
-3
未找到文件。
modules/core/include/opencv2/core/hal/hal.hpp
浏览文件 @
f40d7014
...
...
@@ -195,16 +195,16 @@ struct DftContext
};
CV_EXPORTS
void
dftInit2D
(
DftContext
&
c
,
int
_width
,
int
_height
,
int
_depth
,
int
_src_channels
,
int
_dst_channels
,
int
flags
,
int
_nonzero_rows
=
0
);
CV_EXPORTS
void
dft
Run
2D
(
const
DftContext
&
c
,
const
void
*
src
,
int
src_step
,
void
*
dst
,
int
dst_step
);
CV_EXPORTS
void
dft2D
(
const
DftContext
&
c
,
const
void
*
src
,
int
src_step
,
void
*
dst
,
int
dst_step
);
CV_EXPORTS
void
dftFree2D
(
DftContext
&
c
);
CV_EXPORTS
void
dftInit
(
DftContext
&
c
,
int
len
,
int
count
,
int
depth
,
int
flags
,
bool
*
useBuffer
=
0
);
CV_EXPORTS
void
dft
Run
(
const
DftContext
&
c
,
const
void
*
src
,
void
*
dst
);
CV_EXPORTS
void
dftFree
(
DftContext
&
c
);
CV_EXPORTS
void
dftInit
1D
(
DftContext
&
c
,
int
len
,
int
count
,
int
depth
,
int
flags
,
bool
*
useBuffer
=
0
);
CV_EXPORTS
void
dft
1D
(
const
DftContext
&
c
,
const
void
*
src
,
void
*
dst
);
CV_EXPORTS
void
dftFree
1D
(
DftContext
&
c
);
CV_EXPORTS
void
dctInit
(
DftContext
&
c
,
int
width
,
int
height
,
int
depth
,
int
flags
);
CV_EXPORTS
void
dct
Run
(
const
DftContext
&
c
,
const
void
*
src
,
int
src_step
,
void
*
dst
,
int
dst_step
);
CV_EXPORTS
void
dctFree
(
DftContext
&
c
);
CV_EXPORTS
void
dctInit
2D
(
DftContext
&
c
,
int
width
,
int
height
,
int
depth
,
int
flags
);
CV_EXPORTS
void
dct
2D
(
const
DftContext
&
c
,
const
void
*
src
,
int
src_step
,
void
*
dst
,
int
dst_step
);
CV_EXPORTS
void
dctFree
2D
(
DftContext
&
c
);
//! @} core_hal
...
...
modules/core/src/dxt.cpp
浏览文件 @
f40d7014
...
...
@@ -2763,7 +2763,7 @@ public:
count
=
height
;
}
needBufferA
=
isInplace
;
hal
::
dftInit
(
contextA
,
len
,
count
,
depth
,
f
,
&
needBufferA
);
hal
::
dftInit
1D
(
contextA
,
len
,
count
,
depth
,
f
,
&
needBufferA
);
if
(
needBufferA
)
tmp_bufA
.
allocate
(
len
*
complex_elem_size
);
}
...
...
@@ -2773,7 +2773,7 @@ public:
count
=
width
;
f
|=
CV_HAL_DFT_STAGE_COLS
;
needBufferB
=
isInplace
;
hal
::
dftInit
(
contextB
,
len
,
count
,
depth
,
f
,
&
needBufferB
);
hal
::
dftInit
1D
(
contextB
,
len
,
count
,
depth
,
f
,
&
needBufferB
);
if
(
needBufferB
)
tmp_bufB
.
allocate
(
len
*
complex_elem_size
);
...
...
@@ -2864,8 +2864,8 @@ public:
{
if
(
useIpp
)
return
;
hal
::
dftFree
(
contextA
);
hal
::
dftFree
(
contextB
);
hal
::
dftFree
1D
(
contextA
);
hal
::
dftFree
1D
(
contextB
);
}
protected:
...
...
@@ -2909,7 +2909,7 @@ protected:
if
(
needBufferA
)
dptr
=
tmp_bufA
;
hal
::
dft
Run
(
contextA
,
sptr
,
dptr
);
hal
::
dft
1D
(
contextA
,
sptr
,
dptr
);
if
(
needBufferA
)
memcpy
(
dptr0
,
dptr
+
dptr_offset
,
dst_full_len
);
...
...
@@ -2983,8 +2983,8 @@ protected:
}
if
(
even
)
hal
::
dft
Run
(
contextB
,
buf1
,
dbuf1
);
hal
::
dft
Run
(
contextB
,
buf0
,
dbuf0
);
hal
::
dft
1D
(
contextB
,
buf1
,
dbuf1
);
hal
::
dft
1D
(
contextB
,
buf0
,
dbuf0
);
if
(
stage_dst_channels
==
1
)
{
...
...
@@ -3032,12 +3032,12 @@ protected:
if
(
i
+
1
<
b
)
{
CopyFrom2Columns
(
sptr0
,
src_step
,
buf0
,
buf1
,
len
,
complex_elem_size
);
hal
::
dft
Run
(
contextB
,
buf1
,
dbuf1
);
hal
::
dft
1D
(
contextB
,
buf1
,
dbuf1
);
}
else
CopyColumn
(
sptr0
,
src_step
,
buf0
,
complex_elem_size
,
len
,
complex_elem_size
);
hal
::
dft
Run
(
contextB
,
buf0
,
dbuf0
);
hal
::
dft
1D
(
contextB
,
buf0
,
dbuf0
);
if
(
i
+
1
<
b
)
CopyTo2Columns
(
dbuf0
,
dbuf1
,
dptr0
,
dst_step
,
len
,
complex_elem_size
);
...
...
@@ -3223,9 +3223,9 @@ namespace hal {
//================== 1D ======================
void
dftInit
(
DftContext
&
context
,
int
len
,
int
count
,
int
depth
,
int
flags
,
bool
*
needBuffer
)
void
dftInit
1D
(
DftContext
&
context
,
int
len
,
int
count
,
int
depth
,
int
flags
,
bool
*
needBuffer
)
{
int
res
=
cv_hal_dftInit
(
&
context
.
impl
,
len
,
count
,
depth
,
flags
,
needBuffer
);
int
res
=
cv_hal_dftInit
1D
(
&
context
.
impl
,
len
,
count
,
depth
,
flags
,
needBuffer
);
if
(
res
==
CV_HAL_ERROR_OK
)
{
context
.
useReplacement
=
true
;
...
...
@@ -3242,11 +3242,11 @@ void dftInit(DftContext & context, int len, int count, int depth, int flags, boo
c
->
init
(
len
,
count
,
depth
,
flags
,
needBuffer
);
}
void
dft
Run
(
const
DftContext
&
context
,
const
void
*
src
,
void
*
dst
)
void
dft
1D
(
const
DftContext
&
context
,
const
void
*
src
,
void
*
dst
)
{
if
(
context
.
useReplacement
)
{
int
res
=
cv_hal_dft
Run
(
context
.
impl
,
src
,
dst
);
int
res
=
cv_hal_dft
1D
(
context
.
impl
,
src
,
dst
);
if
(
res
!=
CV_HAL_ERROR_OK
)
{
CV_Error
(
CV_StsNotImplemented
,
"Custom HAL implementation failed to call dftRun"
);
...
...
@@ -3257,11 +3257,11 @@ void dftRun(const DftContext & context, const void * src, void * dst)
c
->
run
(
src
,
dst
);
}
void
dftFree
(
DftContext
&
context
)
void
dftFree
1D
(
DftContext
&
context
)
{
if
(
context
.
useReplacement
)
{
int
res
=
cv_hal_dftFree
(
context
.
impl
);
int
res
=
cv_hal_dftFree
1D
(
context
.
impl
);
if
(
res
!=
CV_HAL_ERROR_OK
)
{
CV_Error
(
CV_StsNotImplemented
,
"Custom HAL implementation failed to call dftFree"
);
...
...
@@ -3304,12 +3304,12 @@ void dftInit2D(DftContext & c,
c
.
impl
=
(
void
*
)
d
;
}
void
dft
Run
2D
(
const
DftContext
&
c
,
void
dft2D
(
const
DftContext
&
c
,
const
void
*
src
,
int
src_step
,
void
*
dst
,
int
dst_step
)
{
if
(
c
.
useReplacement
)
{
int
res
=
cv_hal_dft
Run
2D
(
c
.
impl
,
(
uchar
*
)
src
,
src_step
,
(
uchar
*
)
dst
,
dst_step
);
int
res
=
cv_hal_dft2D
(
c
.
impl
,
(
uchar
*
)
src
,
src_step
,
(
uchar
*
)
dst
,
dst_step
);
if
(
res
!=
CV_HAL_ERROR_OK
)
{
CV_Error
(
CV_StsNotImplemented
,
"Custom HAL implementation failed to call dftRun2D"
);
...
...
@@ -3384,7 +3384,7 @@ void cv::dft( InputArray _src0, OutputArray _dst, int flags, int nonzero_rows )
f
|=
CV_HAL_DFT_IS_INPLACE
;
hal
::
DftContext
c
;
hal
::
dftInit2D
(
c
,
src
.
cols
,
src
.
rows
,
depth
,
src
.
channels
(),
dst
.
channels
(),
f
,
nonzero_rows
);
hal
::
dft
Run
2D
(
c
,
src
.
data
,
(
int
)
src
.
step
,
dst
.
data
,
(
int
)
dst
.
step
);
hal
::
dft2D
(
c
,
src
.
data
,
(
int
)
src
.
step
,
dst
.
data
,
(
int
)
dst
.
step
);
hal
::
dftFree2D
(
c
);
}
...
...
@@ -4198,9 +4198,9 @@ public:
namespace
hal
{
void
dctInit
(
DftContext
&
c
,
int
width
,
int
height
,
int
depth
,
int
flags
)
void
dctInit
2D
(
DftContext
&
c
,
int
width
,
int
height
,
int
depth
,
int
flags
)
{
int
res
=
cv_hal_dctInit
(
&
c
.
impl
,
width
,
height
,
depth
,
flags
);
int
res
=
cv_hal_dctInit
2D
(
&
c
.
impl
,
width
,
height
,
depth
,
flags
);
if
(
res
==
CV_HAL_ERROR_OK
)
{
c
.
useReplacement
=
true
;
...
...
@@ -4212,11 +4212,11 @@ void dctInit(DftContext & c, int width, int height, int depth, int flags)
c
.
impl
=
impl
;
}
void
dct
Run
(
const
DftContext
&
c
,
const
void
*
src
,
int
src_step
,
void
*
dst
,
int
dst_step
)
void
dct
2D
(
const
DftContext
&
c
,
const
void
*
src
,
int
src_step
,
void
*
dst
,
int
dst_step
)
{
if
(
c
.
useReplacement
)
{
int
res
=
cv_hal_dct
Run
(
c
.
impl
,
src
,
src_step
,
dst
,
dst_step
);
int
res
=
cv_hal_dct
2D
(
c
.
impl
,
src
,
src_step
,
dst
,
dst_step
);
if
(
res
!=
CV_HAL_ERROR_OK
)
{
CV_Error
(
CV_StsNotImplemented
,
"Custom HAL implementation failed to call dctRun"
);
...
...
@@ -4227,11 +4227,11 @@ void dctRun(const DftContext & c, const void * src, int src_step, void * dst, in
impl
->
run
((
uchar
*
)
src
,
src_step
,
(
uchar
*
)
dst
,
dst_step
);
}
void
dctFree
(
DftContext
&
c
)
void
dctFree
2D
(
DftContext
&
c
)
{
if
(
c
.
useReplacement
)
{
int
res
=
cv_hal_dctFree
(
c
.
impl
);
int
res
=
cv_hal_dctFree
2D
(
c
.
impl
);
if
(
res
!=
CV_HAL_ERROR_OK
)
{
CV_Error
(
CV_StsNotImplemented
,
"Custom HAL implementation failed to call dctFree"
);
...
...
@@ -4266,9 +4266,9 @@ void cv::dct( InputArray _src0, OutputArray _dst, int flags )
f
|=
CV_HAL_DFT_IS_CONTINUOUS
;
hal
::
DftContext
c
;
hal
::
dctInit
(
c
,
src
.
cols
,
src
.
rows
,
depth
,
f
);
hal
::
dct
Run
(
c
,
(
void
*
)
src
.
data
,
(
int
)
src
.
step
,
(
void
*
)
dst
.
data
,
(
int
)
dst
.
step
);
hal
::
dctFree
(
c
);
hal
::
dctInit
2D
(
c
,
src
.
cols
,
src
.
rows
,
depth
,
f
);
hal
::
dct
2D
(
c
,
(
void
*
)
src
.
data
,
(
int
)
src
.
step
,
(
void
*
)
dst
.
data
,
(
int
)
dst
.
step
);
hal
::
dctFree
2D
(
c
);
}
...
...
modules/core/src/hal_replacement.hpp
浏览文件 @
f40d7014
...
...
@@ -384,30 +384,30 @@ inline int hal_ni_merge64s(const int64 **src_data, int64 *dst_data, int len, int
# pragma warning( pop )
#endif
inline
int
hal_ni_dftInit
(
void
**
,
int
,
int
,
int
,
int
,
bool
*
)
{
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
}
inline
int
hal_ni_dft
Run
(
const
void
*
,
const
void
*
,
void
*
)
{
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
}
inline
int
hal_ni_dftFree
(
void
*
)
{
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
}
inline
int
hal_ni_dftInit
1D
(
void
**
,
int
,
int
,
int
,
int
,
bool
*
)
{
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
}
inline
int
hal_ni_dft
1D
(
const
void
*
,
const
void
*
,
void
*
)
{
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
}
inline
int
hal_ni_dftFree
1D
(
void
*
)
{
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
}
#define cv_hal_dftInit
hal_ni_dftInit
#define cv_hal_dft
Run hal_ni_dftRun
#define cv_hal_dftFree
hal_ni_dftFree
#define cv_hal_dftInit
1D hal_ni_dftInit1D
#define cv_hal_dft
1D hal_ni_dft1D
#define cv_hal_dftFree
1D hal_ni_dftFree1D
inline
int
hal_ni_dftInit2D
(
void
**
,
int
,
int
,
int
,
int
,
int
,
int
,
int
)
{
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
}
inline
int
hal_ni_dft
Run
2D
(
const
void
*
,
const
void
*
,
int
,
void
*
,
int
)
{
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
}
inline
int
hal_ni_dft2D
(
const
void
*
,
const
void
*
,
int
,
void
*
,
int
)
{
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
}
inline
int
hal_ni_dftFree2D
(
void
*
)
{
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
}
#define cv_hal_dftInit2D hal_ni_dftInit2D
#define cv_hal_dft
Run2D hal_ni_dftRun
2D
#define cv_hal_dft
2D hal_ni_dft
2D
#define cv_hal_dftFree2D hal_ni_dftFree2D
inline
int
hal_ni_dctInit
(
void
**
,
int
,
int
,
int
,
int
)
{
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
}
inline
int
hal_ni_dct
Run
(
const
void
*
,
const
void
*
,
int
,
void
*
,
int
)
{
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
}
inline
int
hal_ni_dctFree
(
void
*
)
{
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
}
inline
int
hal_ni_dctInit
2D
(
void
**
,
int
,
int
,
int
,
int
)
{
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
}
inline
int
hal_ni_dct
2D
(
const
void
*
,
const
void
*
,
int
,
void
*
,
int
)
{
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
}
inline
int
hal_ni_dctFree
2D
(
void
*
)
{
return
CV_HAL_ERROR_NOT_IMPLEMENTED
;
}
#define cv_hal_dctInit
hal_ni_dctInit
#define cv_hal_dct
Run hal_ni_dctRun
#define cv_hal_dctFree
hal_ni_dctFree
#define cv_hal_dctInit
2D hal_ni_dctInit2D
#define cv_hal_dct
2D hal_ni_dct2D
#define cv_hal_dctFree
2D hal_ni_dctFree2D
#include "custom_hal.hpp"
...
...
modules/imgproc/src/templmatch.cpp
浏览文件 @
f40d7014
...
...
@@ -726,7 +726,7 @@ void crossCorr( const Mat& img, const Mat& _templ, Mat& corr,
Mat
part
(
dst
,
Range
(
0
,
templ
.
rows
),
Range
(
templ
.
cols
,
dst
.
cols
));
part
=
Scalar
::
all
(
0
);
}
hal
::
dft
Run
2D
(
c
,
dst
.
data
,
(
int
)
dst
.
step
,
dst
.
data
,
(
int
)
dst
.
step
);
hal
::
dft2D
(
c
,
dst
.
data
,
(
int
)
dst
.
step
,
dst
.
data
,
(
int
)
dst
.
step
);
}
hal
::
dftFree2D
(
c
);
...
...
@@ -791,7 +791,7 @@ void crossCorr( const Mat& img, const Mat& _templ, Mat& corr,
x1
-
x0
,
dst
.
cols
-
dst1
.
cols
-
(
x1
-
x0
),
borderType
);
if
(
bsz
.
height
==
blocksize
.
height
)
hal
::
dft
Run
2D
(
cF
,
dftImg
.
data
,
(
int
)
dftImg
.
step
,
dftImg
.
data
,
(
int
)
dftImg
.
step
);
hal
::
dft2D
(
cF
,
dftImg
.
data
,
(
int
)
dftImg
.
step
,
dftImg
.
data
,
(
int
)
dftImg
.
step
);
else
dft
(
dftImg
,
dftImg
,
0
,
dsz
.
height
);
...
...
@@ -800,7 +800,7 @@ void crossCorr( const Mat& img, const Mat& _templ, Mat& corr,
mulSpectrums
(
dftImg
,
dftTempl1
,
dftImg
,
0
,
true
);
if
(
bsz
.
height
==
blocksize
.
height
)
hal
::
dft
Run
2D
(
cR
,
dftImg
.
data
,
(
int
)
dftImg
.
step
,
dftImg
.
data
,
(
int
)
dftImg
.
step
);
hal
::
dft2D
(
cR
,
dftImg
.
data
,
(
int
)
dftImg
.
step
,
dftImg
.
data
,
(
int
)
dftImg
.
step
);
else
dft
(
dftImg
,
dftImg
,
DFT_INVERSE
+
DFT_SCALE
,
bsz
.
height
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录