1. A method for processing a sequence of images, comprising: obtaining, from an optical sensor, at least two images of the sequence of images, determining an image warping function that at least partially compensates a distortion in at least one of the images, applying the determined warping function to the at least one image, at least partially compensating the distortion by modifying the image, and calculating and outputting an optical flow as a displacement vector field form modified image and another image of the at least two images.