Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 978
Will Avatar asked Apr 15 '12 08:04

Will


1 Answers

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; }
like image 130
2 revs, 2 users 75% Avatar answered Sep 18 '22 17:09

2 revs, 2 users 75%