Commit 3b6db8cde7d43ef0123b73793c1edc039e94daad

Authored by Brendan Klare
1 parent f239ab13

Adding svm regressor output to dst template data

Showing 1 changed file with 5 additions and 2 deletions
openbr/plugins/svm.cpp
@@ -163,9 +163,12 @@ private: @@ -163,9 +163,12 @@ private:
163 // negative values ==> second class 163 // negative values ==> second class
164 prediction = prediction > 0 ? 0 : 1; 164 prediction = prediction > 0 ? 0 : 1;
165 } 165 }
166 - if (type == EPS_SVR || type == NU_SVR) 166 + if (type == EPS_SVR || type == NU_SVR) {
167 dst.file.set(outputVariable, prediction); 167 dst.file.set(outputVariable, prediction);
168 - else 168 + dst.m() = Mat(1, 1, CV_32F);
  169 + dst.m().at<float>(0, 0) = prediction;
  170 +
  171 + } else
169 dst.file.set(outputVariable, reverseLookup[prediction]); 172 dst.file.set(outputVariable, reverseLookup[prediction]);
170 } 173 }
171 174