Ask Your Question

Revision history [back]

I have a question regarding the imagepoints output of the projectPoints() funtion in open CV. I am getting image points which have negative coordinates and I understand that they are outside the screen area definitely.

So, what should be the maximum range of outputs for the imagePoints for them to be on the screen? Will it be u= 1280 and v=720 if I am using it for an image that has 1280 pixels width and 720 pixels height?

For a clearer exposition of my problem I add the following details,

camera_distCoeffs: [0.045539, -0.057822, 0.001451, -0.000487, 0.006539, 0.438100, -0.135970, 0.011170]

camera_intrinsic: [606.215365, 0.000000, 632.285550, 0.000000, 679.696865, 373.770687, 0.000000, 0.000000, 1.000000]                          

Sample camera coordinate: [16.7819794502, -2.2923261485, 2.9228301598] with orientation quaternions:[Qx,Qy,Qz,Qw] as [0.0075078838, 0.062947858, 0.3573477229, -0.9318174734]

I am forming my rotation vector (rvec) by first converting the quaternions to rotation matrix and then calling the Rodrigues() function. I am constructing the translation vector as tvec=-(transpose of rotation matrix)*[column vector of camera cordinates]

Also, from what I understand the pinhole camera model used in the projectPoints() function has the camera aperture as the origin. So does it mean that the input parameter 'objectPoints' should be (x-x1, y-y1, z-z1) in my case where the camera is not the origin ? for brevity, here (x1,y1,z1) is camera coordinate in world frame and (x,y,z) is target object coordinate in world frame.