I have just started my learning on SVM using C++ OpenCV and was referring to the SVM documentation here. I wanted to try out the sample source code from the link to get fami
I found the code above worked but I needed to make a small modification to convert the labels to integers. The modification is in bold:
// Set up training data **Original**:
int labels[4] = { 1, -1, -1, -1 };
Mat labelsMat(4, 1, **CV_32SC1**, labels);
// Set up training data **Modified**:
int labels[4] = { 1, -1, -1, -1 };
Mat labelsMat(4, 1, **CV_32S**, labels);