1. A method, comprising: detecting contours in a first image; determining at least one sampling step size based on the detected contours; selecting a plurality of reference pixels in said first image based on the detected contours and the at least one sampling step size; associating with each reference pixel a respective pixel in a second image; determining a disparity between each reference pixel and the respective associated pixel in said second image; and determining for each reference pixel a depth value as a function of the respective disparity.