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
40b2dfae
Commit
40b2dfae
authored
Oct 13, 2015
by
Pavel Vlasov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for filter2D and IPP < 900
parent
89eee6ca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
6 deletions
+26
-6
filter.cpp
modules/imgproc/src/filter.cpp
+26
-6
No files found.
modules/imgproc/src/filter.cpp
View file @
40b2dfae
...
...
@@ -4579,7 +4579,11 @@ static bool ipp_filter2D( InputArray _src, OutputArray _dst, int ddepth,
int
stype
=
src
.
type
(),
sdepth
=
CV_MAT_DEPTH
(
stype
),
cn
=
CV_MAT_CN
(
stype
),
ktype
=
kernel
.
type
(),
kdepth
=
CV_MAT_DEPTH
(
ktype
);
bool
isolated
=
(
borderType
&
BORDER_ISOLATED
)
!=
0
;
#if IPP_VERSION_X100 >= 900
Point
ippAnchor
((
kernel
.
cols
-
1
)
/
2
,
(
kernel
.
rows
-
1
)
/
2
);
#else
Point
ippAnchor
(
kernel
.
cols
>>
1
,
kernel
.
rows
>>
1
);
#endif
int
borderTypeNI
=
borderType
&
~
BORDER_ISOLATED
;
IppiBorderType
ippBorderType
=
ippiGetBorderType
(
borderTypeNI
);
...
...
@@ -4618,13 +4622,21 @@ static bool ipp_filter2D( InputArray _src, OutputArray _dst, int ddepth,
{
Ipp32f
*
pKerBuffer
=
(
Ipp32f
*
)
kernel
.
data
;
IppAutoBuffer
<
Ipp32f
>
kerTmp
;
if
(
kernel
.
step
!=
kernel
.
cols
)
int
kerStep
=
sizeof
(
Ipp32f
)
*
kernelSize
.
width
;
#if IPP_VERSION_X100 >= 900
if
(
kernel
.
step
!=
kerStep
)
{
kerTmp
.
Alloc
(
sizeof
(
Ipp32f
)
*
kernelSize
.
width
*
kernelSize
.
height
);
if
(
ippiCopy_32f_C1R
((
Ipp32f
*
)
kernel
.
data
,
(
int
)
kernel
.
step
,
kerTmp
,
ker
nelSize
.
width
*
sizeof
(
Ipp32f
)
,
kernelSize
)
<
0
)
kerTmp
.
Alloc
(
kerStep
*
kernelSize
.
height
);
if
(
ippiCopy_32f_C1R
((
Ipp32f
*
)
kernel
.
data
,
(
int
)
kernel
.
step
,
kerTmp
,
ker
Step
,
kernelSize
)
<
0
)
return
false
;
pKerBuffer
=
kerTmp
;
}
#else
kerTmp
.
Alloc
(
kerStep
*
kernelSize
.
height
);
Mat
kerFlip
(
Size
(
kernelSize
.
width
,
kernelSize
.
height
),
CV_32FC1
,
kerTmp
,
kerStep
);
flip
(
kernel
,
kerFlip
,
-
1
);
pKerBuffer
=
kerTmp
;
#endif
if
((
status
=
ippiFilterBorderInit_32f
(
pKerBuffer
,
kernelSize
,
dataType
,
cn
,
ippRndFinancial
,
spec
))
>=
0
)
...
...
@@ -4637,13 +4649,21 @@ static bool ipp_filter2D( InputArray _src, OutputArray _dst, int ddepth,
{
Ipp16s
*
pKerBuffer
=
(
Ipp16s
*
)
kernel
.
data
;
IppAutoBuffer
<
Ipp16s
>
kerTmp
;
if
(
kernel
.
step
!=
kernel
.
cols
)
int
kerStep
=
sizeof
(
Ipp16s
)
*
kernelSize
.
width
;
#if IPP_VERSION_X100 >= 900
if
(
kernel
.
step
!=
kerStep
)
{
kerTmp
.
Alloc
(
sizeof
(
Ipp16s
)
*
kernelSize
.
width
*
kernelSize
.
height
);
if
(
ippiCopy_16s_C1R
((
Ipp16s
*
)
kernel
.
data
,
(
int
)
kernel
.
step
,
kerTmp
,
ker
nelSize
.
width
*
sizeof
(
Ipp16s
)
,
kernelSize
)
<
0
)
kerTmp
.
Alloc
(
kerStep
*
kernelSize
.
height
);
if
(
ippiCopy_16s_C1R
((
Ipp16s
*
)
kernel
.
data
,
(
int
)
kernel
.
step
,
kerTmp
,
ker
Step
,
kernelSize
)
<
0
)
return
false
;
pKerBuffer
=
kerTmp
;
}
#else
kerTmp
.
Alloc
(
kerStep
*
kernelSize
.
height
);
Mat
kerFlip
(
Size
(
kernelSize
.
width
,
kernelSize
.
height
),
CV_16SC1
,
kerTmp
,
kerStep
);
flip
(
kernel
,
kerFlip
,
-
1
);
pKerBuffer
=
kerTmp
;
#endif
if
((
status
=
ippiFilterBorderInit_16s
(
pKerBuffer
,
kernelSize
,
0
,
dataType
,
cn
,
ippRndFinancial
,
spec
))
>=
0
)
...
...
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