1

I have some 2D points set (X,Y) corresponding to a 3D points set (X,Y,Z). 2D points were captured from camera and 3D points were the real coordinate according to world base. I want to find the transformation matrix between them, that is to say, how to convert other 2D points to 3D points.

I have try getPespectiveTransform function, but it didnt work in this problem.

How can I write a regression to find this transform matrix ?

Lion Kuo
  • 189
  • 1
  • 11
  • http://docs.opencv.org/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html#calibratecamera – IdeaHat Dec 15 '14 at 19:44
  • Though it should be noted that a point in an image corresponds to a ray in 3D space, so you'll haver get a "transform" between the two...You can (essentially) find the ray the 3D point would intercept and map that to an into 2D space, but it is non-trivial to go the other way. – IdeaHat Dec 15 '14 at 19:46
  • I mean that I have two points set, one is 2d (x,y) and another is 3d(x,y,z). I want to find the relationship between those two set, and i dont use any camera calibration to trans. – Lion Kuo Dec 15 '14 at 20:48
  • Sorry for my poor english – Lion Kuo Dec 15 '14 at 20:49
  • This seems like a problem for `solvePnP` (see [here](http://docs.opencv.org/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html#solvepnp)). You need to know the camera matrix and intrinsics coefficients though. – BConic Dec 16 '14 at 08:13

1 Answers1

2

You can use solvePnP of OpenCV, it gives you rotation and translation matrix. In this answer you can see in more detail: Camera position in world coordinate from cv::solvePnP

Community
  • 1
  • 1