I am trying to verify a solution to deprojecting a pixel point (u,v) into a 3D world location (x,y,z) using only the camera's extrinsic rotation and translation in addition to (u,v).
I have modeled the problem in Unreal, where I have a virtual camera with world position (1077,1133,450) and rotation yaw=90, pitch=345, roll=0 degrees. I have an object of known 3D position (923,2500,0) seen by the 1280x720 camera at pixel location (771,426) or frame center position (131,-66).
The transpose of my rotation matrix is:
[[ 5.91458986e-17 9.65925826e-01 -0.00000000e+00]
[-1.00000000e+00 6.12323400e-17 0.00000000e+00]
[-1.58480958e-17 -2.58819045e-01 9.65925826e-01]]
My Tx_Ty_Tz matrix is:
[[-1094.39396119]
[ 1077. ]
[ -141.42464373]]
My dx_dy_dz matrix is
[[ -63.75110454]
[-131. ]
[ 18.0479828 ]]
And I end up with location (-1593,50,0) as the deprojected world coordinate, which is clearly wrong. Is one of my matrices incorrectly calculated? If not, is the method provided flawed / incomplete?