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
76c415ff
Commit
76c415ff
authored
Apr 13, 2014
by
Ilya Lavrenov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cv::filterSpeckles
parent
04abffeb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
4 deletions
+27
-4
stereosgbm.cpp
modules/calib3d/src/stereosgbm.cpp
+27
-4
No files found.
modules/calib3d/src/stereosgbm.cpp
View file @
76c415ff
...
...
@@ -1078,13 +1078,36 @@ void cv::filterSpeckles( InputOutputArray _img, double _newval, int maxSpeckleSi
double
_maxDiff
,
InputOutputArray
__buf
)
{
Mat
img
=
_img
.
getMat
();
int
type
=
img
.
type
(),
cn
=
CV_MAT_CN
(
type
);
Mat
temp
,
&
_buf
=
__buf
.
needed
()
?
__buf
.
getMatRef
()
:
temp
;
CV_Assert
(
img
.
type
()
==
CV_8UC1
||
img
.
type
()
==
CV_16SC1
);
CV_Assert
(
type
==
CV_8UC1
||
type
==
CV_16SC1
);
int
newVal
=
cvRound
(
_newval
);
int
maxDiff
=
cvRound
(
_maxDiff
);
int
newVal
=
cvRound
(
_newval
),
maxDiff
=
cvRound
(
_maxDiff
);
if
(
img
.
type
()
==
CV_8UC1
)
#if defined HAVE_IPP && !defined HAVE_IPP_ICV_ONLY
Ipp32s
bufsize
=
0
;
IppiSize
roisize
=
{
img
.
cols
,
img
.
rows
};
IppDataType
datatype
=
type
==
CV_8UC1
?
ipp8u
:
ipp16s
;
if
(
!
__buf
.
needed
()
&&
ippiMarkSpecklesGetBufferSize
(
roisize
,
datatype
,
cn
,
&
bufsize
))
{
Ipp8u
*
buffer
=
ippsMalloc_8u
(
bufsize
);
IppStatus
status
=
(
IppStatus
)
-
1
;
if
(
type
==
CV_8UC1
)
status
=
ippiMarkSpeckles_8u_C1IR
((
Ipp8u
*
)
img
.
data
,
(
int
)
img
.
step
,
roisize
,
(
Ipp8u
)
newVal
,
maxSpeckleSize
,
maxDiff
,
ippiNormL1
,
buffer
);
else
if
(
type
==
CV_16SC1
)
status
=
ippiMarkSpeckles_16s_C1IR
((
Ipp16s
*
)
img
.
data
,
(
int
)
img
.
step
,
roisize
,
(
Ipp16s
)
newVal
,
maxSpeckleSize
,
maxDiff
,
ippiNormL1
,
buffer
);
printf
(
"%s
\n
"
,
ippGetStatusString
(
status
));
if
(
status
>=
0
)
return
;
}
#endif
if
(
type
==
CV_8UC1
)
filterSpecklesImpl
<
uchar
>
(
img
,
newVal
,
maxSpeckleSize
,
maxDiff
,
_buf
);
else
filterSpecklesImpl
<
short
>
(
img
,
newVal
,
maxSpeckleSize
,
maxDiff
,
_buf
);
...
...
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