Image segmentation with statistical and spatial information