Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read matlab mat files using matio library #18

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open

Read matlab mat files using matio library #18

wants to merge 18 commits into from

Conversation

TimSC
Copy link
Contributor

@TimSC TimSC commented Apr 2, 2013

I don't have access to the MatlabIO library, so I have attempted to read mat files using the open source matio library. This addresses issue #14. This is almost working but there are problems in FileStorageModel.cpp:

./ModelTransfer test7.mat ../../matlab/Demo_model.xml
-------------------------------
        Model Transfer         
-------------------------------

deserializing Matlab (.mat) model...
converting...
serializing to OpenCV (.xml) model...
OpenCV Error: Bad argument (An attempt to add element without a key to a map, or add element with key to sequence) in icvXMLWriteTag, file /build/buildd/opencv-2.3.1/modules/core/src/persistence.cpp, line 2229
terminate called after throwing an instance of 'cv::Exception'
  what():  /build/buildd/opencv-2.3.1/modules/core/src/persistence.cpp:2229: error: (-5) An attempt to add element without a key to a map, or add element with key to sequence in function icvXMLWriteTag

Aborted

This might be caused by my old version of OpenCV or a bug someone else. As far as I can tell, the mat file is correctly read into memory but I could really do with a known "good" mat file the correctly converts in ModelTransfer with MatlabIO enabled. Anyone?

Also, some additional work is needed in the CMake files in cases where matio is not installed. I am not sure how to do that.

Note that matio only reads matlab files and does not read Octave mat files in the default mode (however Octave can save in a matlab format)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant