1. A method for processing images to generate a disparity/depth image reconstructing a 3D scene layout, the method comprising: obtaining, from an optical stereo sensor, at least two images captured at a same time, applying an image warping function to at least one of the two images to compensate a distortion in the image by modifying the image, determining, by a processing unit, patches corresponding to each other in the modified image and at least one other image of the at least two images, wherein a patch comprises an area comprising plural pixels with a same depth around a pixel, calculating a disparity of pixels corresponding to each other between one and the other of the determined patches, correcting, the calculated disparity by subtracting a shift of each pixel's position in a surface of the modified image, the shift introduced due to the image warping function application, and outputting a depth or disparity image from the modified image and the at least one other image of the at least two images based on the corrected disparity, wherein in addition to the computation of the depth or disparity image from the modified image, a further depth or disparity image from the unmodified at least one other image is calculated, and wherein the results are merged into one disparity/depth image by a pixel-wise selection from the depth or disparity image from the modified image and the further depth or disparity image.