Superpixel segmentation based on image density