標(biāo)題:求助
![]()
|
1#發(fā)表于:2012-04-14 16:28:01
- IP:222.89.*.*
求助用matlab做出圖片結(jié)果
讀入圖像
I=imread('cell.tif');
figure, imshow(I),title('original image');
檢測(cè)完整的細(xì)胞
BWS=edge(I, 'sobel', (graythresh(I) *.1));
figure, imshow(BWs), title('binary gradient mask');
填補(bǔ)縫隙
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');
移除與邊界聯(lián)通的目標(biāo)
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'); |
展開帖子列表