Bayesian statistical theory is a convenient way of taking a priori information into consideration when inference is made from images. In Bayesian image detection, the a priori distribution should capture the knowledge about objects. Taking inspiration from [1], we design a prior density that penalizes the area of homogeneous parts in images. The detection problem is further formulated as the estimation of the set of curves that maximizes the posterior distribution. In this paper, we explore a posterior distribution model for which its maximal mode is given by a subset of level curves, that is the boundaries of image level sets. For the completeness of the paper, we present a stepwise greedy algorithm for computing partitions with connected components.