图像分割原理: 图像分割函数代码: function [dst,realT1,realT2] = ImageSegmentation(filepath) %图像分割 src = double(rgb2gray(imread(filepath))); [M,N] = size(src); src = reshape(src,[],1); mG = mean(src); g = 0;realT1 &