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

  • SEARCH
  • Home
  • 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 6157779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:50:43+00:00 2026-05-23T20:50:43+00:00

I already have instinsic.xml and distortion.xml which was produced for my camera. Now I

  • 0

I already have “instinsic.xml” and “distortion.xml” which was produced for my camera. Now I am writing a program using OpenCV 2.2 interface and therefore I am mainly working with cv::Mat data structure as opposed to CvMat. I want to load these two files into corresponding cv::Mat structure. With previous API for OpenCV I would write:

CvMat* intrinsic = (CvMat*) cvLoad("Intrinsics.xml");
CvMat* distortion = (CvMat*) cvLoad("Distortions.xml");

How can I achieve this in OpenCV 2.2? Is there a function that would load the xml file into a cv::Mat for me? I looked all over the API documentation but could not find it.

Thanks,

  • 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-23T20:50:43+00:00Added an answer on May 23, 2026 at 8:50 pm

    Something like this should be good for you :

    The code is some sort of a sample. There are others in the samples directory of OpenCV which are really relevant and help a lot in these types of manipulations…

    //TO WRITE
    Mat myMat;
    FileStorage fs(filename,FileStorage::WRITE);
    fs << "MY_MAT_NAME_IN_THE_XML" << myMat;
    fs.release();
    
    //TO READ
    Mat myMat;
    FileStorage fs(filename,FileStorage::READ);
    fs["MY_MAT_NAME_IN_THE_XML"] >> myMat;
    fs.release();
    

    I warmly advise you to test the opening with fs.isOpened() aswell, the code could be completed…

    For more info, here is the doc

    Julien,

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

Sidebar

Related Questions

I already have code which lazy loads scripts on request. My issue now is
I have already created UITableViewController embedded in Navigator Controller using Storyboard and Interface Builder.
I already have some documents indexed using more NumericField s per document. Now I
i already have a project with TreeNode class which creates a hierachy of nodes
I already have an application built in asp.net 3.5 and now I want to
Let's imagine I already have a project building .NET 3.5 assembly. Now I want
i already have the crm_member_list table and also can successfully login ,now i want
I already have a solution for encrypting of several XML nodes or strings. But
I already have some regex logic which says to look for a div tag
I already have an express checkout integrated with my Codeigniter application. Now I want

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.