scivision / pyoptflow

Optical Flow estimation in pure Python
Apache License 2.0
76 stars 19 forks source link

Partial time derivative in Horn Schunck method #5

Open stefanieberger opened 4 years ago

stefanieberger commented 4 years ago

Hi,

I have a question regarding the HornSchunck method and the partial time derivative:

ft = im2 - im1

ft = filter2(im1, kernelT) + filter2(im2, -kernelT)

with kernelT = np.ones((2, 2))*.25

If my understanding is correct, you substract the values from the second image from the ones in the first image. In the Horn und Schunck paper I understood that you are supposed to do it the other way around.

Could you maybe tell me, if I understood it wrong or what the reasoning is to put this the other way around?

I also tried implementing the method myself, and exactly this issue seems to be my problem. If I implemented this with the minus sign in the im2 kernel, my directions are correct. I just donot understand why that is the case.

Thank you and greetings!

scivision commented 4 years ago

This may be a mistake on my part, I will have to look into it. Thanks!

scivision commented 3 years ago

I compared results with a couple different image pairs between 3 implementations, using matlab/RunHornSchunck.m.

This includes Matlab Computer Vision toolbox.

The plots appear similar qualitatively.