1. A computer-implemented method for stereo matching, the method comprising: iteratively estimating a minimum energy for both occlusion and disparity for at least two views of an image using belief propagation, wherein the minimum energy is based on an energy minimization framework in which a visibility constraint is embedded.