We introduce a functional for image segmentation which takes into account the transparencies (or shadowing) and the occlusions between objects located at different depths in space. By minimizing the functional, we try to reconstruct a piecewise smooth approximation of the input image, the contours due to transparencies, and the contours of the objects together with their hidden portions. The functional includes a Mumford-Shah type energy and a term involving the curvature of the contours. The variational properties of the functional are studied, as well as its approximation by Gamma-convergence. The comparison with the Nitzberg-Mumford variational model for segmentation with depth is also discussed