Abstract: A device, for contactless optical recording of a papillary structure of a hand or parts thereof, includes a lighting unit illuminating the hand or parts thereof with emitted structured light, and a camera detecting structured light emitted from the lighting unit, which is diffusely reflected from the hand or parts thereof in an object plane of the camera. A nonzero difference in distances between the camera along an optical axis of an optical path of the camera and the lighting unit along an optical axis of an optical path of the lighting unit from the object plane of the camera is present in order to determine a position of the hand or parts thereof along the optical axis of the optical path of the camera in relation to a range of depth of field of the camera using a structure size determined in the light detected by the camera.