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
ca8241f6
Commit
ca8241f6
authored
Apr 18, 2012
by
Maria Dimashova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
made em params read only; minor renaming
parent
c2ae452a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
+10
-9
ml.hpp
modules/ml/include/opencv2/ml/ml.hpp
+1
-1
em.cpp
modules/ml/src/em.cpp
+9
-8
No files found.
modules/ml/include/opencv2/ml/ml.hpp
View file @
ca8241f6
...
...
@@ -569,7 +569,7 @@ public:
enum
{
START_E_STEP
=
1
,
START_M_STEP
=
2
,
START_AUTO_STEP
=
0
};
CV_WRAP
EM
(
int
nclusters
=
EM
::
DEFAULT_NCLUSTERS
,
int
covMatType
=
EM
::
COV_MAT_DIAGONAL
,
const
TermCriteria
&
term
c
rit
=
TermCriteria
(
TermCriteria
::
COUNT
+
const
TermCriteria
&
term
C
rit
=
TermCriteria
(
TermCriteria
::
COUNT
+
TermCriteria
::
EPS
,
EM
::
DEFAULT_MAX_ITERS
,
FLT_EPSILON
));
...
...
modules/ml/src/em.cpp
View file @
ca8241f6
...
...
@@ -48,12 +48,12 @@ const double minEigenValue = DBL_EPSILON;
///////////////////////////////////////////////////////////////////////////////////////////////////////
EM
::
EM
(
int
_nclusters
,
int
_covMatType
,
const
TermCriteria
&
_
criteria
)
EM
::
EM
(
int
_nclusters
,
int
_covMatType
,
const
TermCriteria
&
_
termCrit
)
{
nclusters
=
_nclusters
;
covMatType
=
_covMatType
;
maxIters
=
(
_
criteria
.
type
&
TermCriteria
::
MAX_ITER
)
?
_criteria
.
maxCount
:
DEFAULT_MAX_ITERS
;
epsilon
=
(
_
criteria
.
type
&
TermCriteria
::
EPS
)
?
_criteria
.
epsilon
:
0
;
maxIters
=
(
_
termCrit
.
type
&
TermCriteria
::
MAX_ITER
)
?
_termCrit
.
maxCount
:
DEFAULT_MAX_ITERS
;
epsilon
=
(
_
termCrit
.
type
&
TermCriteria
::
EPS
)
?
_termCrit
.
epsilon
:
0
;
}
EM
::~
EM
()
...
...
@@ -135,6 +135,7 @@ Vec2d EM::predict(InputArray _sample, OutputArray _probs) const
sample
.
convertTo
(
tmp
,
CV_64FC1
);
sample
=
tmp
;
}
sample
.
reshape
(
1
,
1
);
Mat
probs
;
if
(
_probs
.
needed
()
)
...
...
@@ -682,12 +683,12 @@ AlgorithmInfo* EM::info() const
if
(
!
initialized
)
{
EM
obj
;
em_info
.
addParam
(
obj
,
"nclusters"
,
obj
.
nclusters
);
em_info
.
addParam
(
obj
,
"covMatType"
,
obj
.
covMatType
);
em_info
.
addParam
(
obj
,
"nclusters"
,
obj
.
nclusters
,
true
);
em_info
.
addParam
(
obj
,
"covMatType"
,
obj
.
covMatType
,
true
);
em_info
.
addParam
(
obj
,
"weights"
,
obj
.
weights
);
em_info
.
addParam
(
obj
,
"means"
,
obj
.
means
);
em_info
.
addParam
(
obj
,
"covs"
,
obj
.
covs
);
em_info
.
addParam
(
obj
,
"weights"
,
obj
.
weights
,
true
);
em_info
.
addParam
(
obj
,
"means"
,
obj
.
means
,
true
);
em_info
.
addParam
(
obj
,
"covs"
,
obj
.
covs
,
true
);
initialized
=
true
;
}
...
...
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