1. A computer implemented method for three dimensional (3D) image processing, the method comprising: receiving an image, wherein each location in the image comprises a value indicative of a depth of a pixel in a scene, and wherein each value has an associated confidence measure; determining whether each similarity region of a plurality of non-overlapping similarity regions in the image is valid or invalid based on a number of values in the similarity region having sufficiently high confidence measures, wherein a similarity region consists of contiguous locations in the image having similar values; and indicating that the values in a similarity region are invalid when the similarity region is determined to be invalid.