1. A method, comprising: performing, by one or more computer devices: identifying one or more invalid disparities in a disparity map of an image, wherein the disparity map indicates a disparity for each pixel in the image, wherein each disparity indicates an offset from a corresponding pixel in the image to a pixel in another image; segmenting the image into a plurality of segments according to pixel values in the image, where each segment includes pixels in the image with substantially similar values; identifying one or more outlier disparities in the disparity map according to a statistical analysis technique applied to each of a plurality of regions of the disparity map, wherein the plurality of regions correspond to the plurality of segments; and correcting the identified one or more outlier disparities and the identified one or more invalid disparities according to valid disparities in the disparity map to generate a corrected disparity map for the image.