Merge pull request #1994 from StevenPuttemans:bugfix_3431

pull/2014/merge
Roman Donchenko 11 years ago committed by OpenCV Buildbot
commit b633c73c46
  1. 6
      samples/cpp/tutorial_code/ml/introduction_to_svm/introduction_to_svm.cpp

@ -32,13 +32,13 @@ int main()
for (int i = 0; i < image.rows; ++i)
for (int j = 0; j < image.cols; ++j)
{
Mat sampleMat = (Mat_<float>(1,2) << i,j);
Mat sampleMat = (Mat_<float>(1,2) << j,i);
float response = SVM.predict(sampleMat);
if (response == 1)
image.at<Vec3b>(j, i) = green;
image.at<Vec3b>(i,j) = green;
else if (response == -1)
image.at<Vec3b>(j, i) = blue;
image.at<Vec3b>(i,j) = blue;
}
// Show the training data

Loading…
Cancel
Save