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
a6b29be5
Commit
a6b29be5
authored
Sep 13, 2014
by
Dmitriy Anisimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor change: moved algorithm type to the end of params
parent
dfaf75f5
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
ml.hpp
modules/ml/include/opencv2/ml.hpp
+2
-2
knearest.cpp
modules/ml/src/knearest.cpp
+3
-3
test_emknearestkmeans.cpp
modules/ml/test/test_emknearestkmeans.cpp
+1
-1
No files found.
modules/ml/include/opencv2/ml.hpp
View file @
a6b29be5
...
@@ -230,12 +230,12 @@ public:
...
@@ -230,12 +230,12 @@ public:
class
CV_EXPORTS_W_MAP
Params
class
CV_EXPORTS_W_MAP
Params
{
{
public
:
public
:
Params
(
int
algorithmType_
=
BRUTE_FORCE
,
int
defaultK
=
10
,
bool
isclassifier_
=
true
,
int
Emax_
=
INT_MAX
);
Params
(
int
defaultK
=
10
,
bool
isclassifier_
=
true
,
int
Emax_
=
INT_MAX
,
int
algorithmType_
=
BRUTE_FORCE
);
CV_PROP_RW
int
algorithmType
;
CV_PROP_RW
int
defaultK
;
CV_PROP_RW
int
defaultK
;
CV_PROP_RW
bool
isclassifier
;
CV_PROP_RW
bool
isclassifier
;
CV_PROP_RW
int
Emax
;
// for implementation with KDTree
CV_PROP_RW
int
Emax
;
// for implementation with KDTree
CV_PROP_RW
int
algorithmType
;
};
};
virtual
void
setParams
(
const
Params
&
p
)
=
0
;
virtual
void
setParams
(
const
Params
&
p
)
=
0
;
virtual
Params
getParams
()
const
=
0
;
virtual
Params
getParams
()
const
=
0
;
...
...
modules/ml/src/knearest.cpp
View file @
a6b29be5
...
@@ -50,11 +50,11 @@
...
@@ -50,11 +50,11 @@
namespace
cv
{
namespace
cv
{
namespace
ml
{
namespace
ml
{
KNearest
::
Params
::
Params
(
int
algorithmType_
,
int
k
,
bool
isclassifier_
,
int
Emax_
)
:
KNearest
::
Params
::
Params
(
int
k
,
bool
isclassifier_
,
int
Emax_
,
int
algorithmType_
)
:
algorithmType
(
algorithmType_
),
defaultK
(
k
),
defaultK
(
k
),
isclassifier
(
isclassifier_
),
isclassifier
(
isclassifier_
),
Emax
(
Emax_
)
Emax
(
Emax_
),
algorithmType
(
algorithmType_
)
{
{
}
}
...
...
modules/ml/test/test_emknearestkmeans.cpp
View file @
a6b29be5
...
@@ -330,7 +330,7 @@ void CV_KNearestTest::run( int /*start_from*/ )
...
@@ -330,7 +330,7 @@ void CV_KNearestTest::run( int /*start_from*/ )
}
}
// KNearest KDTree implementation
// KNearest KDTree implementation
Ptr
<
KNearest
>
knearestKdt
=
KNearest
::
create
(
ml
::
KNearest
::
Params
(
ml
::
KNearest
::
KDTREE
));
Ptr
<
KNearest
>
knearestKdt
=
KNearest
::
create
(
ml
::
KNearest
::
Params
(
10
,
true
,
INT_MAX
,
ml
::
KNearest
::
KDTREE
));
knearestKdt
->
train
(
trainData
,
ml
::
ROW_SAMPLE
,
trainLabels
);
knearestKdt
->
train
(
trainData
,
ml
::
ROW_SAMPLE
,
trainLabels
);
knearestKdt
->
findNearest
(
testData
,
4
,
bestLabels
);
knearestKdt
->
findNearest
(
testData
,
4
,
bestLabels
);
if
(
!
calcErr
(
bestLabels
,
testLabels
,
sizes
,
err
,
true
)
)
if
(
!
calcErr
(
bestLabels
,
testLabels
,
sizes
,
err
,
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