1. A system for computing a depth map comprising depth values representing distances to a viewer for respective pixels of an image, the system comprising: an optimization unit ( 902 ) for determining a depth related cost value of a current pixel, the depth related cost value being a minimal cost value among a plurality of candidate cost values, wherein at least one of the candidate cost values is based on a depth related cost value of at least one pixel in a local neighborhood of the current pixel and on a difference between a color attribute of the at least one pixel in the local neighborhood and a corresponding color attribute of the current pixel, and at least one of the candidate cost values is based on a depth related cost value of at least one pixel outside the local neighborhood and on a difference between a color attribute of the at least one pixel outside the local neighborhood and a corresponding color attribute of the current pixel; the system further comprising an assigner ( 904 ) for assigning a depth value to the current pixel in dependence on the determined depth related cost value.