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
| TSMe=load('Poly-TSMc-06-mask.txt');
BW = TSMe>3;
L=bwlabel(BW);
reg = regionprops(L,'area');
[pasbesoin,idx]=max([reg.Area]);
L = L==idx;
[nblon nblat]=size(TSMe);
lat = linspace(-1.9,-1.3,nblat);
lon = linspace(43.9,43.2,nblon);
[X,Y]=meshgrid(lat,lon);
figure
subplot(221)
pcolor(X,Y,TSMe)
caxis([0 20]);
shading interp
axis equal tight
title('Image originale')
subplot(222)
imagesc('xdata',X([1 end]),'ydata',Y([1 end]),'cdata',double(BW))
axis image
title('Image seuillée')
subplot(223)
imagesc('xdata',X([1 end]),'ydata',Y([1 end]),'cdata',double(L))
axis image
title('Masque utile')
TSMe = TSMe.*L;
subplot(224)
pcolor(X,Y,TSMe)
caxis([0 20]);
shading interp
axis equal tight
title('Image masquée') |
Partager