How do I load CSV files now?

asked 2015-06-30 17:51:43 -0600

With OpenCV 3.0, the ml module has been rewritten, I used to do

CvMLData data;
if(data.read_csv(path.c_str())==-1){
    printf("File %s cannot be opened\n", path.c_str());
    return false;
}
const CvMat *tmp = data.get_values();
m = cv::Mat(tmp,true);
m.convertTo(m,type);
cv::resize(m,m,cv::Size(ncol,nrow));
tmp->CvMat::~CvMat();

What do I do now to load CSV files into a Mat?

edit retag flag offensive close merge delete

Comments

2

ml::TrainData can load csv files

berak gravatar imageberak ( 2015-07-01 01:08:24 -0600 )edit

How do you get a mat from ml::TrainData though? The getValues() method seems different...

ibrahima gravatar imageibrahima ( 2015-10-20 15:16:41 -0600 )edit