新手求助!哪位高手能帮忙给程序加注释?万分感谢!
希望精通的高手能给出注释,越详细越好,万分感激!跪谢!!如何在一張圖片上描繪出一個物體的邊緣。
程式:
clear,close all;
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, );
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(BWnobord,seD);
BWfinal = imerode(BWfinal,seD);
figure, imshow(BWfinal), title('segmented image');
BWoutline = bwperim(BWfinal);
Segout = I;
Segout(BWoutline) = 255;
figure, imshow(Segout), title('outlined original image');
页:
[1]