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 8074079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:32:19+00:00 2026-06-05T14:32:19+00:00

I’ve written a simple Augmented Reality application using Ogre + OpenCV . All is

  • 0

I’ve written a simple Augmented Reality application using Ogre + OpenCV. All is working, but I need to match Ogre’s virtual camera to my real camera

I don’t know camera parameters (it’s a cheap webcam and vendor is not providing them). I’m able to get camera intrinsic with cvCalibrateCamera2 (after some cvFindChessboardCorners as described here) and I save them with cvSave.

cvCalibrateCamera2(objectPoints_, imagePoints_, pointCounts_,
        imageSize, cameraMatrix, distortionCoeffs_, NULL,
        NULL, CV_CALIB_FIX_ASPECT_RATIO );
cvSave(INTRINSIC_XML, intrinsicMatrix_);

AR application loads the intrinsic matrix:

CvMat* intrinsic = (CvMat*) cvLoad(INTRINSIC_XML);

So intrinsic->data.db is a pointer to a 9 length array of double (3×3 matrix)
How can I translate this to a Ogre::Matrix4 such I can use it with setCustomProjectionMatrix.

I’ve found something in Ogre’s Forum but this is not working. I guess some other step is needed between the 3×3 matrix found by OpenCV and the 4×4 matrix needed by Ogre::Camera.

I hope there’s some way of doing this with intrinsics given by cvCalibrateCamera2. If none, I’ll need to take a ruler and a protractor and get parameters (roughly) by hand.

This is the 3×3 “intrinsics” matrix:

836.391     0.000   460.430 
  0.000   836.391   281.440
  0.000     0.000     1.000
  • 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-06-05T14:32:21+00:00Added an answer on June 5, 2026 at 2:32 pm

    Create the projection matrix as follows.

    mat[0,0] = fx

    mat[1,1] = fy

    mat[2,2] = +- .01

    mat[3,2] = +- 1

    mat[3,3] = 0

    where
    fx = intrinsic [0] / imageSize.Width;

    fy = intrinsic [1*3 + 1] / imageSize.Height;

    Try combinations of negative and positive values for mat[2,2] and mat[3,2].

    Typically both will have negative values.
    Other parameters can be ignored

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I need to clean up various Word 'smart' characters in user input, including but
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have thousands of HTML files to process using Groovy/Java and I need to
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I am reading a book about Javascript and jQuery and using one of the

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.