Ask Your Question

Revision history [back]

How do I use Opencv TrainData?

Hello all,

I came across the TrainData class on OpenCV 3's documentation website :

However, when I do something like :-

cv::Ptr<cv::TrainData> td = cv::TrainData::create(...something here);

it fails and gives me an error as:- error: 'create' is not a member of 'cv::TrainData {aka CvMLData}' cv::TrainData::create(Mat(),)

When I try to get into the ml.hpp file and look for TrainData, I only find out the TrainData is given by the alias(typedef) of CvMLDATA. Is this supposed to be like this? I don't know what I can do to use the TrainData::create() function and therefore generate the data for SVM::trainAuto().

Any Help will be most appreciated. ^