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
3e173b70
Commit
3e173b70
authored
Apr 12, 2014
by
Ilya Lavrenov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cv::Laplacian
parent
82c67abb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
0 deletions
+61
-0
deriv.cpp
modules/imgproc/src/deriv.cpp
+61
-0
No files found.
modules/imgproc/src/deriv.cpp
View file @
3e173b70
...
...
@@ -483,6 +483,67 @@ void cv::Scharr( InputArray _src, OutputArray _dst, int ddepth, int dx, int dy,
int
dtype
=
CV_MAKETYPE
(
ddepth
,
cn
);
_dst
.
create
(
_src
.
size
(),
dtype
);
#if defined HAVE_IPP && !defined HAVE_IPP_ICV_ONLY
if
((
ksize
==
3
||
ksize
==
5
)
&&
((
borderType
&
BORDER_ISOLATED
)
==
0
||
!
_src
.
isSubmatrix
())
&&
((
stype
==
CV_8UC1
&&
ddepth
==
CV_16S
)
||
(
ddepth
==
CV_32F
&&
stype
==
CV_32FC1
)))
{
int
iscale
=
saturate_cast
<
int
>
(
scale
),
idelta
=
saturate_cast
<
int
>
(
delta
);
bool
floatScale
=
std
::
fabs
(
scale
-
iscale
)
>
DBL_EPSILON
,
needScale
=
iscale
!=
1
;
bool
floatDelta
=
std
::
fabs
(
delta
-
idelta
)
>
DBL_EPSILON
,
needDelta
=
delta
!=
0
;
int
borderTypeNI
=
borderType
&
~
BORDER_ISOLATED
;
Mat
src
=
_src
.
getMat
(),
dst
=
_dst
.
getMat
();
if
(
src
.
data
!=
dst
.
data
)
{
Ipp32s
bufsize
;
IppStatus
status
=
(
IppStatus
)
-
1
;
IppiSize
roisize
=
{
src
.
cols
,
src
.
rows
};
IppiMaskSize
masksize
=
ksize
==
3
?
ippMskSize3x3
:
ippMskSize5x5
;
IppiBorderType
borderTypeIpp
=
borderTypeNI
==
BORDER_CONSTANT
?
ippBorderConst
:
borderTypeNI
==
BORDER_WRAP
?
ippBorderWrap
:
borderTypeNI
==
BORDER_REPLICATE
?
ippBorderRepl
:
borderTypeNI
==
BORDER_REFLECT_101
?
ippBorderMirror
:
borderTypeNI
==
BORDER_REFLECT
?
ippBorderMirrorR
:
(
IppiBorderType
)
-
1
;
#define IPP_FILTER_LAPLACIAN(ippsrctype, ippdsttype, ippfavor) \
do \
{ \
if (borderTypeIpp >= 0 && ippiFilterLaplacianGetBufferSize_##ippfavor##_C1R(roisize, masksize, &bufsize) >= 0) \
{ \
Ipp8u * buffer = ippsMalloc_8u(bufsize); \
status = ippiFilterLaplacianBorder_##ippfavor##_C1R((const ippsrctype *)src.data, (int)src.step, (ippdsttype *)dst.data, \
(int)dst.step, roisize, masksize, borderTypeIpp, 0, buffer); \
ippsFree(buffer); \
} \
} while ((void)0, 0)
if
(
sdepth
==
CV_8U
&&
ddepth
==
CV_16S
&&
!
floatScale
&&
!
floatDelta
)
{
IPP_FILTER_LAPLACIAN
(
Ipp8u
,
Ipp16s
,
8u16
s
);
if
(
needScale
)
status
=
ippiMulC_16s_C1IRSfs
((
Ipp16s
)
iscale
,
(
Ipp16s
*
)
dst
.
data
,
(
int
)
dst
.
step
,
roisize
,
0
);
if
(
needDelta
)
status
=
ippiAddC_16s_C1IRSfs
((
Ipp16s
)
idelta
,
(
Ipp16s
*
)
dst
.
data
,
(
int
)
dst
.
step
,
roisize
,
0
);
}
else
if
(
sdepth
==
CV_32F
&&
ddepth
==
CV_32F
)
{
IPP_FILTER_LAPLACIAN
(
Ipp32f
,
Ipp32f
,
32
f
);
if
(
needScale
)
status
=
ippiMulC_32f_C1IR
((
Ipp32f
)
scale
,
(
Ipp32f
*
)
dst
.
data
,
(
int
)
dst
.
step
,
roisize
);
if
(
needDelta
)
status
=
ippiAddC_32f_C1IR
((
Ipp32f
)
delta
,
(
Ipp32f
*
)
dst
.
data
,
(
int
)
dst
.
step
,
roisize
);
}
if
(
status
>=
0
)
return
;
}
}
#undef IPP_FILTER_LAPLACIAN
#endif
#ifdef HAVE_TEGRA_OPTIMIZATION
if
(
scale
==
1.0
&&
delta
==
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