Bayesian image segmentation through level lines selection