1. A method for processing images, comprising: obtaining, from an optical stereo sensor, at least two images, applying an image warping function to at least one of the two images to compensate a distortion in the image by modifying the image, calculating, by a processing unit, and outputting a depth and/or disparity image from the modified image and at least one other image of the at least two images, and correcting, the depth and/or disparity image by subtracting shifts introduced due to the warping function application.