1. A method for counting at least one individual in a crowd comprising the steps of: (i) calibrating an image capturing device and an image processing device; (ii) capturing a flame of an image with the image capturing device; the image processing device performing the steps comprising: (iii) drawing a virtual gate through the image; (iv) applying a foreground estimation module to the image; (v) applying a tracking module to the image; (vi) applying a crowd segmentation module to the image to separate the individual from the crowd; (vii) counting the individual; wherein the crowd segmentation module in step (v) comprises the steps of (i) identifying at least one low level image feature; (ii) hypothesizing at least one clique from the low level image features; and (iii) constraining the clique according to a geometric shape model; wherein the constraining of step (iii) comprises: (iv) assigning each low level image feature to a single clique; (v) establishing future assignments according to an assignment vector based on a likelihood function; wherein the likelihood function is a free energy equation.