0

is there a function of OpenCV such that with:

  • coordinates of a marker in the image plane
  • extrinsic parameters
  • intrinsic parameters
  • z coordinate (distance between the marker and the cam, because I use sensor kinect)

provides the corresponding world coordinates of the marker?

Any help is much appreciated. Thanks!

Paul
  • 157
  • 1
  • 2
  • 11
  • extrinsic parameters represent the position of the camera relative to some reference. Do you know the distance between the point and the reference in world coordinates? – Hammer Sep 10 '12 at 14:56
  • yes, I use the kinect sensor (I know z coordinate). My question is, is there a function in OpenCv that does the conversion automatically? – Paul Sep 10 '12 at 15:15
  • You need to provide a more specific list of what you know. If you know the z coordinate of the point in question then you know more than the "coordinates of the point in the image plane". What do you know about this point? Its position relative to the origin? Its position relative to the camera? ect. – Hammer Sep 10 '12 at 15:34
  • look at the edit, thanks – Paul Sep 11 '12 at 11:12

1 Answers1

0

To find the world coordinates of the marker you need its coordinates relative to the camera. If you know the camera pose P relative to the origin and the marker pose M relative to the camera, to get the marker pose relative to the origin you simply multiply them together

final = [P]*[M]

It sounds like you are just struggling with finding M. All you need to do is multiply your position by the inverse of the camera matrix and then by your Z coordinate.

Z*cam_mat.inv()*[x_image,y_image,1] = [x_world,y_world,z_world]

M = [1,0,0,x_world,
     0,1,0,y_world,
     0,0,1,z_world,
     0,0,0,1]
Hammer
  • 9,265
  • 1
  • 32
  • 51
  • then, Do I assume that cam and marker system coordinates have same orientation? but is marker translate of x_w, y_w and z_w respect the cam? – Paul Sep 11 '12 at 19:04
  • If all you have is 1 point, then you can't determine the orientation of the point. Do you have multiple points from which you can derive an orientation? Yes, x_w, y_w and z_w is wrt to camera. – Hammer Sep 11 '12 at 19:50
  • then, if I want also orientation of the object (respect at the world coordinate), must I use more markers or one complex marker? – Paul Sep 12 '12 at 13:48
  • Yes, points are defined only in position. Affine transforms can be defined with 3 points and perspective transforms with 4 – Hammer Sep 12 '12 at 14:55
  • thank you, I will try more information on object's orientation – Paul Sep 14 '12 at 07:29