1. A computer implemented method, comprising: receiving an image; pre-processing the image resulting in a pre-processed image; calculating a metric based on the pre-processed image; generating a binary image from the pre-processed image based on the metric; identifying one or more regions of the binary image using connected components analysis; selecting a region of interest in the image based on an analysis of the identified regions of the binary image; and using a probabilistic cost function to refine the region of interest.