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
9783cd98
Commit
9783cd98
authored
Apr 12, 2012
by
Maria Dimashova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed ERTrees name for writing to/reading from xml
parent
8a8b3466
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletion
+14
-1
ml.hpp
modules/ml/include/opencv2/ml/ml.hpp
+3
-0
ertrees.cpp
modules/ml/src/ertrees.cpp
+5
-0
rtrees.cpp
modules/ml/src/rtrees.cpp
+6
-1
No files found.
modules/ml/include/opencv2/ml/ml.hpp
View file @
9783cd98
...
...
@@ -125,6 +125,7 @@ CV_INLINE CvParamLattice cvDefaultParamLattice( void )
#define CV_TYPE_NAME_ML_ANN_MLP "opencv-ml-ann-mlp"
#define CV_TYPE_NAME_ML_CNN "opencv-ml-cnn"
#define CV_TYPE_NAME_ML_RTREES "opencv-ml-random-trees"
#define CV_TYPE_NAME_ML_ERTREES "opencv-ml-extremely-randomized-trees"
#define CV_TYPE_NAME_ML_GBT "opencv-ml-gradient-boosting-trees"
#define CV_TRAIN_ERROR 0
...
...
@@ -1041,6 +1042,7 @@ public:
CvForestTree
*
get_tree
(
int
i
)
const
;
protected
:
virtual
std
::
string
getName
()
const
;
virtual
bool
grow_forest
(
const
CvTermCriteria
term_crit
);
...
...
@@ -1114,6 +1116,7 @@ public:
#endif
virtual
bool
train
(
CvMLData
*
data
,
CvRTParams
params
=
CvRTParams
()
);
protected
:
virtual
std
::
string
getName
()
const
;
virtual
bool
grow_forest
(
const
CvTermCriteria
term_crit
);
};
...
...
modules/ml/src/ertrees.cpp
View file @
9783cd98
...
...
@@ -1517,6 +1517,11 @@ CvERTrees::~CvERTrees()
{
}
std
::
string
CvERTrees
::
getName
()
const
{
return
CV_TYPE_NAME_ML_ERTREES
;
}
bool
CvERTrees
::
train
(
const
CvMat
*
_train_data
,
int
_tflag
,
const
CvMat
*
_responses
,
const
CvMat
*
_var_idx
,
const
CvMat
*
_sample_idx
,
const
CvMat
*
_var_type
,
...
...
modules/ml/src/rtrees.cpp
View file @
9783cd98
...
...
@@ -246,6 +246,10 @@ CvRTrees::~CvRTrees()
clear
();
}
std
::
string
CvRTrees
::
getName
()
const
{
return
CV_TYPE_NAME_ML_RTREES
;
}
CvMat
*
CvRTrees
::
get_active_var_mask
()
{
...
...
@@ -726,7 +730,8 @@ void CvRTrees::write( CvFileStorage* fs, const char* name ) const
if
(
ntrees
<
1
||
!
trees
||
nsamples
<
1
)
CV_Error
(
CV_StsBadArg
,
"Invalid CvRTrees object"
);
cvStartWriteStruct
(
fs
,
name
,
CV_NODE_MAP
,
CV_TYPE_NAME_ML_RTREES
);
std
::
string
modelNodeName
=
this
->
getName
();
cvStartWriteStruct
(
fs
,
name
,
CV_NODE_MAP
,
modelNodeName
.
c_str
()
);
cvWriteInt
(
fs
,
"nclasses"
,
nclasses
);
cvWriteInt
(
fs
,
"nsamples"
,
nsamples
);
...
...
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