图像分割matlab程序(遗传算法,大津法,区域生长法,迭代法分割图像)
(2013-07-10 15:17:06)
标签:
it |
分类: Matlab |
%%%%%%%%%%%%%%%%区域生长的图像分割程序%%%%%%%%%%%%
image=imread('mri1.bmp');
I=rgb2gray(image);
figure,imshow(I),title('原始图像')
I=double(I);
[M,N]=size(I);
[y,x]=getpts;
x1=round(x);
y1=round(y);
seed=I(x1,y1);
Y=zeros(M,N);
Y(x1,y1)=1;
sum=seed;
suit=1;
count=1;
threshold=15;
while count>0
s=0;
count=0;
for i=1:M