Ask Your Question

World Co-ordinates and Object Co-ordinates

asked 2015-10-14 02:51:11 -0500

MRDaniel gravatar image

updated 2015-10-14 04:18:10 -0500


I am working with cv::SolvePnp(), cv::ProjectPoints(). We are working with a fully calibrated camera with known camera matrix and distortion coefficients.

Given a detected marker, it is possible to get the rvec and tvec for a given 3D model.

This has been done for two types of model, a board model and a ball model. We then get three sets of tvecs/rvecs, one for the board and then two more models for the balls. As shown below.....

image description

How do we relate these? We can project the model points into the image usings the result of solvepnp.

How do the rvecs and tvecs relate in this case? Is it possible to get the location of each ball on the board in terms of it's x,y,z location relative to the board model?

image description

The board is shaped as (0,0), (1,0), (1,1), (0,1).

The ball are circles centered at 0, with radius 0.1, which is in scale with the real world objects.

Process so far....

  • Detect board corners.
  • Detect ball locations, and fit a circle.
  • Calculate rvecs and tvecs for board and the two balls.
  • Use projectPoints to project model into image.

Can we get more information on where the balls are on the board? The ultimate aim is collision detection/prediction once locations and velocity are determined.

Kind regards,


edit retag flag offensive close merge delete



Awesome. I think that is exactly what i need. What is this process called? How do i find out more about it?

MRDaniel gravatar imageMRDaniel ( 2015-10-14 07:27:47 -0500 )edit

You mean homogeneous transformation matrix ?

To inverse an homogeneous transformation matrix (page 10) (R | t ; 0 | 1), you can use the formula: (R | t ; 0 | 1)^-1 = (Rt | -Rt.t ; 0 | 1)

Eduardo gravatar imageEduardo ( 2015-10-14 08:03:08 -0500 )edit

@Eduardo Why you don't convert your comment to answer ? @MRDaniel if it's works please accept the answer... thank you

pklab gravatar imagepklab ( 2015-10-14 11:10:39 -0500 )edit

@Eduardo@pklab Yup, i am happy to mark this as the correct answer! :)

MRDaniel gravatar imageMRDaniel ( 2015-10-14 23:36:17 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2015-10-14 06:43:02 -0500

Eduardo gravatar image

updated 2015-10-15 04:20:24 -0500

If you have the pose for the board:

  • image description

and the poses for the two balls:

  • List item and image description,

that means that you can reproject the models of the board and the balls in the image): image description,

it should be possible to have the pose for the balls with respect to the board frame as:

  • image description
  • image description.

You can transform a 3D coordinate expressed in a specific frame to another frame as for example: image description

An homogeneous transformation matrix is composed of a rotation part and a translation part: image description

The inverse of an homogeneous matrix can be calculated easily as: image description

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2015-10-14 02:51:11 -0500

Seen: 436 times

Last updated: Oct 15 '15