I am trying to back projecting the densified point cloud into the original images, but I found some issues. In the following, I describe the procedure that I am following:
Firstly, I import the point cloud (in XYZ format) and I subtract the offset read from the project_name_offset.xyz file. Thus i transform the cloud points into the camera that of interest by using the formula shown in the code snippet. CalibData.cam_R and CalibData.cam_t are the position and orientation of the camera extracted from the file project_name_calibrated_camera_parameters , Rx is the rotation around the X axis of the camera, and pt is the point that I want to back-project.
Thus, I transform the point from 3D to 2D according to the standard pinhole model and distortion parameters. Similarly, all the intrinsic parameters are the ones read from the project_name_calibrated_camera_parameters file.
All the formulas I used are the ones described in the pix4d tutorials here:
The result is the following:
The images are slightly misaligned. I also tried by removing the Rx transformation but the output is even worse. What am i doing wrong?