1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

moving algorithm type to param

This commit is contained in:
Dmitriy Anisimov
2014-09-06 09:29:32 +04:00
parent 5f3ee657ce
commit dfaf75f502
3 changed files with 12 additions and 11 deletions
+7 -7
View File
@@ -50,14 +50,14 @@
namespace cv {
namespace ml {
KNearest::Params::Params(int k, bool isclassifier_, int Emax_)
KNearest::Params::Params(int algorithmType_, int k, bool isclassifier_, int Emax_) :
algorithmType(algorithmType_),
defaultK(k),
isclassifier(isclassifier_),
Emax(Emax_)
{
defaultK = k;
isclassifier = isclassifier_;
Emax = Emax_;
}
class KNearestImpl : public KNearest
{
public:
@@ -497,9 +497,9 @@ public:
Params params;
};
Ptr<KNearest> KNearest::create(const Params& p, int type)
Ptr<KNearest> KNearest::create(const Params& p)
{
if (KDTREE==type)
if (KDTREE==p.algorithmType)
{
return makePtr<KNearestKDTreeImpl>(p);
}