1. A system for computing a depth map comprising depth values representing distances to a viewer for one or more of a plurality of pixels of an image, the system comprising: an optimization unit for defining a neighborhood of a current pixel of the plurality of pixels and for determining a depth related cost value of the current pixel, the depth related cost value being a minimal cost value among cost values of first pixels selected from the plurality of pixels in the neighborhood of the current pixel based on a difference between a color attribute of the first pixels and a corresponding color attribute of the current pixel, and second pixels selected from the plurality of pixels outside the neighborhood based on a difference between the color attribute of the second pixels and a corresponding color attribute of the current pixel, wherein the pixels in the neighborhood of the current pixel are within a predetermined distance from the current pixel and the pixels outside the neighborhood are further than the predetermined distance from the current pixel; and an assigner for assigning a depth value to the current pixel in dependence on the determined depth related cost value.