P_cam_nwu = np.asarray([[0, -1, 0, 0],
[0, 0, -1, 0],
[1, 0, 0, 0],
[0, 0, 0, 1]], dtype=pc_np.dtype)
P_nwu_cam = np.linalg.inv(P_cam_nwu)
# now the point cloud is in CAMERA coordinate
Pr_Pcamnwu = np.dot(Pr, P_cam_nwu)
pc_np = transform_pc_np(Pr_Pcamnwu, pc_np)
sn_np = transform_pc_np(Pr_Pcamnwu, sn_np)
# assemble P. P * pc will get the point cloud in the camera image coordinate
PcPnwucamPrinv = np.dot(Pc, np.dot(P_nwu_cam, Pr_inv))
P = np.dot(Pji, PcPnwucamPrinv) # 4x4
May I ask if there is something wrong in my understanding, if so, Could you please give me a brief explanation?
Thank you in advance and look forward to your reply.
Hi,
I really appreciate your work.
I'm reading your code about calculating the Transformation from Velodyne to the camera image plane at code,
but I get confused.
For convenience, I capture part of the code below:
P_cam_nwuis actually close to Tr in calib.txt, representing the coordinate transformation from velo to cam.Pris the random rotation matrixPcisP2 @ TrorP3 @ Tr, representing the transformation from velo coordinate to the camera image plane (2 or 3)Pjiis the relative pose, j'th frame wrt. i'th frameP = Pji @ Pc @ P_nwu_cam @ Pr_invis equivalent toP = Pji @ (P2 @ Tr) @ (Tr_inv) @ Pr_inv = Pji @ P2 @ Pr_invassemble Pcan transform i'th frame in Velodyne coordinate into j'th frame in camera image plane (include random rotation).Tr)?P = Pji @ P2 @ Tr @ Pr_inv?pc_np = transform_pc_np(Pr_Pcamnwu, pc_np)is equivalent topc_np = Pr @ P_cam_nwu @ pc_npPris the random transform on points under the camera coordinate rather than the NMU coordinate? (annotation at Line 352)May I ask if there is something wrong in my understanding, if so, Could you please give me a brief explanation?
Thank you in advance and look forward to your reply.