An image segmentation-based method for quantifying the rock failure mechanism under true triaxial compression