1. An eyelid detection apparatus comprising: a generating means for generating an edge image representing a magnitude of pixel value change per pixel in a predetermined direction in a region including an eye, based upon an image of the region including the eye; a local peak value point searching means for searching a local peak value point, where the magnitude of pixel value change reaches a local peak value in the predetermined direction, in the edge image generated by the generating means; and a boundary point detecting means for detecting at least one of a first boundary point indicating a boundary between an upper eyelid and an eyeball and a second boundary point indicating a boundary between a lower eyelid and the eyeball, based upon a point which is shifted from the local peak value point searched by the local peak value point searching means in a direction towards the eyeball and which is closest to the local peak value point so that the magnitude of the pixel value change becomes a value smaller than the magnitude of the pixel value change at the local peak value point by a preliminarily set value.