The present invention relates to automatic registration and tracking of the eyes of at least one subject. An optical system, including a lens structure, a mask and an image sensor, receives incoming light from a scene containing the subject and directs at least a portion of this light towards the image sensor, which registers spatially distributed light and thus produces primary data. The mask is to alter a basic optical transfer function of the lens structure and the image sensor into an enhanced optical transfer function, which is substantially less sensitive to variations of an unknown distance between the optical system and the subject than the basic optical transfer function. The processing unit is to receive the primary data and process this data to produce resulting eye-tracking data representing a position estimate of the at least one eye and/or a gaze direction for the at least one eye.