saving a non-image cv::mat to file (Feature #1787)


Added by rahul kavi almost 13 years ago. Updated almost 13 years ago.


Status:Cancelled Start date:2012-04-10
Priority:Normal Due date:
Assignee:Alexander Shishkov % Done:

0%

Category:core
Target version:2.4.0
Difficulty: Pull request:

Description

why isn't there a API function call to save a matrix with non-image data of type cv::Mat?

cv::imwrite doesn't support writing non-image data in cv::Mat to files.

It raises an cv::Exception (error: (-2) could not find a writer for the specified extension in function imwrite_
) when I try to write it to a text file.

I guess you could do it with CvMat* using a cvSave function call.

But, there is none for cv::Mat.


Norm.cpp - I'm trying to create a cv::Mat, do some operation and save it to a text/xml file. (466 Bytes) rahul kavi, 2012-04-10 06:11 pm


Associated revisions

Revision c47190ef
Added by Roman Donchenko over 11 years ago

Merge pull request #1787 from hs3180:2.4

History

Updated by Alexander Shishkov almost 13 years ago

imwrite is designed to work with images. If you want to save cv::Mat to the text file, please use FileStorage:

1Mat t;
2FileStorage f;
3f.open("temp.xml", FileStorage::WRITE);
4f << "t" << t;
5f.release();
  • Status changed from Open to Cancelled
  • Target version set to 2.4.0
  • Category set to core
  • Assignee set to Alexander Shishkov

Updated by Kirill Kornyakov almost 13 years ago

Rahul, please use the user forum next time =)

Also available in: Atom PDF