Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 921329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:51:27+00:00 2026-05-15T18:51:27+00:00

The old, C style cvMat matrices could be passed to the cvSave() function for

  • 0

The old, C style cvMat matrices could be passed to the cvSave() function for easy writing to an XML file. The new C++ style cv::Mat and cv::Mat_ matrices are not accepted by this function.

The OpenCV reference has a section on XML persistence, but the three classes (FileStorage, FileNode and FileNodeIterator) lack any description or example and I can’t figure out how to use them from the interface.

Thanks.

EDIT: This actually concerns a lot of other functionality in the new C++ interface of OpenCV, as of Version 2.1. The documentation is very poor in places, the function arguments are inconsistent, and the user group either has no idea, or has better things to do than answer questions. I’m going to stick to the old C interface for a while. The docs are tons better, not to mention the book by O’Reilly.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T18:51:28+00:00Added an answer on May 15, 2026 at 6:51 pm

    Apparently its easier in C++ style, but as you said there aren’t any easily available documentation.

    To Write cv::Mat in a file just create a FileStorage variable and then write the matrix in the style you use cout to print on screen.

    cv::Mat someMatrix;
    //you create and assign values to someMatrix however you plan to.
    FileStorage fs("myFile.yml", FileStorage::WRITE);
    fs << "name_to_identify_matrix_by" << someMatrix;
    

    Reading is also similar to cin style, but its better you take a look at the below link to have a better understanding. On 2nd page in section Data I/O they have shown examples on how to use XML/YAML.

    opencv C++ cheatsheet(different than cheatsheet in the documentation PDF)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I rewrite my old code in new style, like below: #old style open(FD,file); #new
What is the difference between old style and new style classes in Python? When
I already know the difference between old-style class (class Foo()...) and new-style class (class
Here's a simple function delcared and defined using old style syntax: #include <stdio.h> void
Given the class Foo with an old-style constructor class Foo { public function Foo()
Possible Duplicate: Easy: How to use Raw_input in 3.1 in old style i can
I have a templating system that looks similar to old-style ASP code. I run
I have a set of Java 5 source files with old-style Doclet tags, comments
I've been looking around for some decent tutorials on .NET remoting (old style MarshallByRef),
I'm looking for a nice Stack Overflow-style answer to the first question in the old

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.