jmccormac / pySceneNetRGBD

Scripts showing how to work with the SceneNetRGBD dataset
GNU General Public License v3.0
178 stars 46 forks source link

world_to_camera_with_pose, lines 63 and 64 #36

Open VjayalakshmiK opened 4 years ago

VjayalakshmiK commented 4 years ago

I use this dataset for a warping exercise, where I use the world points estimated from frame0, for example, transform them to the camera of frame25 and thus warp frame25. I warp successive frames in a similar manner. I find that the warped images move in opposite direction to what can be seen in the rendered frames. While trying to debug this, I found that the way the R matrix is calculated in the function in question is different from other literature and websites that I referred.
The difference is: ( In calculate_optical_flow.py )

Line 63- The code takes cross product between R[2,:3] and up. But I find it to be between up and R[2,:3] in websites. Cross product is anti-commutative, so that makes a difference.

Besides, in Line 64 there is a negative sign to compensate for the order of cross product. I found Cross product to be between R[2:3] and R[0,:3], and in the code it was accordingly -( R[0,:3] x R[2,:3] ).

Is there a reason why the cross products have been calculated this way in the code? Will it still correspond to the transform matrix found in literature? Also, is the system left handed?