1 | initial version |
First of all, take care of the path name under Windows:
trainfilename[] = "\t\trainData_1.txt"; // no good
trainfilename[] = "\\t\\trainData_1.txt"; // good!
Because backslashs have to be escape on C/C++.
Second, your question is more about algorithm than OpenCV, but, I think you have to solution:
If you don't know these functions, Google it.