pathak22 / pyflow

Fast, accurate and easy to run dense optical flow with python wrapper
Other
646 stars 139 forks source link

Warping different image using OpticalFlow #11

Open CJHFUTURE opened 6 years ago

CJHFUTURE commented 6 years ago

Hi, I'm just wondering if you think I could modify this to calculate the optical flow for 2 images(As it currently does) but warp a third image of my choosing, instead of the first image(as it currently does)?

Thanks in advance.

juliohm commented 6 years ago

I have the same question, and this seems like a very common use case. Could you please share what can be done?

juliohm commented 6 years ago

Nevermind, I found this example in opencv, the function warp_flow should do the job: https://github.com/opencv/opencv/blob/master/samples/python/opt_flow.py#L50-L56

Will try it later, may also switch to the Farneback method implemented therein.