Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
d54aa307
Commit
d54aa307
authored
May 07, 2014
by
Alexander Alekhin
Committed by
OpenCV Buildbot
May 07, 2014
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2676 from ilya-lavrenov:ipp_gaussianblur
parents
0e1bf581
1ad69aba
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
20 deletions
+63
-20
private.hpp
modules/core/include/opencv2/core/private.hpp
+11
-0
perf_filters.cpp
modules/imgproc/perf/opencl/perf_filters.cpp
+2
-2
smooth.cpp
modules/imgproc/src/smooth.cpp
+48
-16
test_filters.cpp
modules/imgproc/test/ocl/test_filters.cpp
+2
-2
No files found.
modules/core/include/opencv2/core/private.hpp
View file @
d54aa307
...
@@ -243,6 +243,17 @@ static inline IppiBorderType ippiGetBorderType(int borderTypeNI)
...
@@ -243,6 +243,17 @@ static inline IppiBorderType ippiGetBorderType(int borderTypeNI)
borderTypeNI
==
cv
::
BORDER_REFLECT
?
ippBorderMirrorR
:
(
IppiBorderType
)
-
1
;
borderTypeNI
==
cv
::
BORDER_REFLECT
?
ippBorderMirrorR
:
(
IppiBorderType
)
-
1
;
}
}
static
inline
IppDataType
ippiGetDataType
(
int
depth
)
{
return
depth
==
CV_8U
?
ipp8u
:
depth
==
CV_8S
?
ipp8s
:
depth
==
CV_16U
?
ipp16u
:
depth
==
CV_16S
?
ipp16s
:
depth
==
CV_32S
?
ipp32s
:
depth
==
CV_32F
?
ipp32f
:
depth
==
CV_64F
?
ipp64f
:
(
IppDataType
)
-
1
;
}
#else
#else
# define IPP_VERSION_X100 0
# define IPP_VERSION_X100 0
#endif
#endif
...
...
modules/imgproc/perf/opencl/perf_filters.cpp
View file @
d54aa307
...
@@ -246,14 +246,14 @@ OCL_PERF_TEST_P(GaussianBlurFixture, GaussianBlur,
...
@@ -246,14 +246,14 @@ OCL_PERF_TEST_P(GaussianBlurFixture, GaussianBlur,
const
FilterParams
params
=
GetParam
();
const
FilterParams
params
=
GetParam
();
const
Size
srcSize
=
get
<
0
>
(
params
);
const
Size
srcSize
=
get
<
0
>
(
params
);
const
int
type
=
get
<
1
>
(
params
),
ksize
=
get
<
2
>
(
params
);
const
int
type
=
get
<
1
>
(
params
),
ksize
=
get
<
2
>
(
params
);
const
double
eps
=
CV_MAT_DEPTH
(
type
)
<=
CV_32S
?
1
+
DBL_EPSILON
:
3e-4
;
const
double
eps
=
CV_MAT_DEPTH
(
type
)
<=
CV_32S
?
2
+
DBL_EPSILON
:
3e-4
;
checkDeviceMaxMemoryAllocSize
(
srcSize
,
type
);
checkDeviceMaxMemoryAllocSize
(
srcSize
,
type
);
UMat
src
(
srcSize
,
type
),
dst
(
srcSize
,
type
);
UMat
src
(
srcSize
,
type
),
dst
(
srcSize
,
type
);
declare
.
in
(
src
,
WARMUP_RNG
).
out
(
dst
);
declare
.
in
(
src
,
WARMUP_RNG
).
out
(
dst
);
OCL_TEST_CYCLE
()
cv
::
GaussianBlur
(
src
,
dst
,
Size
(
ksize
,
ksize
),
0
);
OCL_TEST_CYCLE
()
cv
::
GaussianBlur
(
src
,
dst
,
Size
(
ksize
,
ksize
),
1
,
1
,
cv
::
BORDER_CONSTANT
);
SANITY_CHECK
(
dst
,
eps
);
SANITY_CHECK
(
dst
,
eps
);
}
}
...
...
modules/imgproc/src/smooth.cpp
View file @
d54aa307
...
@@ -1174,28 +1174,60 @@ void cv::GaussianBlur( InputArray _src, OutputArray _dst, Size ksize,
...
@@ -1174,28 +1174,60 @@ void cv::GaussianBlur( InputArray _src, OutputArray _dst, Size ksize,
return
;
return
;
#endif
#endif
#if IPP_VERSION_X100 >= 801
#if IPP_VERSION_X100 >= 801 && 0 // these functions are slower in IPP 8.1
if
(
type
==
CV_32FC1
&&
sigma1
==
sigma2
&&
ksize
.
width
==
ksize
.
height
&&
sigma1
!=
0.0
)
int
depth
=
CV_MAT_DEPTH
(
type
),
cn
=
CV_MAT_CN
(
type
);
if
((
depth
==
CV_8U
||
depth
==
CV_16U
||
depth
==
CV_16S
||
depth
==
CV_32F
)
&&
(
cn
==
1
||
cn
==
3
)
&&
sigma1
==
sigma2
&&
ksize
.
width
==
ksize
.
height
&&
sigma1
!=
0.0
)
{
{
IppiBorderType
ippBorder
=
ippiGetBorderType
(
borderType
);
IppiBorderType
ippBorder
=
ippiGetBorderType
(
borderType
);
if
(
(
ippBorderConst
==
ippBorder
)
||
(
ippBorderRepl
==
ippBorder
)
)
if
(
ippBorderConst
==
ippBorder
||
ippBorderRepl
==
ippBorder
)
{
{
Mat
src
=
_src
.
getMat
(),
dst
=
_dst
.
getMat
();
Mat
src
=
_src
.
getMat
(),
dst
=
_dst
.
getMat
();
IppiSize
roi
=
{
src
.
cols
,
src
.
rows
};
IppiSize
roiSize
=
{
src
.
cols
,
src
.
rows
};
int
specSize
=
0
,
bufferSize
=
0
;
IppDataType
dataType
=
ippiGetDataType
(
depth
);
if
(
0
<=
ippiFilterGaussianGetBufferSize
(
roi
,
(
Ipp32u
)
ksize
.
width
,
ipp32f
,
1
,
&
specSize
,
&
bufferSize
))
Ipp32s
specSize
=
0
,
bufferSize
=
0
;
if
(
ippiFilterGaussianGetBufferSize
(
roiSize
,
(
Ipp32u
)
ksize
.
width
,
dataType
,
cn
,
&
specSize
,
&
bufferSize
)
>=
0
)
{
{
IppFilterGaussianSpec
*
pSpec
=
(
IppFilterGaussianSpec
*
)
ippMalloc
(
specSize
);
IppFilterGaussianSpec
*
pSpec
=
(
IppFilterGaussianSpec
*
)
ippMalloc
(
specSize
);
Ipp8u
*
pBuffer
=
(
Ipp8u
*
)
ippMalloc
(
bufferSize
);
Ipp8u
*
pBuffer
=
(
Ipp8u
*
)
ippMalloc
(
bufferSize
);
if
(
0
<=
ippiFilterGaussianInit
(
roi
,
(
Ipp32u
)
ksize
.
width
,
(
Ipp32f
)
sigma1
,
ippBorder
,
ipp32f
,
1
,
pSpec
,
pBuffer
))
if
(
ippiFilterGaussianInit
(
roiSize
,
(
Ipp32u
)
ksize
.
width
,
(
Ipp32f
)
sigma1
,
ippBorder
,
dataType
,
1
,
pSpec
,
pBuffer
)
>=
0
)
{
{
IppStatus
sts
=
ippiFilterGaussianBorder_32f_C1R
(
(
const
Ipp32f
*
)
src
.
data
,
(
int
)
src
.
step
,
#define IPP_FILTER_GAUSS(ippfavor, ippcn) \
(
Ipp32f
*
)
dst
.
data
,
(
int
)
dst
.
step
,
do \
roi
,
0.0
,
pSpec
,
pBuffer
);
{ \
ippFree
(
pBuffer
);
typedef Ipp##ippfavor ippType; \
ippFree
(
pSpec
);
ippType borderValues[] = { 0, 0, 0 }; \
if
(
0
<=
sts
)
IppStatus status = ippcn == 1 ? \
return
;
ippiFilterGaussianBorder_##ippfavor##_C1R((const ippType *)src.data, (int)src.step, \
(ippType *)dst.data, (int)dst.step, roiSize, borderValues[0], pSpec, pBuffer) : \
ippiFilterGaussianBorder_##ippfavor##_C3R((const ippType *)src.data, (int)src.step, \
(ippType *)dst.data, (int)dst.step, roiSize, borderValues, pSpec, pBuffer); \
ippFree(pBuffer); \
ippFree(pSpec); \
if (status >= 0) \
return; \
} while ((void)0, 0)
if
(
type
==
CV_8UC1
)
IPP_FILTER_GAUSS
(
8u
,
1
);
else
if
(
type
==
CV_8UC3
)
IPP_FILTER_GAUSS
(
8u
,
3
);
else
if
(
type
==
CV_16UC1
)
IPP_FILTER_GAUSS
(
16u
,
1
);
else
if
(
type
==
CV_16UC3
)
IPP_FILTER_GAUSS
(
16u
,
3
);
else
if
(
type
==
CV_16SC1
)
IPP_FILTER_GAUSS
(
16
s
,
1
);
else
if
(
type
==
CV_16SC3
)
IPP_FILTER_GAUSS
(
16
s
,
3
);
else
if
(
type
==
CV_32FC1
)
IPP_FILTER_GAUSS
(
32
f
,
1
);
else
if
(
type
==
CV_32FC3
)
IPP_FILTER_GAUSS
(
32
f
,
3
);
#undef IPP_FILTER_GAUSS
}
}
}
}
setIppErrorStatus
();
setIppErrorStatus
();
...
...
modules/imgproc/test/ocl/test_filters.cpp
View file @
d54aa307
...
@@ -215,12 +215,12 @@ typedef FilterTestBase GaussianBlurTest;
...
@@ -215,12 +215,12 @@ typedef FilterTestBase GaussianBlurTest;
OCL_TEST_P
(
GaussianBlurTest
,
Mat
)
OCL_TEST_P
(
GaussianBlurTest
,
Mat
)
{
{
for
(
int
j
=
0
;
j
<
test_loop_times
;
j
++
)
for
(
int
j
=
0
;
j
<
test_loop_times
+
1
;
j
++
)
{
{
random_roi
();
random_roi
();
double
sigma1
=
rng
.
uniform
(
0.1
,
1.0
);
double
sigma1
=
rng
.
uniform
(
0.1
,
1.0
);
double
sigma2
=
rng
.
uniform
(
0.1
,
1.0
);
double
sigma2
=
j
%
2
==
0
?
sigma1
:
rng
.
uniform
(
0.1
,
1.0
);
OCL_OFF
(
cv
::
GaussianBlur
(
src_roi
,
dst_roi
,
Size
(
ksize
,
ksize
),
sigma1
,
sigma2
,
borderType
));
OCL_OFF
(
cv
::
GaussianBlur
(
src_roi
,
dst_roi
,
Size
(
ksize
,
ksize
),
sigma1
,
sigma2
,
borderType
));
OCL_ON
(
cv
::
GaussianBlur
(
usrc_roi
,
udst_roi
,
Size
(
ksize
,
ksize
),
sigma1
,
sigma2
,
borderType
));
OCL_ON
(
cv
::
GaussianBlur
(
usrc_roi
,
udst_roi
,
Size
(
ksize
,
ksize
),
sigma1
,
sigma2
,
borderType
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment