A head detecting apparatus, including a foreground extraction section for
extracting a foreground region in which a person is captured from an
input image; a first main axis computing section which includes a first
moment computing section for computing a moment around a center of
gravity of the foreground region and calculating a main axis of the
foreground region based on the moment around the center of gravity of the
foreground region; a head computing section 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; and
an ellipse determining section for determining an ellipse to be applied
to a person's head based on a shape of the head region.