1. A head detecting method comprising the steps of: a foreground extracting step for extracting a foreground region, in which a person has been taken, from an input image; a first main axis computing step for computing a main axis of the foreground region, said first main axis computing step including a first moment computing step for computing a moment around a center of gravity of the foreground region, and calculating the main axis of the foreground region based on the moment around the center of gravity of the foreground region; a head region computing step for computing a head region included in the foreground region as a part thereof, based on the main axis of the foreground region and a shape of the foreground region; an ellipse determining step for determining an ellipse to be applied to the head of the person, based on a shape of the head region; and an input step for inputting a plurality of frame images constituting a moving image as a plurality of the input images; and wherein the first main axis computing step includes: a first orthogonal axes computing step for computing two orthogonal axes in the foreground region, based on the moment around the center of gravity of the foreground region; and a first main axis selection step for selecting one axis in the two orthogonal axes calculated by the first orthogonal axes computing step, which forms smaller angle with the main axis of the foreground region calculated in at least one of a previous frame and a next frame, as the main axis of the foreground region.