1. An apparatus for detecting a moving object, comprising: an imaging unit imaging repeatedly at intervals a region to be detected of a moving object; a dictionary storage previously storing therein, as a dictionary, image patterns indicative of features of the moving object; an extracting section extracting feature points indicative of a position of an object in the images, based on data of the images repeatedly imaged by the imaging unit; a calculating section calculating an optical flow of the feature points, based on the features points in the images extracted time sequentially by the extracting section; a rectangle setting section grouping the feature points of the moving object and setting a reference rectangle encompassing the grouped feature points, based on the optical flow calculate by the calculating section; a region setting section setting an identification region encompassing a region showing the moving object, the identification region encompassing the reference rectangle; an identifying section identifying the moving object in the identification region, using the dictionary stored in the dictionary storage; and a specifying section specifying the region occupied by the moving object, based on results identified by the identifying section and an image region having the highest degree of match with the dictionary.