A computer-implemented method for learning a function configured for reconstructing, for a class of real objects, wherein the class of real objects is a class of human bodies, a 3D modeled object that represents an instance of the class from a depth map of the instance, wherein the depth map of the instance is acquired by a depth sensor, the 3D modeled object modeling the 3D shape of the instance in the pose of the instance as represented by the depth map, the method comprising: - providing (S10) a parametric model of the class having shape and pose parameters; - creating a database, the creation of the database including: ▪ varying (S22) parameters of the parametric model to generate 3D modeled objects that each represent a respective instance of the class; ▪ synthesizing (S24), for each generated 3D modeled object, a respective depth map of the respective instance represented by the generated 3D modeled object; ▪ associating (S26) each synthesized depth map to a corresponding generated 3D modeled object; and - learning (S30) the function based on the database; wherein synthesizing a respective depth map for each generated 3D modeled object includes: - providing (S242) a virtual viewpoint; and - determining (S244) a theoretic depth map that represents exact depth from the virtual viewpoint to the generated 3D modeled object; wherein synthesizing a respective depth map for each generated 3D modeled object further includes adding (S246) a perturbation to the theoretic depth map at least at locations that correspond to contours of the generated 3D modeled object; and wherein adding a perturbation includes adding a random noise to the depth map; the addition of the random noise corresponding mathematically to: I ij = I ij + ∇ I ij ∇ I max ∗ N ij where / ij is an i × j pixel location depth value in the depth image, ∇ I ij /∇ I max is a normalized depth image gradient value at the i × j pixel location, and N ij is a real number sampled from a Gaussian distribution with mean 0 and variance between 1 and 5 cm. - providing (S10) a parametric model of the class having shape and pose parameters; - creating a database, the creation of the database including: ▪ varying (S22) parameters of the parametric model to generate 3D modeled objects that each represent a respective instance of the class; ▪ synthesizing (S24), for each generated 3D modeled object, a respective depth map of the respective instance represented by the generated 3D modeled object; ▪ associating (S26) each synthesized depth map to a corresponding generated 3D modeled object; and ▪ varying (S22) parameters of the parametric model to generate 3D modeled objects that each represent a respective instance of the class; ▪ synthesizing (S24), for each generated 3D modeled object, a respective depth map of the respective instance represented by the generated 3D modeled object; ▪ associating (S26) each synthesized depth map to a corresponding generated 3D modeled object; and - learning (S30) the function based on the database; - providing (S242) a virtual viewpoint; and - determining (S244) a theoretic depth map that represents exact depth from the virtual viewpoint to the generated 3D modeled object; <EOS>