1 | initial version |
if you are trying a classification , your labels have to be integer.
please remove the
labelsMat.convertTo(labelsMat, CV_32F);
line.
also, you need float data , not integer, so it should be:
float trainingData[2][2] = { { 501, 10 }, { 255, 10 } };
Mat training_samples(2, 2, CV_32FC1, trainingData);
(and no further conversion)