用matlab做出图片结果
读入图像
I=imread('cell.tif');
figure, imshow(I),title('original image');
检测完整的细胞
BWS=edge(I, 'sobel', (graythresh(I) *.1));
figure, imshow(BWs), title('binary gradient mask');
填补缝隙
se90=strel('line', 3, 90);
se0=strel('line', 3, 0);
膨胀操作
BWsdil=imdilate(BWs, [se90 se0]);
figure, imshow(BWsdil), title('dilated gradient mask');
填充
BWdfill= imfill(BWsdil, 'holes');
figure, imshow(BWdfill);
title('binary image with filled holes');
移除与边界联通的目标
BWnobord = imclearborder (BWdfill, 4);
figure, imshow (BWnobord), title('cleared border image');
平滑
seD = strel ('diamond',1);
BWfinal = imerode (BWnobore,seD);
figure, imshow (BWfinal), title('segmented image');