A mean based graph theoretic approach for image segmentation