train_svmsgd.cpp : float response
authorberak <px1704@web.de>
Mon, 14 Mar 2016 07:09:36 +0000 (08:09 +0100)
committerberak <px1704@web.de>
Mon, 14 Mar 2016 07:09:36 +0000 (08:09 +0100)
responses must be float, else we trigger an assertion in line 150

samples/cpp/train_svmsgd.cpp

index e2942d0..810f061 100644 (file)
@@ -167,7 +167,7 @@ void addPointRetrainAndRedraw(Data &data, int x, int y, int response)
     currentSample.at<float>(0,0) = (float)x;
     currentSample.at<float>(0,1) = (float)y;
     data.samples.push_back(currentSample);
-    data.responses.push_back(response);
+    data.responses.push_back(static_cast<float>(response));
 
     Mat weights(1, 2, CV_32FC1);
     float shift = 0;