Image segmentation and quantification