haofeixu / aanet

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

About the warp direction #42

Closed zcong17huang closed 3 years ago

zcong17huang commented 3 years ago

Hello @haofeixu . Thank you for the paper and the code. In your code https://github.com/haofeixu/aanet/blob/master/nets/warp.py line 55 offset = torch.cat((-disp, torch.zeros_like(disp)), dim=1) # [B, 2, H, W] Here you warp the right img to match the left, so the right one should do right shift operation. So I think here should be disp, not -disp. Is it right?

haofeixu commented 3 years ago

The disparity map is relative to the left image (i.e., left x coordinate - right x coordinate = disp (positive)), so to find the correponding pixel on the right image, we should do x - disp.

zcong17huang commented 3 years ago

The disparity map is relative to the left image (i.e., left x coordinate - right x coordinate = disp (positive)), so to find the correponding pixel on the right image, we should do x - disp.

Yes, you are right. I have found my mistake. Thank you very much.