We introduce a functional for image segmentation which takes into account the occlusions between objects in the image which are located at different depths in space. By minimizing the functional, we try to reconstruct both a piecewise smooth approximation of the input image g and the contours of the objects together with their hidden portions. Some variational properties of the involved functionals are then studied.