# Find direction from cameraMatrix and distCoeff

Hi Guys,

I have calibrated my camera by detecting checkerboard patterns and running calibrateCamera, retrieving the cameraMatrix and distortion coefficients. These I can plug into project points alongside 3D positions in the cameras space and retrieve the UV where the point is projected into the imperfect camera.

Im using a 3D point that projects into a point near my top left image coordinate corner.

This is all fine, but now I want to go the other way and convert a point in my distorted U,V coordinate into a directional vector pointing at all the points that would be projected into this UV coordinate.

I have tried playing around with the undistortPoints function, to find the ideal points U,V and from those use the cameraMatrix to find a point somewhere along the line, picking values from the cameraMatrix.

X = (U-C_x)/f_x Y = (U-C_y)/f_y Z = 1

But I can't seem to hit a direction that is pointing very close to the 3D point i started from.

Any idea what I might be doing wrong?

kind regards

Jesper Taxbøl