1. A computer-implemented method of segmenting an image into a foreground and a background comprising: receiving an image to be segmented; obtaining at least one star center being a location in the image; using the star center to calculate a geodesic distance map corresponding to the image, the geodesic distance map comprising a geodesic shortest path distance from each image element of the image to the star center; specifying an energy function representing a problem of segmenting the image; using the geodesic distance map, optimizing the energy function to obtain the foreground and background, the energy function incorporating a geodesic star-convexity constraint.