1. An eyelid detection device, comprising: a extractor extracting the pixels of which the edge values satisfy given conditions from the pixels constituting an image of the eyes of a driver; a calculator calculating the evaluation value of the pixels overlapping with an window having a shape corresponding to the eyelids of the driver while scanning the image using the window; a transformer transforming the window at the position where the evaluation value is maximized to increase the evaluation value of the window; and a setter setting the reference positions of the eyelids according to the transformed window.