Patent ID: 8625897

Claim:
A computer-implemented method of segmenting a foreground portion from a background portion of an image, comprising: receiving the image at a processor, wherein the image comprises a plurality of image elements, and the image represents at least one user, at least one foreground object in proximity to the at least one user, and a background; accessing at least one trained decision tree stored on a memory; selecting an image element from the image; applying the image element to the or each trained decision tree to obtain one or more probabilities of the image element representing part of a user, a foreground object or background; assigning a classification of user, foreground object or background to the image element in dependence on the one or more probabilities; repeating the steps of selecting, applying and assigning for each image element in the image; labeling the image elements having the classification of user as the foreground portion, and the image elements having the classification of foreground object and background as the background portion; and subsequent to labeling the image elements: selecting a first image element located at one side of the foreground portion and a second image element located at an opposing side of the foreground portion; calculating a first set comprising a geodesic distance from each image element in the foreground portion to the first image element; calculating a second set comprising a geodesic distance from each image element in the foreground portion to the second image element; aggregating the geodesic distances in the first set over an axis of the image to form a first graph; aggregating the geodesic distances in the second set over the axis of the image to form a second graph; calculating an intersection area between the first graph and second graph; and determining that two users are present in the image the intersection area is less than a predefined threshold.