NVlabs / PWC-Net

PWC-Net: CNNs for Optical Flow Using Pyramid, Warping, and Cost Volume, CVPR 2018 (Oral)
Other
1.63k stars 357 forks source link

Confirm how to use the result flow to warp another image(Pytorch). #104

Open Lucksong opened 4 years ago

Lucksong commented 4 years ago

Hi, thanks for your code. I just want to confirm how the obtained optical flow should be used to image warp.

script_pwc.py './data/frame_0010.png' './data/frame_0011.png' './tmp/frame_0010.flo'

As the code shows above, if I want to warp image with the result flow, which of the following should I do? frame_0010 + flow = frame_0011 or frame_0011 + flow = frame_0010? Whether the optical flow is expressed in the form of (u,v) which represents horizontal(cols) and vertical(rows) offsets, respectively? I see that the flow is stored in this form in script_pwc.py. Thanks very much.

Lucksong commented 4 years ago

Any one can help me? I think frame_0010 + flow = frame_0011 is right since I have tried to warp in this way and got an image similar to frame_0011.