A line scan imager is used to determine the motion of a subject. Each line of image data from the line scan imager is compared with a reference image. The location of a matching line in the reference image reveals the displacement of the subject. The current subject displacement can be determined based on each line of image data. The resulting displacement information can be used to correctly place other optical beams on the subject. The method can be applied to tracking the human eye to facilitate measurement, imaging, or treatment with a beam of optical radiation.