As illustrated in FIG. 10, controller 30b selects a reference line that is pixel row 22 serving as a reference used to compare the correlation with other pixel rows 22 (S110). Determination unit 32 selects the reference line in the frame for each frame from the plurality of pixel rows 22. An example of the control for selecting 10 reference lines will be described. Determination unit 32 previously includes a head line (pixel row 1 in FIG. 11) as the reference line, arbitrarily selects 9 rows from N columns of pixel row 22 in FIG. 11, and selects the reference lines different from each other in each of 10 consecutive frames. The reference line is an example of the first pixel row. FIG. 11 illustrates only one reference line in the selected 10 reference lines. The same also applies to FIG. 13 (to be described later).
Determination unit 32 determines whether the reference line selected in step S110 is the head line (S120). The head line is an example of the predetermined pixel row that is previously determined. An example in which the predetermined pixel row is the head line (uppermost pixel row 22) will be described below. However, the predetermined pixel row may not be pixel row 22 located at the head as long as the predetermined pixel row is the pixel row 22 previously selected from the plurality of pixel rows 22. The number of predetermined pixel rows is not limited to one, but at least two predetermined pixel rows may be selected.