An analysis apparatus comprising: an image analysis unit configured to detect a predetermined part of a moving vehicle and persons on the vehicle from each of a plurality of images obtained by imaging the moving vehicle from different directions a plurality of times using a camera installed along the road through which the vehicle passes, set a coordinate system having the detected predetermined part as a reference, and detect coordinates of each of the plurality of persons in the coordinate system; a grouping unit configured to group the persons detected from different images, on the basis of the coordinates; and a counting unit configured to count the number of groups, wherein the grouping unit is configured to cause each of a plurality of faces detected from the first image to belong to a respective different group of a plurality of groups, and cause each of one or more faces detected from the second image to belong to one of the plurality of groups when a distance between the coordinates of each of one or more faces detected from the second image and representative coordinates associated with said one of the plurality of groups is less than a predetermined value, the representative coordinates being the coordinates of the face of a single person, belonging to said group, detected from the first image, and redetermine the representative coordinates of the group to which a new member has been added as statistical values of the coordinates of the faces, belonging to said group, detected from the first and second images, wherein in the case where there is no group that satisfies the distance condition, the grouping unit generates a new group corresponding to the person detected from the second image, causes the person to belong to that group, and sets the coordinates of the person as the representative coordinates of that group. an image analysis unit configured to detect a predetermined part of a moving vehicle and persons on the vehicle from each of a plurality of images obtained by imaging the moving vehicle from different directions a plurality of times using a camera installed along the road through which the vehicle passes, set a coordinate system having the detected predetermined part as a reference, and detect coordinates of each of the plurality of persons in the coordinate system; a grouping unit configured to group the persons detected from different images, on the basis of the coordinates; and a counting unit configured to count the number of groups, wherein the grouping unit is configured to cause each of a plurality of faces detected from the first image to belong to a respective different group of a plurality of groups, and cause each of one or more faces detected from the second image to belong to one of the plurality of groups when a distance between the coordinates of each of one or more faces detected from the second image and representative coordinates associated with said one of the plurality of groups is less than a predetermined value, the representative coordinates being the coordinates of the face of a single person, belonging to said group, detected from the first image, and redetermine the representative coordinates of the group to which a new member has been added as statistical values of the coordinates of the faces, belonging to said group, detected from the first and second images, wherein in the case where there is no group that satisfies the distance condition, the grouping unit generates a new group corresponding to the person detected from the second image, causes the person to belong to that group, and sets the coordinates of the person as the representative coordinates of that group. <EOS>