Subsequently, the correlation is sequentially determined in the column direction. Determination unit 32 determines whether the line (pixel row 22) immediately below the head line has the correlation with the reference line (S144). In the second exemplary embodiment, the line immediately below the head line is the reference line (pixel row 2) selected in step S110. When the negative determination is made in step S141, for example, when the reference line is located at a scanning position of the initial reference line (the reference line selected in step S110, pixel row 2 in the part (a) of