1. A method of segmenting an image, comprising: providing an image; determining a first value of a segment parameter, wherein the segment parameter relates to a threshold function for establishing a boundary condition between a first segment and a second segment; determining a first value of a similarity function configured to indicate a similarity between the image and its segmentation based on the first value of the segment parameter; comparing the first value of the segment parameter and the first value of the similarity function to a predetermined function; determining a second value of the segment parameter based on a result of the comparing; and segmenting the image based on the second value of the segment parameter.