pathak22 / pyflow

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

Understanding the output npy array #23

Open Anirudh58 opened 5 years ago

Anirudh58 commented 5 years ago

Feeding 2 images of resolution 240x320 is generating a .npy array of shape (320, 240, 2) containing positive and negative values. I want to feed these as features for an action modeling problem. I want to get a better idea of what these values actually mean. Is it the distance moved by that particular pixel in the next frame? or coordinate? Would really appreciate if someone could give me clarity. Thanks, in advance.

varununayak commented 4 years ago

I believe that the HXW dimensions are preserved (and not transposed).

For each pixel, optical flow is parameterized as follows [1]: one channel to specify the orientation (direction of motion in pixel space) and the other for the magnitude of motion.

[1] https://people.csail.mit.edu/celiu/OpticalFlow/