I downloaded training set for digit recognition. The training set is in csv format , the first column contains the responses and pixel value of the following response is stored the corresponding row. I am trying to write a c++ code in visual studio that uses the ml module of open cv 3.00 to train from the data. I can load the data using the TrainData::loadFromCSV function but i am unable to understand how will it generate the samples and responses matrix that is required to feed into the TrainData::create command my code: void main() { TrainData::loadFromCSV("C:/Users/Shreya Srivastava/Desktop/train.csv",0,1,10); Mat samples ( 28,28, CV_32FC1 ); Mat responses(35591,0,CV_32F); TrainData::create(samples,ROW_SAMPLE,responses); imshow("samples",samples);
waitKey();
}