Will
Will

Reputation: 233

OpenCV machine learning functions want CvFileStorage* instead of cv::FileStorage*

I am using the CvANN_MLP functions from the machine learning libraries in OpenCV, and I want to write my trained network to a file. I have been able to do this fine with cv::FileStorage for keypoints and descriptors when using SIFT, but when I try to do it here it does not work.

The header for the machine learning uses CvFileStorage throughout, but I cannot declare this object without getting a "CvFileStorage fs has initializer but incomplete type" error, and passing in a cv::FileStorage is no help at all.

I figured maybe this is because I don't have the most recent build of OpenCV, but I checked in the SVN repository, and it still has CvFileStorage in its prototypes.

Upvotes: 16

Views: 1131

Answers (1)

Rook
Rook

Reputation: 6155

Solution written by Will, originally posted as part of their question.

Hidden in the cv::FileStorage class is the following:

// returns the underlying CvFileStorage*
CvFileStorage* operator *() { return fs; }
const CvFileStorage* operator *() const { return fs; }

Upvotes: 1

Related Questions