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
3db78236
Commit
3db78236
authored
Apr 11, 2012
by
Maria Dimashova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed unnecessary param
parent
d8cec20e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
10 deletions
+4
-10
legacy.hpp
modules/legacy/include/opencv2/legacy/legacy.hpp
+2
-2
em.cpp
modules/legacy/src/em.cpp
+2
-8
No files found.
modules/legacy/include/opencv2/legacy/legacy.hpp
View file @
3db78236
...
...
@@ -1806,7 +1806,7 @@ public:
virtual
bool
train
(
const
CvMat
*
samples
,
const
CvMat
*
sampleIdx
=
0
,
CvEMParams
params
=
CvEMParams
(),
CvMat
*
labels
=
0
);
virtual
float
predict
(
const
CvMat
*
sample
,
CV_OUT
CvMat
*
probs
,
bool
isNormalize
=
true
)
const
;
virtual
float
predict
(
const
CvMat
*
sample
,
CV_OUT
CvMat
*
probs
)
const
;
#ifndef SWIG
CV_WRAP
CvEM
(
const
cv
::
Mat
&
samples
,
const
cv
::
Mat
&
sampleIdx
=
cv
::
Mat
(),
...
...
@@ -1817,7 +1817,7 @@ public:
CvEMParams
params
=
CvEMParams
(),
CV_OUT
cv
::
Mat
*
labels
=
0
);
CV_WRAP
virtual
float
predict
(
const
cv
::
Mat
&
sample
,
CV_OUT
cv
::
Mat
*
probs
=
0
,
bool
isNormalize
=
true
)
const
;
CV_WRAP
virtual
float
predict
(
const
cv
::
Mat
&
sample
,
CV_OUT
cv
::
Mat
*
probs
=
0
)
const
;
CV_WRAP
virtual
double
calcLikelihood
(
const
cv
::
Mat
&
sample
)
const
;
CV_WRAP
int
getNClusters
()
const
;
...
...
modules/legacy/src/em.cpp
View file @
3db78236
...
...
@@ -102,15 +102,12 @@ double CvEM::calcLikelihood( const Mat &input_sample ) const
}
float
CvEM
::
predict
(
const
CvMat
*
_sample
,
CvMat
*
_probs
,
bool
isNormalize
)
const
CvEM
::
predict
(
const
CvMat
*
_sample
,
CvMat
*
_probs
)
const
{
Mat
prbs0
=
cvarrToMat
(
_probs
),
prbs
=
prbs0
,
sample
=
cvarrToMat
(
_sample
);
int
cls
=
emObj
.
predict
(
sample
,
_probs
?
_OutputArray
(
prbs
)
:
cv
::
noArray
());
if
(
_probs
)
{
if
(
isNormalize
)
normalize
(
prbs
,
prbs
,
1
,
0
,
NORM_L1
);
if
(
prbs
.
data
!=
prbs0
.
data
)
{
CV_Assert
(
prbs
.
size
==
prbs0
.
size
);
...
...
@@ -236,12 +233,9 @@ bool CvEM::train( const Mat& _samples, const Mat& _sample_idx,
}
float
CvEM
::
predict
(
const
Mat
&
_sample
,
Mat
*
_probs
,
bool
isNormalize
)
const
CvEM
::
predict
(
const
Mat
&
_sample
,
Mat
*
_probs
)
const
{
int
cls
=
emObj
.
predict
(
_sample
,
_probs
?
_OutputArray
(
*
_probs
)
:
cv
::
noArray
());
if
(
_probs
&&
isNormalize
)
normalize
(
*
_probs
,
*
_probs
,
1
,
0
,
NORM_L1
);
return
(
float
)
cls
;
}
...
...
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