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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user