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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:06:17+00:00 2026-06-16T03:06:17+00:00

There are Google results and stackoverflow posts that appear to answer this question, but

  • 0

There are Google results and stackoverflow posts that appear to answer this question, but the simple fact is I can’t understand them. No matter how much I read, I can’t get my head around quaternions and Euler angles and Rodriguez transforms and all that.

Anyone up for explaining to me like I’m 12 how to get from the rotation and translation vectors returned by OpenCV’s solvePnP() method to xyz Position and xyz Rotation values that I can plug into a 3d graphics application?

This is for an augmented reality application in c++. I have the OpenCV part up and running, tracking a markerboard and sending rotation and translation vectors to the graphics program, but I have no idea how to use that information to pose my 3d object.

I really do want to understand the math behind this, and will appreciate any patient explanation of the theory here. But I’ll also settle for a pointer to some code I can copy/paste and learn the theory another day. In fact I seem to learn stuff like this faster by seeing concrete code and working backward to the theory.

EDIT:
Like there’s this… which clearly should point me in the right direction, but it may as well be the plans for a time machine for all I know. It’s occurred to me that I may be asking for remedial high school math, but it can’t be the first time.

EDIT:
Here’s an example of the rotation vector and translation vector being returned from solvePnP()… converted into XML for the trip to the graphics application. Note that every one of these I’ve seen contains three rows and one column.

<Tvec type_id="opencv-matrix">
  <rows>3</rows>
  <cols>1</cols>
  <dt>f</dt>
  <data>
    -2.50094433e+01 -6.59909010e+00 1.07882790e+02
  </data>
</Tvec>
<Rvec type_id="opencv-matrix">
  <rows>3</rows>
  <cols>1</cols>
  <dt>f</dt>
  <data>
    -1.92100227e+00 -2.11300254e-01 2.80715879e-02
  </data>
</Rvec>
  • 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-16T03:06:18+00:00Added an answer on June 16, 2026 at 3:06 am

    Initially I knew nothing about what formats OpenCV uses. So some research first. Looking at the documentation for solvePnP, it appears like its returning a matrix. (The Rodrigues2 function mentioned in an older version in the docs appears to be called Rodrigues these days.)

    The description there indicates that you can expect a matrix with either a single row or a single column. The direction of that vector indicates the axis of rotation, while the length (or “norm”) of the vector gives the angle.

    So your input is in angle-axis representation. Which you can interpret as a simultaneous rotation about the x, y and z axes. So if by “XYZ rotation” you mean simultaneous rotation, then you are already there. If, however, you mean some combination which rotates first about the x axis and then about the y axis and then about the z axis, you are in a strange setup, and probably should make sure you are using the correct API.

    If it is Euler angles you are after, then calling them “XYZ rotation” is somewhat misleading. The Wikipedia article Rotation formalisms in three dimensions gives a list of the various formats, and how to convert between them. In particular, it does give formulas to convert from Axis and angle to matrix and from there to euler angles.

    Make sure you are using the correct representation to match your graphics output machinery. Or if you have a choice, try to work directly on the rotation marix representation, as that should be easiest to understand and work with.

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

Sidebar

Related Questions

I have searched Google and Stackoverflow for this question, but I still don't understand
I've been looking all over StackOverflow and Google for an answer to this question,
I have looked for the answer to this on Google and stackoverflow, but unfortunately
There are a lot of websites that look professional in Google results. Try searching
Searching Google and StackOverFlow comes up with a lot of references to this question.
I thought there would be plenty of results when searching for this on Google,
This may be a basic question but the answer has alluded me so far.
I just go through Google search before posting this question here but I am
From this question:- https://stackoverflow.com/questions/1342611/is-there-a-webservice-api-to-grab-a-screenshot-of-another-website and some other questions/google I got some results like:-- http://www.bitpixels.com/
I saw this Stack Overflow Question but I cannot find the answer to 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.