1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
im_in=imread("entier.tiff");
[ymax,xmax,zmax]=size(im_in);
% Elimination valeurs NaN (profondeurs hors echelle):
valeur_fond=0;
im1=zeros(ymax,xmax,zmax)+valeur_fond;
im_valid=1-(isnan(im_in));
for y=1:ymax
for x=1:xmax
if im_valid(y,x,:)==1
im1(y,x,:)=im_in(y,x,:);
end
end
end
%Affichage image initiale:
%Mais avec les valeurs NaN annulées
figure(1)
imagesc(im1)
title('Image de l''objet à analyser')
%%
%Etape 4
%Etape de crop dans la zone interieure
crop_gauche=800 ; % position gauche du crop
crop_droit=1200 ; % position droite du crop
crop_haut=50 ; % position haute du crop
crop_bas=325; % position basse du crop
%%
%Etape 5
% Affichage du cadre tracé précédemment
im1(crop_haut-3:crop_haut-3,crop_gauche-3:crop_droit+3,:)=255;
im1(crop_haut-3:crop_bas+3,crop_gauche-3:crop_gauche-3,:)=255;
im1(crop_bas+3:crop_bas+3,crop_gauche-3:crop_droit+3,:)=255;
im1(crop_haut-3:crop_bas+3,crop_droit+3:crop_droit+3,:)=255;
figure (2)
imagesc(im1)
title('Représentation de la zone de l''objet analysé')
%%
%Etape 6
% Affichage de l'image croppee composante bleu
im3D=im1(crop_haut:crop_bas,crop_gauche:crop_droit,:);
im_coupe=im3D(:,:,3);
figure (3)
P=min(im_coupe);
Q=max(im_coupe);
clims=[940.5023 947.9257];
imagesc(im_coupe,clims)
colorbar
title('Représentation en 2D des altitudes z de la zone de l''objet analysé echelle en mm') |
Partager