portfolio/cellule/computeRun.m
2026-08-27 15:48:19 +02:00

35 lines
1.2 KiB
Matlab

function [varargout]=run(varargin)
% open np2 or tiff file
narginchk(3,5);
%[imsrc P1 P2 axe1] = varargin{:};
imsrc = varargin{1};
P1 = varargin{2};
P2 = varargin{3};
axe1 = varargin{4};
%lps=questdlg('quel format enregistrer les resultat?','xls','csv');
[I, grayMorph ,gradMag, binMorph, L, Lrgb, squ] = labelise(imsrc{1:2});
%figure, h = imshow(I,[]) ;title('Image Originale');
% figure, himage = imshow(Lrgb,[]) ;title('Label in color Image');
[skl] = Fillsk(squ,[P1(1) P2(1)],[P1(2),P2(2)]);
% Deuxiéme Methode
[L2 CCs TabPlotX TabPlotY] = Fillsk2(I,skl,L,[P1(1) P2(1)],[P1(2),P2(2)], axe1);
[stackRegion centre c] = computeProjetion(CCs,skl,L2,I);
%c=computeProjetion(list_labelsk{1},skl,L2,I);
%labelStat=computeLabelStat(CCs,L2,I);
labelStat = {};
for k=1:length(imsrc)
labelStat{k}=computeLabelStat( CCs,L2, imsrc{k});
end
varargout = {Lrgb, squ, grayMorph, gradMag, binMorph, L, skl,CCs , labelStat, c,TabPlotX,TabPlotY};
display('run complet!')
%affichage(resultat{:});
%sauvegarde(file_path_save, resultat{:});
end