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
55bbca2d
Commit
55bbca2d
authored
Apr 28, 2014
by
Ilya Lavrenov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added more types to cv::GaussianBlur
parent
32b25de5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
17 deletions
+60
-17
private.hpp
modules/core/include/opencv2/core/private.hpp
+11
-0
smooth.cpp
modules/imgproc/src/smooth.cpp
+47
-15
test_filters.cpp
modules/imgproc/test/ocl/test_filters.cpp
+2
-2
No files found.
modules/core/include/opencv2/core/private.hpp
View file @
55bbca2d
...
@@ -241,6 +241,17 @@ static inline IppiBorderType ippiGetBorderType(int borderTypeNI)
...
@@ -241,6 +241,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/src/smooth.cpp
View file @
55bbca2d
...
@@ -1175,27 +1175,59 @@ void cv::GaussianBlur( InputArray _src, OutputArray _dst, Size ksize,
...
@@ -1175,27 +1175,59 @@ void cv::GaussianBlur( InputArray _src, OutputArray _dst, Size ksize,
#endif
#endif
#if IPP_VERSION_X100 >= 801
#if IPP_VERSION_X100 >= 801
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 @
55bbca2d
...
@@ -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