32 lines
454 B
Matlab
32 lines
454 B
Matlab
function squ = Skel( I2,ds )
|
|
% I2 Image channel 2 Fret Intensity cast unit16
|
|
% ds Disk size for Structurant element 4 or 5
|
|
% retourne le 'Squelette'
|
|
|
|
|
|
% Element Structurant
|
|
e=strel('disk',ds);
|
|
|
|
% Seuillage
|
|
[level] = graythresh(I2);
|
|
|
|
% Image Binaire
|
|
bin=im2bw(I2,level);
|
|
|
|
|
|
% Inverse
|
|
bin=1-bin;
|
|
|
|
% Ouverture
|
|
bin = imopen(bin,e);
|
|
|
|
% Fermeture
|
|
bin = imclose(bin,e);
|
|
bin=1-bin;
|
|
|
|
% Squelette
|
|
squ=bwmorph(bin,'thin',Inf);
|
|
|
|
end
|
|
|