haofeixu / aanet

[CVPR'20] AANet: Adaptive Aggregation Network for Efficient Stereo Matching
Apache License 2.0
524 stars 102 forks source link

point cloud from disparity image #37

Closed xmba15 closed 4 years ago

xmba15 commented 4 years ago

Hi @haofeixu. Thank you for the paper and the code. I tested the code on my stereo image and the disparity image looked nice. However, when I tried to create point cloud from the disparity (with the calib param) the point cloud looked kinda weird. Do I need to scale disparity image estimated by aanet before using it to form the point cloud. As in OpenCV, the disparity image needs to be downscale by 16.0.

Here is the disparity estimated by aanet disparity

But the point cloud is like this :(

screenshot-1598249236

xmba15 commented 4 years ago

I just notice disparity is multiplied by 256 before being saved. https://github.com/haofeixu/aanet/blob/master/predict.py#L195

Should I divide the disparity image by 256 then?

haofeixu commented 4 years ago

Hi @xmba15 , the disparity map is saved as KITTI format (multiplied by 256 and saved as uint16) by default. You can refer to this code to get the correct disparity values.

xmba15 commented 4 years ago

@haofeixu thanks for the reply and also, Im sorry for replying this late. I understand that the disparity map is saved as KITTI format (multiplied by 256 and saved as uint16)

However, I would like to notice here that (in case someone else also wants to use this to produce pseudo-lidar pointcloud), to use the disparity to do projective transform to get the depth value, you can not multiply by 256 (disparity multiplier), but use the disparity as it is instead.

xmba15 commented 4 years ago

@haofeixu I just came back to say that aanet is so awesome. look at the point cloud I got from stereo images of driving stereo dataset with the weight from aanet model zoo. Thanks for the hard work.

aanet_pointcloud

haofeixu commented 4 years ago

Thanks @xmba15 ! Great to see your progress, cheers!