OpenCV Q&A Forum - RSS feedhttp://answers.opencv.org/questions/OpenCV answersenCopyright <a href="http://www.opencv.org">OpenCV foundation</a>, 2012-2018.Tue, 21 Feb 2017 08:35:58 -0600Difference between undistortPoints() and projectPoints() in OpenCVhttp://answers.opencv.org/question/129425/difference-between-undistortpoints-and-projectpoints-in-opencv/From my understanding, undistortPoints() takes a set of points on a distorted image, and calculates where their coordinates would be on an undistorted version of the same image. projectPoints() maps a set of object coordinates to their corresponding image coordinates.
However, I am unsure if projectPoints() maps the object coordinates to a set of image points on the distorted image (ie. the original image) or one that has been undistorted (straight lines)?
Furthermore, the OpenCV documentation for undistortPoints states that 'the function performs a reverse transformation to projectPoints()'. Could you please explain how this is so?rueynshardTue, 21 Feb 2017 08:35:58 -0600http://answers.opencv.org/question/129425/Find direction from cameraMatrix and distCoeffhttp://answers.opencv.org/question/96359/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ølTAXfromDKMon, 13 Jun 2016 15:54:11 -0500http://answers.opencv.org/question/96359/