1. A computer-based method of computing a disparity value of a pixel, the method comprising: inputting two input images; computing from the input images a plurality of first costs for the pixel, each cost being associated with a region of a first type selected from a plurality of regions of the first type, the regions of the first type being overlapping with and including the pixel, the regions being substantially equal in size and shape; computing from the first costs for the pixel a plurality of second costs, each cost being associated with a region of a second type of a plurality of regions of the second type, the regions of the second type being overlapping with and including the pixel, at least some of the regions of the second type having a substantially different size and/or shape; selecting from the second costs the minimal cost; and selecting the corresponding disparity value as the disparity value.