1. A method of determining depth in images, comprising: generating an image mask indicating smooth areas and object edges for each of a pair of stereo images; distinguishing between the smooth areas and the object edges as a function of pixel curvature; aggregating curvature values over a predetermined window; generating a curvature map for the each of a pair of stereo images; and generating the image mask from the curvature map; calculating a computation cost for a plurality of pixels within the image mask; and matching pixels between the each of a pair of stereo images and optimizing a value for the matching pixels to obtain an estimated depth map.