diff --git a/openbr/plugins/filter.cpp b/openbr/plugins/filter.cpp index 54b96d4..c57ca1c 100644 --- a/openbr/plugins/filter.cpp +++ b/openbr/plugins/filter.cpp @@ -45,7 +45,8 @@ class GammaTransform : public UntrainableTransform void project(const Template &src, Template &dst) const { - LUT(src, lut, dst); + if (src.m().depth() == CV_8U) LUT(src, lut, dst); + else pow(src, gamma, dst); } }; diff --git a/openbr/plugins/svm.cpp b/openbr/plugins/svm.cpp index d24f674..b7c3161 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); + svm.train(data, lab, Mat(), Mat(), params); } } else { params.C = C; @@ -161,7 +161,8 @@ private: dst.m().at(0, 0) = prediction; // positive values ==> first class // negative values ==> second class - prediction = prediction > 0 ? 0 : 1; + if (type != EPS_SVR && type != NU_SVR) + prediction = prediction > 0 ? 0 : 1; } if (type == EPS_SVR || type == NU_SVR) { dst.file.set(outputVariable, prediction);