diff --git a/openbr/plugins/filter.cpp b/openbr/plugins/filter.cpp index c57ca1c..54b96d4 100644 --- a/openbr/plugins/filter.cpp +++ b/openbr/plugins/filter.cpp @@ -45,8 +45,7 @@ class GammaTransform : public UntrainableTransform void project(const Template &src, Template &dst) const { - if (src.m().depth() == CV_8U) LUT(src, lut, dst); - else pow(src, gamma, dst); + LUT(src, lut, dst); } }; diff --git a/openbr/plugins/svm.cpp b/openbr/plugins/svm.cpp index b7c3161..d24f674 100644 --- a/openbr/plugins/svm.cpp +++ b/openbr/plugins/svm.cpp @@ -74,7 +74,7 @@ static void trainSVM(SVM &svm, Mat data, Mat lab, int kernel, int type, float C, svm.train_auto(data, lab, Mat(), Mat(), params, 5); } catch (...) { qWarning("Some classes do not contain sufficient examples or are not discriminative enough for accurate SVM classification."); - svm.train(data, lab, Mat(), Mat(), params); + svm.train(data, lab); } } else { params.C = C; @@ -161,8 +161,7 @@ private: dst.m().at(0, 0) = prediction; // positive values ==> first class // negative values ==> second class - if (type != EPS_SVR && type != NU_SVR) - prediction = prediction > 0 ? 0 : 1; + prediction = prediction > 0 ? 0 : 1; } if (type == EPS_SVR || type == NU_SVR) { dst.file.set(outputVariable, prediction);