A probability distribution constructing method that constructs, based on plural images obtained by repeatedly photographing a field where a plurality of persons exist using a fixedly disposed camera, appearance probability distributions of head portions of the plurality of persons repeatedly appearing in various sizes in the plural images, the probability distribution constructing method comprising:
- an image acquiring step that acquires the plural images from the camera;
- an extracting step that extracts, from the plural images acquired in the image acquiring step, similar head portion shapes each of which is similar to a predetermined typical shape of a head portion of a person, together with sizes of the similar head portion shapes and positional information of the camera on a view angle;
- a filtering step that determines whether the similar head portion shapes extracted in the extracting step are head portions of persons or not, and that extracts head portions determined in the determination;
- and
- a probability distribution calculating step that calculates, (a) for each of plural sizes of the extracted head portions, an appearance location probability distribution whose probability variable is each location in the view angle and which represents appearance probabilities of head portions classified as having the same size as the each of the plural sizes, of the extracted head portions or (b) for each location in the view angle, an appearance size probability distribution whose probability variable is each of plural sizes of the extracted head portions and which represents appearance probabilities of head portions appeared in the each location in the view angle,
- wherein the filtering step is a step of (1) counting, for each of the extracted similar head portion shapes in the extracting step, the number of other similar head portion shapes except for the each of the extracted similar head portion shapes which exist in a search area having a predetermined size and being spread around the each of the extracted similar head portion shapes in the view angle and which are classified as having the same size as size of the each of the extracted similar head portion shapes, and (2) determining the each of the extracted similar head portion shapes (2a) as being one of the head portions when the number of the other similar head portion shapes obtained by the counting is equal to or larger than a predetermined threshold value being one or more and (2b) as not being one of the head portions when the number of the other similar head portion shapes obtained by the counting is less than the threshold value.