sniklaus / pytorch-pwc

a reimplementation of PWC-Net in PyTorch that matches the official Caffe version
GNU General Public License v3.0
616 stars 123 forks source link

Save flow as image (RGB) #5

Closed Wazaki-Ou closed 6 years ago

Wazaki-Ou commented 6 years ago

Hello there,

I was wondering if there is a way to save the flow between two images as an image as well instead of saving it as a .flo file. Do you have any code for that or any recommendation ?

Thank you

sniklaus commented 6 years ago

You could adopt the visualization in the "Dense Optical Flow" section at the following link, which uses a color coding for the magnitude / angle: https://docs.opencv.org/3.4.0/d7/d8b/tutorial_py_lucas_kanade.html

Wazaki-Ou commented 6 years ago

Thank you !! I actually did it that way but the resulting RGB shows colors over s dark background as opposed to the example you give where the background is white.

seanremy commented 5 years ago

I've struggled to get that to work as expected. I visualized it another way, but it would be really nice to have the code snippet that generates the nice views you have.

sniklaus commented 5 years ago

I am afraid that the code in question originates from the Middlebury benchmark for optical flow, and I am not sure whether I am allowed to share it. However, you could get in touch with Daniel Scharstein and kindly ask him to share it with you as well.

seanremy commented 5 years ago

Ah, fair enough. Thanks!