30 lines
895 B
Matlab
30 lines
895 B
Matlab
function [ Iobrcbr,varargout ] = MorphSegmentation( I )
|
|
% MORPHSEGMENTATION debruitage pour la preparation des cellules a la
|
|
% segmentation en utilisant des outils de morphologie mathematique.
|
|
|
|
%figure,subplot(3,3,1), imshow(I,[]), title('Image Originale');
|
|
se = strel('disk', 4);
|
|
|
|
Io = imopen(I, se);
|
|
%subplot(3,3,1), imshow(Io), title('Ouverture')
|
|
|
|
Ie = imerode(I, se);
|
|
Iobr = imreconstruct(Ie, I);
|
|
%subplot(3,3,3), imshow(Iobr), title('Ouverture Par Reconstruction')
|
|
|
|
Ioc = imclose(Io, se);
|
|
%subplot(3,3,7), imshow(Ioc), title('Ouverture-Fermeture')
|
|
|
|
Iobrd = imdilate(Iobr, se);
|
|
Iobrcbr = imreconstruct(imcomplement(Iobrd), imcomplement(Iobr));
|
|
Iobrcbr = imcomplement(Iobrcbr);
|
|
%subplot(3,3,9), imshow(Iobrcbr), title('Ouverture-Fermeture Par Reconstruction')
|
|
|
|
%subplot(3,3,5), imshow(I), title('Source')
|
|
|
|
%nout = max(nargout,1) - 1;
|
|
varargout={Iobr Ioc};
|
|
|
|
end
|
|
|