Implementation of LucasKanade algorithm with pyramids to calculate optical flow and predict future frames