1. A method, comprising: executing a foreground detection module as software executable instructions to perform: generating saliency thresholds from a saliency map of an image that includes foreground regions of the image; applying constraints that distinguish the foreground regions in the image, different ones of the constraints applied in different combinations of the constraints; detecting one or more of the foreground regions of the image based on the saliency thresholds and the different combinations of the constraints; and determining an image composition of the image based on the detected one or more foreground regions of the image.