Simple Particle Image Velocimetry algorithm demo based on zero-mean cross correlation.
N gaussian particles are located randomly in the first frame. We applied an Affine transformation to the first frame to generate the second one. Gaussian noise is added.
Frames are subdivided in smaller region of interest (ROI). We compute the zero-mean cross correlation (ZMCC) with Fast Fourier Transform on each ROI two by two (ROI_frame_1, ROI_frame_2). The displacement is estimated by finding the location of the maximum in the result of the ZMCC.
We tested different motions :