Confusing 3d to 2d point projection

asked 2019-06-25 04:30:41 -0500

claude gravatar image

updated 2019-06-25 06:26:47 -0500

Im getting confused with a case of 3d to 2d projection.

Say i have a camera located at the position x=0, y=-50, z=100 and rotation (PI,0,0) with some intrinsic camera matrix and distortion coefficients.

if i project the point (0,0,0) into the camera plane i should see it somewhere on the topside of the screen, as the camera is shifted away from the origin. If i nowchange the orientation of the camera to (PI,0,PI) i would expect to see the point projected to the other side of the screen, as i have now rotated 180. However, using cv::projectPoint this does not seem to be the case. In fact, no matter what Z Angle i select im getting the point at the same 2d position.

Am I doing something wrong or is this how it's supposed to work? Why is the point not rotating around when i rotate my camera (by rotating the extrinsics) C:\fakepath\rotation.png

EDIT: This is not working as expected because the R/t convention of the extrinsics correspond to a rotation followed by a translation. https://docs.opencv.org/2.4/modules/c...

This is different than applying a homogenous transform which first translates then rotates.

To get the effect i desire i must first apply a 4x4 matrix transform T to the point (0,0,0,1) transforming it into the cameras coordinate system. Then i can use cv::projectPoint with the intrinsic matrix and a Rvec(0,0,0) and tvec(0,0,0) to project the point into pixel coordinates.

my tests seem to work,but can someone confirm this to me?

Regards

Claude

edit retag flag offensive close merge delete