|
|
@ -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 ) ) |
|
|
|