saving a non-image cv::mat to file (Feature #1787)
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
.
Associated revisions
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 =)