A line-of-sight detection method executed by a computer, the line-of-sight detection method comprising: detecting an eye region of a subject from an image; determining, based on a brightness change in a detection region which is located in the eye region and has a line shape or a band shape, whether a position of a boundary (11a, 11b) between a pupil and an iris is detected in the detection region; executing, in accordance with a result of the determining, both of a first processing in which a position of a center of the pupil is detected based on the boundary between the pupil and the iris, the boundary between the pupil and the iris being detected using a plurality of first templates (271a to 271c), and a second processing in which the position of the center of the pupil is detected based on the boundary between the iris and the sclera, the boundary between the iris and the sclera being detected using a plurality of second templates (272a to 272c) different from the first templates (271a to 271c); weighting a first processing result obtained through the first processing more than a second processing result obtained through the second processing when it has been determined that the position of the boundary (11a, 11b) is detected in the detection region; weighting the second processing result obtained through the second processing more than the first processing result obtained through the first processing when it has been determined that the position of the boundary (11a, 11b) is not detected in the detection region; and detecting a line of sight of the subject based on the position of the center of the pupil detected by the first processing and the second processing. detecting an eye region of a subject from an image; determining, based on a brightness change in a detection region which is located in the eye region and has a line shape or a band shape, whether a position of a boundary (11a, 11b) between a pupil and an iris is detected in the detection region; executing, in accordance with a result of the determining, both of a first processing in which a position of a center of the pupil is detected based on the boundary between the pupil and the iris, the boundary between the pupil and the iris being detected using a plurality of first templates (271a to 271c), and a second processing in which the position of the center of the pupil is detected based on the boundary between the iris and the sclera, the boundary between the iris and the sclera being detected using a plurality of second templates (272a to 272c) different from the first templates (271a to 271c); a first processing in which a position of a center of the pupil is detected based on the boundary between the pupil and the iris, the boundary between the pupil and the iris being detected using a plurality of first templates (271a to 271c), and a second processing in which the position of the center of the pupil is detected based on the boundary between the iris and the sclera, the boundary between the iris and the sclera being detected using a plurality of second templates (272a to 272c) different from the first templates (271a to 271c); weighting a first processing result obtained through the first processing more than a second processing result obtained through the second processing when it has been determined that the position of the boundary (11a, 11b) is detected in the detection region; weighting the second processing result obtained through the second processing more than the first processing result obtained through the first processing when it has been determined that the position of the boundary (11a, 11b) is not detected in the detection region; and detecting a line of sight of the subject based on the position of the center of the pupil detected by the first processing and the second processing.