In the scope of level set image segmentation, the number of regions is fixed beforehand. This number occurs as a constant in the objective functional and its optimization. In this study, we propose a region merging prior which optimizes the objective functional implicitly with respect to the number of regions. A statistical interpretation of the functional and learning over a set of relevant images and segmentation examples allow setting the weight of this prior to obtain the correct number of regions. This method is investigated and validated with color images and motion maps.