A terminal device includes a computer processor, the device includes: an obtaining unit configured to obtain information indicating a state of an imaging unit when photographing a subject; a determining unit configured to determine whether an image photographed by the imaging unit includes blurriness due to shaking of the imaging unit based on the obtained information; and a detecting unit configured to use an image determined as not including blurriness to detect a line of sight of the photographed subject.