Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
101607a7
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,发现更多精彩内容 >>
提交
101607a7
编写于
6月 24, 2015
作者:
P
Pavel Vlasov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Imgproc_Hist_MinMaxVal.accuracy fix;
Some code style corrections;
上级
a5a21019
变更
8
展开全部
隐藏空白更改
内联
并排
Showing
8 changed file
with
543 addition
and
593 deletion
+543
-593
modules/core/src/convert.cpp
modules/core/src/convert.cpp
+45
-61
modules/core/src/copy.cpp
modules/core/src/copy.cpp
+7
-12
modules/core/src/matrix.cpp
modules/core/src/matrix.cpp
+3
-8
modules/core/src/precomp.hpp
modules/core/src/precomp.hpp
+0
-1
modules/core/src/stat.cpp
modules/core/src/stat.cpp
+473
-497
modules/imgproc/src/imgwarp.cpp
modules/imgproc/src/imgwarp.cpp
+1
-1
modules/imgproc/src/morph.cpp
modules/imgproc/src/morph.cpp
+9
-7
modules/imgproc/src/thresh.cpp
modules/imgproc/src/thresh.cpp
+5
-6
未找到文件。
modules/core/src/convert.cpp
浏览文件 @
101607a7
...
...
@@ -5194,10 +5194,7 @@ dtype* dst, size_t dstep, Size size, double* scale) \
static void cvt##suffix( const stype* src, size_t sstep, const uchar*, size_t, \
dtype* dst, size_t dstep, Size size, double*) \
{ \
if (src && dst)\
{\
CV_IPP_RUN(true, ippiConvert_##ippFavor(src, (int)sstep, dst, (int)dstep, ippiSize(size.width, size.height)) >= 0)\
}\
CV_IPP_RUN(src && dst, ippiConvert_##ippFavor(src, (int)sstep, dst, (int)dstep, ippiSize(size.width, size.height)) >= 0)\
cvt_(src, sstep, dst, dstep, size); \
}
...
...
@@ -5205,10 +5202,7 @@ static void cvt##suffix( const stype* src, size_t sstep, const uchar*, size_t, \
static void cvt##suffix( const stype* src, size_t sstep, const uchar*, size_t, \
dtype* dst, size_t dstep, Size size, double*) \
{ \
if (src && dst)\
{\
CV_IPP_RUN(true, ippiConvert_##ippFavor(src, (int)sstep, dst, (int)dstep, ippiSize(size.width, size.height), ippRndFinancial, 0) >= 0)\
}\
CV_IPP_RUN(src && dst, ippiConvert_##ippFavor(src, (int)sstep, dst, (int)dstep, ippiSize(size.width, size.height), ippRndFinancial, 0) >= 0)\
cvt_(src, sstep, dst, dstep, size); \
}
#else
...
...
@@ -5844,6 +5838,46 @@ private:
IppLUTParallelBody_LUTCN
&
operator
=
(
const
IppLUTParallelBody_LUTCN
&
);
};
}
// namespace ipp
static
bool
ipp_lut
(
Mat
&
src
,
Mat
&
lut
,
Mat
&
dst
)
{
int
cn
=
src
.
channels
();
int
lutcn
=
lut
.
channels
();
if
(
src
.
dims
>
2
)
return
false
;
bool
ok
=
false
;
Ptr
<
ParallelLoopBody
>
body
;
size_t
elemSize1
=
CV_ELEM_SIZE1
(
dst
.
depth
());
#if 0 // there are no performance benefits (PR #2653)
if (lutcn == 1)
{
ParallelLoopBody* p = new ipp::IppLUTParallelBody_LUTC1(src, lut, dst, &ok);
body.reset(p);
}
else
#endif
if
((
lutcn
==
3
||
lutcn
==
4
)
&&
elemSize1
==
1
)
{
ParallelLoopBody
*
p
=
new
ipp
::
IppLUTParallelBody_LUTCN
(
src
,
lut
,
dst
,
&
ok
);
body
.
reset
(
p
);
}
if
(
body
!=
NULL
&&
ok
)
{
Range
all
(
0
,
dst
.
rows
);
if
(
dst
.
total
()
>>
18
)
parallel_for_
(
all
,
*
body
,
(
double
)
std
::
max
((
size_t
)
1
,
dst
.
total
()
>>
16
));
else
(
*
body
)(
all
);
if
(
ok
)
return
true
;
}
return
false
;
}
#endif // IPP
class
LUTParallelBody
:
public
ParallelLoopBody
...
...
@@ -5891,55 +5925,6 @@ private:
}
namespace
cv
{
#if defined(HAVE_IPP)
static
bool
ipp_lut
(
InputArray
_src
,
InputArray
_lut
,
OutputArray
_dst
)
{
int
cn
=
_src
.
channels
();
int
lutcn
=
_lut
.
channels
();
Mat
src
=
_src
.
getMat
(),
lut
=
_lut
.
getMat
();
_dst
.
create
(
src
.
dims
,
src
.
size
,
CV_MAKETYPE
(
_lut
.
depth
(),
cn
));
Mat
dst
=
_dst
.
getMat
();
if
(
_src
.
dims
()
<=
2
)
{
bool
ok
=
false
;
Ptr
<
ParallelLoopBody
>
body
;
size_t
elemSize1
=
CV_ELEM_SIZE1
(
dst
.
depth
());
#if 0 // there are no performance benefits (PR #2653)
if (lutcn == 1)
{
ParallelLoopBody* p = new ipp::IppLUTParallelBody_LUTC1(src, lut, dst, &ok);
body.reset(p);
}
else
#endif
if
((
lutcn
==
3
||
lutcn
==
4
)
&&
elemSize1
==
1
)
{
ParallelLoopBody
*
p
=
new
ipp
::
IppLUTParallelBody_LUTCN
(
src
,
lut
,
dst
,
&
ok
);
body
.
reset
(
p
);
}
if
(
body
!=
NULL
&&
ok
)
{
Range
all
(
0
,
dst
.
rows
);
if
(
dst
.
total
()
>>
18
)
parallel_for_
(
all
,
*
body
,
(
double
)
std
::
max
((
size_t
)
1
,
dst
.
total
()
>>
16
));
else
(
*
body
)(
all
);
if
(
ok
)
return
true
;
}
}
return
false
;
}
#endif
}
void
cv
::
LUT
(
InputArray
_src
,
InputArray
_lut
,
OutputArray
_dst
)
{
int
cn
=
_src
.
channels
(),
depth
=
_src
.
depth
();
...
...
@@ -5952,18 +5937,17 @@ void cv::LUT( InputArray _src, InputArray _lut, OutputArray _dst )
CV_OCL_RUN
(
_dst
.
isUMat
()
&&
_src
.
dims
()
<=
2
,
ocl_LUT
(
_src
,
_lut
,
_dst
))
CV_IPP_RUN
((
_src
.
dims
()
<=
2
&&
((
lutcn
==
1
||
lutcn
==
3
||
lutcn
==
4
)
&&
CV_ELEM_SIZE1
(
_dst
.
depth
())
==
1
)
&&
lutcn
!=
1
),
//lutcn == 1 ipp implementation switched off
ipp_lut
(
_src
,
_lut
,
_dst
));
Mat
src
=
_src
.
getMat
(),
lut
=
_lut
.
getMat
();
_dst
.
create
(
src
.
dims
,
src
.
size
,
CV_MAKETYPE
(
_lut
.
depth
(),
cn
));
Mat
dst
=
_dst
.
getMat
();
CV_IPP_RUN
(
_src
.
dims
()
<=
2
,
ipp_lut
(
src
,
lut
,
dst
));
if
(
_src
.
dims
()
<=
2
)
{
bool
ok
=
false
;
Ptr
<
ParallelLoopBody
>
body
;
if
(
body
==
NULL
||
ok
==
false
)
{
ok
=
false
;
...
...
modules/core/src/copy.cpp
浏览文件 @
101607a7
...
...
@@ -424,9 +424,8 @@ Mat& Mat::operator = (const Scalar& s)
}
#if defined HAVE_IPP
static
bool
ipp_Mat_setTo
(
Mat
*
src
,
InputArray
_value
,
InputArray
_
mask
)
static
bool
ipp_Mat_setTo
(
Mat
*
src
,
Mat
&
value
,
Mat
&
mask
)
{
Mat
value
=
_value
.
getMat
(),
mask
=
_mask
.
getMat
();
int
cn
=
src
->
channels
(),
depth0
=
src
->
depth
();
if
(
!
mask
.
empty
()
&&
(
src
->
dims
<=
2
||
(
src
->
isContinuous
()
&&
mask
.
isContinuous
()))
&&
...
...
@@ -515,8 +514,7 @@ Mat& Mat::setTo(InputArray _value, InputArray _mask)
CV_Assert
(
checkScalar
(
value
,
type
(),
_value
.
kind
(),
_InputArray
::
MAT
));
CV_Assert
(
mask
.
empty
()
||
(
mask
.
type
()
==
CV_8U
&&
size
==
mask
.
size
)
);
CV_IPP_RUN
(
true
,
ipp_Mat_setTo
((
cv
::
Mat
*
)
this
,
_value
,
_mask
),
*
this
)
CV_IPP_RUN
(
true
,
ipp_Mat_setTo
((
cv
::
Mat
*
)
this
,
value
,
mask
),
*
this
)
size_t
esz
=
elemSize
();
BinaryFunc
copymask
=
getCopyMaskFunc
(
esz
);
...
...
@@ -691,13 +689,10 @@ static bool ocl_flip(InputArray _src, OutputArray _dst, int flipCode )
#endif
#if defined HAVE_IPP
static
bool
ipp_flip
(
InputArray
_src
,
OutputArray
_
dst
,
int
flip_mode
)
static
bool
ipp_flip
(
Mat
&
src
,
Mat
&
dst
,
int
flip_mode
)
{
Size
size
=
_src
.
size
();
Mat
src
=
_src
.
getMat
();
Size
size
=
src
.
size
();
int
type
=
src
.
type
();
_dst
.
create
(
size
,
type
);
Mat
dst
=
_dst
.
getMat
();
typedef
IppStatus
(
CV_STDCALL
*
ippiMirror
)(
const
void
*
pSrc
,
int
srcStep
,
void
*
pDst
,
int
dstStep
,
IppiSize
roiSize
,
IppiAxis
flip
);
typedef
IppStatus
(
CV_STDCALL
*
ippiMirrorI
)(
const
void
*
pSrcDst
,
int
srcDstStep
,
IppiSize
roiSize
,
IppiAxis
flip
);
...
...
@@ -786,13 +781,13 @@ void flip( InputArray _src, OutputArray _dst, int flip_mode )
CV_OCL_RUN
(
_dst
.
isUMat
(),
ocl_flip
(
_src
,
_dst
,
flip_mode
))
CV_IPP_RUN
(
true
,
ipp_flip
(
_src
,
_dst
,
flip_mode
));
Mat
src
=
_src
.
getMat
();
int
type
=
src
.
type
();
_dst
.
create
(
size
,
type
);
Mat
dst
=
_dst
.
getMat
();
CV_IPP_RUN
(
true
,
ipp_flip
(
src
,
dst
,
flip_mode
));
size_t
esz
=
CV_ELEM_SIZE
(
type
);
if
(
flip_mode
<=
0
)
...
...
modules/core/src/matrix.cpp
浏览文件 @
101607a7
...
...
@@ -3088,19 +3088,15 @@ static bool ocl_transpose( InputArray _src, OutputArray _dst )
#endif
#ifdef HAVE_IPP
static
bool
ipp_transpose
(
InputArray
_src
,
OutputArray
_
dst
)
static
bool
ipp_transpose
(
Mat
&
src
,
Mat
&
dst
)
{
int
type
=
_
src
.
type
();
int
type
=
src
.
type
();
typedef
IppStatus
(
CV_STDCALL
*
ippiTranspose
)(
const
void
*
pSrc
,
int
srcStep
,
void
*
pDst
,
int
dstStep
,
IppiSize
roiSize
);
typedef
IppStatus
(
CV_STDCALL
*
ippiTransposeI
)(
const
void
*
pSrcDst
,
int
srcDstStep
,
IppiSize
roiSize
);
ippiTranspose
ippFunc
=
0
;
ippiTransposeI
ippFuncI
=
0
;
Mat
dst
=
_dst
.
getMat
();
Mat
src
=
_src
.
getMat
();
if
(
dst
.
data
==
src
.
data
&&
dst
.
cols
==
dst
.
rows
)
{
CV_SUPPRESS_DEPRECATED_START
...
...
@@ -3186,8 +3182,7 @@ void cv::transpose( InputArray _src, OutputArray _dst )
return
;
}
CV_IPP_RUN
(
true
,
ipp_transpose
(
_src
,
_dst
))
CV_IPP_RUN
(
true
,
ipp_transpose
(
src
,
dst
))
if
(
dst
.
data
==
src
.
data
)
{
...
...
modules/core/src/precomp.hpp
浏览文件 @
101607a7
...
...
@@ -72,7 +72,6 @@
#define GET_OPTIMIZED(func) (func)
#endif
namespace
cv
{
...
...
modules/core/src/stat.cpp
浏览文件 @
101607a7
此差异已折叠。
点击以展开。
modules/imgproc/src/imgwarp.cpp
浏览文件 @
101607a7
...
...
@@ -3120,6 +3120,7 @@ static bool ipp_resize_mt( Mat src, Mat dst,
//////////////////////////////////////////////////////////////////////////////////////////
void
cv
::
resize
(
InputArray
_src
,
OutputArray
_dst
,
Size
dsize
,
double
inv_scale_x
,
double
inv_scale_y
,
int
interpolation
)
{
...
...
@@ -3482,7 +3483,6 @@ void cv::resize( InputArray _src, OutputArray _dst, Size dsize,
}
/****************************************************************************************\
* General warping (affine, perspective, remap) *
\****************************************************************************************/
...
...
modules/imgproc/src/morph.cpp
浏览文件 @
101607a7
...
...
@@ -1136,10 +1136,11 @@ private:
Scalar
borderValue
;
};
#if
IPP_VERSION_X100 >= 801
static
bool
IPP
MorphReplicate
(
int
op
,
const
Mat
&
src
,
Mat
&
dst
,
const
Mat
&
kernel
,
#if
def HAVE_IPP
static
bool
ipp_
MorphReplicate
(
int
op
,
const
Mat
&
src
,
Mat
&
dst
,
const
Mat
&
kernel
,
const
Size
&
ksize
,
const
Point
&
anchor
,
bool
rectKernel
)
{
#if IPP_VERSION_X100 >= 801
int
type
=
src
.
type
();
const
Mat
*
_src
=
&
src
;
Mat
temp
;
...
...
@@ -1257,10 +1258,13 @@ static bool IPPMorphReplicate(int op, const Mat &src, Mat &dst, const Mat &kerne
}
#undef IPP_MORPH_CASE
}
#else
CV_UNUSED
(
op
);
CV_UNUSED
(
src
);
CV_UNUSED
(
dst
);
CV_UNUSED
(
kernel
);
CV_UNUSED
(
ksize
);
CV_UNUSED
(
anchor
);
CV_UNUSED
(
rectKernel
);
#endif
return
false
;
}
static
bool
IPP
MorphOp
(
int
op
,
InputArray
_src
,
OutputArray
_dst
,
static
bool
ipp_
MorphOp
(
int
op
,
InputArray
_src
,
OutputArray
_dst
,
const
Mat
&
_kernel
,
Point
anchor
,
int
iterations
,
int
borderType
,
const
Scalar
&
borderValue
)
{
...
...
@@ -1331,7 +1335,7 @@ static bool IPPMorphOp(int op, InputArray _src, OutputArray _dst,
if
(
iterations
>
1
)
return
false
;
return
IPP
MorphReplicate
(
op
,
src
,
dst
,
kernel
,
ksize
,
anchor
,
rectKernel
);
return
ipp_
MorphReplicate
(
op
,
src
,
dst
,
kernel
,
ksize
,
anchor
,
rectKernel
);
}
#endif
...
...
@@ -1711,9 +1715,7 @@ static void morphOp( int op, InputArray _src, OutputArray _dst,
iterations
=
1
;
}
CV_IPP_RUN
(
IPP_VERSION_X100
>=
801
,
IPPMorphOp
(
op
,
_src
,
_dst
,
kernel
,
anchor
,
iterations
,
borderType
,
borderValue
))
CV_IPP_RUN
(
IPP_VERSION_X100
>=
801
,
ipp_MorphOp
(
op
,
_src
,
_dst
,
kernel
,
anchor
,
iterations
,
borderType
,
borderValue
))
Mat
src
=
_src
.
getMat
();
_dst
.
create
(
src
.
size
(),
src
.
type
()
);
...
...
modules/imgproc/src/thresh.cpp
浏览文件 @
101607a7
...
...
@@ -907,22 +907,22 @@ thresh_32f( const Mat& _src, Mat& _dst, float thresh, float maxval, int type )
#ifdef HAVE_IPP
static
bool
ipp_getThreshVal_Otsu_8u
(
const
unsigned
char
*
_src
,
int
step
,
Size
size
,
unsigned
char
&
thresh
)
{
#if IPP_VERSION_X100 >= 801 && !HAVE_ICV
int
ippStatus
=
-
1
;
#if IPP_VERSION_X100 >= 801 && !defined(HAVE_IPP_ICV_ONLY)
IppiSize
srcSize
=
{
size
.
width
,
size
.
height
};
CV_SUPPRESS_DEPRECATED_START
ippStatus
=
ippiComputeThreshold_Otsu_8u_C1R
(
_src
,
step
,
srcSize
,
&
thresh
);
CV_SUPPRESS_DEPRECATED_END
if
(
ippStatus
>=
0
)
return
true
;
#else
CV_UNUSED
(
_src
);
CV_UNUSED
(
step
);
CV_UNUSED
(
size
);
CV_UNUSED
(
thresh
);
#endif
if
(
ippStatus
>=
0
)
return
true
;
return
false
;
}
#endif
static
double
getThreshVal_Otsu_8u
(
const
Mat
&
_src
)
{
...
...
@@ -937,9 +937,8 @@ getThreshVal_Otsu_8u( const Mat& _src )
#ifdef HAVE_IPP
unsigned
char
thresh
;
CV_IPP_RUN
(
IPP_VERSION_X100
>=
801
&&
!
HAVE_ICV
,
ipp_getThreshVal_Otsu_8u
(
_src
.
ptr
(),
step
,
size
,
thresh
),
thresh
);
#endif
CV_IPP_RUN
(
true
,
ipp_getThreshVal_Otsu_8u
(
_src
.
ptr
(),
step
,
size
,
thresh
),
thresh
);
const
int
N
=
256
;
int
i
,
j
,
h
[
N
]
=
{
0
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录