1

I am using OPENCV 3.0.0 and C++.

I need to read a csv type string instead of reading a csv file.

In the sample code , it uses

 Ptr<TrainData> data = TrainData::loadFromCSV(filename, 0, response_idx, response_idx+1, typespec);

How could I read a csv type string like this

string str1 = " 0,31,29,82,1,0,0,0,2,normal " ;

then can use it to TrainData ?

Thanks!!

Kev1n91
  • 3,553
  • 8
  • 46
  • 96
dow
  • 11
  • 1
  • Probably simplest thing would be to dump it into a temporary file and load that. – Dan Mašek Sep 02 '17 at 10:48
  • Possible duplicate of [How do I tokenize a string in C++?](https://stackoverflow.com/questions/53849/how-do-i-tokenize-a-string-in-c) – Kev1n91 Sep 02 '17 at 11:29

0 Answers0