PROBLEM TO BE SOLVED: To acquire an image when a light source is on and an image when the light source is off while suppressing the deterioration of a frame rate that can be used for visual line detection even when timings are different between an imaging operation of an imaging device and a blinking operation of the light source.SOLUTION: A visual line detection device for acquiring a moving image in which an imaging device images a subject at a predetermined frame rate, and detecting a visual line of the subject on the basis of the acquired image includes: an extraction part for extracting an image taken while a light source is on and/or off on the basis of the brightness of the image of a plurality of images that the imaging device takes at the predetermined frame rate, of the subject illuminated by the light source that repeats turning on and off at a time interval longer than at least a two-frame time or more an acquisition part for acquiring a combination of the image taken while the light source is on and the image taken while the light source is off, which are extracted by the extraction part and a removal part for generating an image in which an image by an ambient light reflected in glasses of the subject is removed on the basis of a difference between the information indicated by the image taken while the light source is on, and the information indicated by the image taken while the light source is off, of each acquired combination.SELECTED DRAWING: Figure 1COPYRIGHT: (C)2018,JPO&INPIT【課題】撮像装置の撮影動作と光源の点滅動作とタイミングが互いに異なる場合でも、点灯中の画像および消灯中の画像を視線検出に利用可能なフレームレートの低下を抑え、取得することを目的とする。【解決手段】撮像装置が被写体を所定のフレームレートで撮影した動画像を取得し、取得した画像に基づいて被写体の視線を検出する視線検出装置であって、少なくとも2フレーム時間以上の時間間隔で点灯と消灯とを繰り返す光源に照らされた被写体を、所定のフレームレートで撮像装置が撮影した複数の画像のうち、画像の輝度に基づいて光源の点灯中または及び消灯中に撮影された画像を抽出する抽出部と、抽出部により抽出された点灯中の画像と消灯中の画像との組合せを取得する取得部と、取得した各組合せの点灯中の画像と消灯中の画像とが示す情報の差分に基づいて、被写体の眼鏡に映り込む周囲の光による像が除去された画像を生成する除去部とを有する。【選択図】図1