24 ก.ย. 2020 เวลา 13:31 • วิทยาศาสตร์ & เทคโนโลยี
Plot Landsat8 data at Kanchanaburi by using MATLAB
Requirements
1. Matlab
2. Matlab's Image Processing Toolbox
3. Matlab's Mapping Toolbox
4. Earth Explore website from https://earthexplorer.usgs.gov ต้องสมัครสมาชิกเพื่อ download Landsat8 data
Band 1 Visible (0.43 - 0.45 µm) 30 m
Band 2 Visible (0.450 - 0.51 µm) 30 m
Band 3 Visible (0.53 - 0.59 µm) 30 m
Band 4 Red (0.64 - 0.67 µm) 30 m
Band 5 Near-Infrared (0.85 - 0.88 µm) 30 m
Band 6 SWIR 1(1.57 - 1.65 µm) 30 m
Band 7 SWIR 2 (2.11 - 2.29 µm) 30 m
Band 8 Panchromatic (PAN) (0.50 - 0.68 µm) 15 m
Band 9 Cirrus (1.36 - 1.38 µm) 30 m
Band 1 senses deep blues and violets.
Band 2 normal blue
Band 3 green
MATLAB's code
deepB =(imread('LC08_L1TP_130050_20200516_20200527_01_T1_B1.TIF'));
B =(imread('LC08_L1TP_130050_20200516_20200527_01_T1_B2.TIF'));
G =(imread('LC08_L1TP_130050_20200516_20200527_01_T1_B3.TIF'));
R =(imread('LC08_L1TP_130050_20200516_20200527_01_T1_B4.TIF'));
NIR =(imread('LC08_L1TP_130050_20200516_20200527_01_T1_B5.TIF'));
%shortwave infrared
SWIR =(imread('LC08_L1TP_130050_20200516_20200527_01_T1_B7.TIF'));
RGB = cat(3,R,G,B);
imshow(RGB);
(Red, Green,Blue) band (4, 3, 2)
(Red, Green,Blue) band (4, 3, 2) with histeq function
RGB543 = cat(3,NIR,R,G);
imshow(RGB543);
(Red, Green,Blue) band (5, 4, 3)
Band 5 = Near infrared (NIR) important for ecology (healthy plants reflect it)
band 5 NIR
band 5 NIR with histeq function
By comparing it with other bands, we get indexes like NDVI, which let us measure plant health
code:
G = double(G);
R = double(R);
NIR = double(NIR);
ndvi = (NIR-R)./(NIR+R);
figure, imshow(ndvi,[]);
colormap(jet);
colorbar;
NDVI with histeq function
false-color image by using SWIR as red, NIR as green, and deep blue as blue (technically, a 7-5-1 image):
code
RGB751 = cat(3,SWIR,NIR,deepB);
figure, imshow(RGB751);
(SWIR,NIR, deep Blue) band (7, 5, 1)
Band (10, 7, 3)
[w,h] = size(G);
accl = input('Enter Threshold Value = ');
for ii=1:w
for jj=1:h
if ndvi(ii,jj)>=accl
Smap(ii,jj,1) = 65535;
Smap(ii,jj,2) = 0;
Smap(ii,jj,3) = 0;
else
Smap(ii,jj,1) = G(ii,jj);
Smap(ii,jj,2) = G(ii,jj);
Smap(ii,jj,3) = G(ii,jj);
end
end
end
Smap = uint16(Smap);
figure, imshow(Smap);
input Threshold = 0.4
K= imsubtract(deepB,B);
figure, imshow(K);
โฆษณา