Commit 1e15758c630f7fc0ef4f5efe349ca4fe796cf495

Authored by Scott Klum
1 parent 2478d1bb

Attribute bug fixes

openbr/plugins/filter.cpp
... ... @@ -45,7 +45,8 @@ class GammaTransform : public UntrainableTransform
45 45  
46 46 void project(const Template &src, Template &dst) const
47 47 {
48   - LUT(src, lut, dst);
  48 + if (src.m().depth() == CV_8U) LUT(src, lut, dst);
  49 + else pow(src, gamma, dst);
49 50 }
50 51 };
51 52  
... ...
openbr/plugins/svm.cpp
... ... @@ -74,7 +74,7 @@ static void trainSVM(SVM &svm, Mat data, Mat lab, int kernel, int type, float C,
74 74 svm.train_auto(data, lab, Mat(), Mat(), params, 5);
75 75 } catch (...) {
76 76 qWarning("Some classes do not contain sufficient examples or are not discriminative enough for accurate SVM classification.");
77   - svm.train(data, lab);
  77 + svm.train(data, lab, Mat(), Mat(), params);
78 78 }
79 79 } else {
80 80 params.C = C;
... ... @@ -161,7 +161,8 @@ private:
161 161 dst.m().at<float>(0, 0) = prediction;
162 162 // positive values ==> first class
163 163 // negative values ==> second class
164   - prediction = prediction > 0 ? 0 : 1;
  164 + if (type != EPS_SVR && type != NU_SVR)
  165 + prediction = prediction > 0 ? 0 : 1;
165 166 }
166 167 if (type == EPS_SVR || type == NU_SVR) {
167 168 dst.file.set(outputVariable, prediction);
... ...