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
eba1be71
Commit
eba1be71
authored
May 08, 2014
by
Alexander Alekhin
Committed by
OpenCV Buildbot
May 08, 2014
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2710 from ilya-lavrenov:ipp_threshold
parents
a82dd8ce
11b01cd8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
6 deletions
+34
-6
thresh.cpp
modules/imgproc/src/thresh.cpp
+34
-6
No files found.
modules/imgproc/src/thresh.cpp
View file @
eba1be71
...
...
@@ -70,24 +70,38 @@ thresh_8u( const Mat& _src, Mat& _dst, uchar thresh, uchar maxval, int type )
#if defined(HAVE_IPP)
IppiSize
sz
=
{
roi
.
width
,
roi
.
height
};
CV_SUPPRESS_DEPRECATED_START
switch
(
type
)
{
case
THRESH_TRUNC
:
if
(
0
<=
ippiThreshold_GT_8u_C1R
(
_src
.
data
,
(
int
)
src_step
,
_dst
.
data
,
(
int
)
dst_step
,
sz
,
thresh
))
#ifndef HAVE_IPP_ICV_ONLY
if
(
_src
.
data
==
_dst
.
data
&&
ippiThreshold_GT_8u_C1IR
(
_src
.
data
,
(
int
)
src_step
,
sz
,
thresh
)
>=
0
)
return
;
#endif
if
(
ippiThreshold_GT_8u_C1R
(
_src
.
data
,
(
int
)
src_step
,
_dst
.
data
,
(
int
)
dst_step
,
sz
,
thresh
)
>=
0
)
return
;
setIppErrorStatus
();
break
;
case
THRESH_TOZERO
:
if
(
0
<=
ippiThreshold_LTVal_8u_C1R
(
_src
.
data
,
(
int
)
src_step
,
_dst
.
data
,
(
int
)
dst_step
,
sz
,
thresh
+
1
,
0
))
#ifndef HAVE_IPP_ICV_ONLY
if
(
_src
.
data
==
_dst
.
data
&&
ippiThreshold_LTVal_8u_C1IR
(
_src
.
data
,
(
int
)
src_step
,
sz
,
thresh
+
1
,
0
)
>=
0
)
return
;
#endif
if
(
ippiThreshold_LTVal_8u_C1R
(
_src
.
data
,
(
int
)
src_step
,
_dst
.
data
,
(
int
)
dst_step
,
sz
,
thresh
+
1
,
0
)
>=
0
)
return
;
setIppErrorStatus
();
break
;
case
THRESH_TOZERO_INV
:
if
(
0
<=
ippiThreshold_GTVal_8u_C1R
(
_src
.
data
,
(
int
)
src_step
,
_dst
.
data
,
(
int
)
dst_step
,
sz
,
thresh
,
0
))
#ifndef HAVE_IPP_ICV_ONLY
if
(
_src
.
data
==
_dst
.
data
&&
ippiThreshold_GTVal_8u_C1IR
(
_src
.
data
,
(
int
)
src_step
,
sz
,
thresh
,
0
)
>=
0
)
return
;
#endif
if
(
ippiThreshold_GTVal_8u_C1R
(
_src
.
data
,
(
int
)
src_step
,
_dst
.
data
,
(
int
)
dst_step
,
sz
,
thresh
,
0
)
>=
0
)
return
;
setIppErrorStatus
();
break
;
}
CV_SUPPRESS_DEPRECATED_END
#endif
switch
(
type
)
...
...
@@ -311,24 +325,38 @@ thresh_16s( const Mat& _src, Mat& _dst, short thresh, short maxval, int type )
#if defined(HAVE_IPP)
IppiSize
sz
=
{
roi
.
width
,
roi
.
height
};
CV_SUPPRESS_DEPRECATED_START
switch
(
type
)
{
case
THRESH_TRUNC
:
if
(
0
<=
ippiThreshold_GT_16s_C1R
(
src
,
(
int
)
src_step
*
sizeof
(
src
[
0
]),
dst
,
(
int
)
dst_step
*
sizeof
(
dst
[
0
]),
sz
,
thresh
))
#ifndef HAVE_IPP_ICV_ONLY
if
(
_src
.
data
==
_dst
.
data
&&
ippiThreshold_GT_16s_C1IR
(
dst
,
(
int
)
dst_step
*
sizeof
(
dst
[
0
]),
sz
,
thresh
)
>=
0
)
return
;
#endif
if
(
ippiThreshold_GT_16s_C1R
(
src
,
(
int
)
src_step
*
sizeof
(
src
[
0
]),
dst
,
(
int
)
dst_step
*
sizeof
(
dst
[
0
]),
sz
,
thresh
)
>=
0
)
return
;
setIppErrorStatus
();
break
;
case
THRESH_TOZERO
:
if
(
0
<=
ippiThreshold_LTVal_16s_C1R
(
src
,
(
int
)
src_step
*
sizeof
(
src
[
0
]),
dst
,
(
int
)
dst_step
*
sizeof
(
dst
[
0
]),
sz
,
thresh
+
1
,
0
))
#ifndef HAVE_IPP_ICV_ONLY
if
(
_src
.
data
==
_dst
.
data
&&
ippiThreshold_LTVal_16s_C1IR
(
dst
,
(
int
)
dst_step
*
sizeof
(
dst
[
0
]),
sz
,
thresh
+
1
,
0
)
>=
0
)
return
;
#endif
if
(
ippiThreshold_LTVal_16s_C1R
(
src
,
(
int
)
src_step
*
sizeof
(
src
[
0
]),
dst
,
(
int
)
dst_step
*
sizeof
(
dst
[
0
]),
sz
,
thresh
+
1
,
0
)
>=
0
)
return
;
setIppErrorStatus
();
break
;
case
THRESH_TOZERO_INV
:
if
(
0
<=
ippiThreshold_GTVal_16s_C1R
(
src
,
(
int
)
src_step
*
sizeof
(
src
[
0
]),
dst
,
(
int
)
dst_step
*
sizeof
(
dst
[
0
]),
sz
,
thresh
,
0
))
#ifndef HAVE_IPP_ICV_ONLY
if
(
_src
.
data
==
_dst
.
data
&&
ippiThreshold_GTVal_16s_C1IR
(
dst
,
(
int
)
dst_step
*
sizeof
(
dst
[
0
]),
sz
,
thresh
,
0
)
>=
0
)
return
;
#endif
if
(
ippiThreshold_GTVal_16s_C1R
(
src
,
(
int
)
src_step
*
sizeof
(
src
[
0
]),
dst
,
(
int
)
dst_step
*
sizeof
(
dst
[
0
]),
sz
,
thresh
,
0
)
>=
0
)
return
;
setIppErrorStatus
();
break
;
}
CV_SUPPRESS_DEPRECATED_END
#endif
switch
(
type
)
...
...
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