jmccormac / pySceneNetRGBD

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

Incorrect intrinsics #29

Open t-martyniuk opened 4 years ago

t-martyniuk commented 4 years ago

I wonder if the intrinsics of the camera are correct.

[[277.12812921 0. 160. 0. ] [ 0. 289.70562748 120. 0. ] [ 0. 0. 1. 0. ]]

I use SceneNet (val set), 485 folder, 4650 and 4675 frames. I visualize these 2 rgb-d images as pointclouds. And I see an obvious distortion, but distortion coefficients are not provided anywhere.

Could you elaborate?

Screenshot from 2019-11-06 17-11-07

Blistic commented 4 years ago

The instrinsics appear correct, but it looks like for the back-projection you are taking depth to be z-planar distance (which is the case for the kinect camera and hence, many datasets). In 'SceneNetRGBD' however, if you look at this part of the readme the 'depth' information specifies that the distance is euclidean distance from the camera center, not just the z-component of the point in camera space. This means that far away from the camera's principal axis, the 'distance' will appear greater than it would if it followed the z-planar depth, which causes the radial distortion you see.

The optical flow script in this repository contains code which can help get from the depth images to a 3D point cloud, which may be a useful reference for you. On line 240 the variable points_in_camera is an array of the 3D back projected points which adhere to the euclidean distance definition and so will not show that distortion. You can ignore many other parts of the script except the ones used to calculate that variable, so you can focus on line 227 and lines 232 to 240 and the functions they call.

VjayalakshmiK commented 4 years ago

@t-martyniuk I have some issues too with going from 2D to 3D points in world. I would like to discuss this with you. Will it be possible to contact you, via an email id maybe?