Вы находитесь на странице: 1из 3

19/03/19 17:05 G:...\Description_on_Multispectral_images.

m 1 of 3

%% Meeting 4 of Image processing with focus on optical nultispectral images


% Review of M.3: Image segmentation
% Some important aspects to know:
%-The SLIC segmentation
%-Color spaces
%-Introduction of texture characteristics
% Routine:
% (!) Warning: This routine can be executed in MATLAB 2016a or newer.
%% M.4 Objectives:
% 1- To get familiar with texture characteristics.
% 2- To apply image techniques for solving a real problem.
% 3- To enhance multispectral imagery specifications.
% 4- To introduce classification models and techniques.
% 5- To introduce digital elevation models (Part 1: The physics).
%% Routine:
% This code is adapted from its original version. See more in the reference.
% This code uses partially the program Filtrado_Ccoillo. See more in the reference.
close all
CIR = multibandread('montana.lan', [512, 512, 7], 'uint8=>uint8',...
128, 'bil', 'ieee-le', {'Band','Direct',[6 5 4]}); %% See more in the
reference (Data images)
figure
imshow(CIR)
title('CIR Composite (Un-enhanced)')
text(size(CIR,2), size(CIR,1) + 15,...
'Image courtesy of Space Imaging, LLC',...
'FontSize', 7, 'HorizontalAlignment', 'right')
%% Enhance the CIR Composite with a Decorrelation Stretch
decorrCIR = double(decorrstretch(CIR, 'Tol', 0.01))/255;
figure
imshow(decorrCIR);title('CIR Composite with Decorrelation Stretch')
[M,N]=size(decorrCIR);
%% Low-pass filter for each band
%--FFT low-pass filter
op_out1= fftfilter(decorrCIR(:,:,1),1,round(0.50*min(M,N)/2));
op_out2= fftfilter(decorrCIR(:,:,2),1,round(0.50*min(M,N)/2));
op_out3= fftfilter(decorrCIR(:,:,3),1,round(0.50*min(M,N)/2));
%-Getting the image result
decorrCIR_filt(:,:,1)=op_out1;
decorrCIR_filt(:,:,2)=op_out2;
decorrCIR_filt(:,:,3)=op_out3;
figure;imshow(decorrCIR_filt);title('CIR Composite filtered in each color band')
%% Image segmentation
[L,N]=superpixels(decorrCIR_filt,round(0.25/100*length(decorrCIR_filt(:))),'Compactness',
5);
BW = boundarymask(L);
figure;imshow(imoverlay(decorrCIR_filt,BW,'yellow'));title('Segmentation image boundary
mask')
% Set color of each pixel in output image to the mean RGB color of the
% superpixel region.
outputImage = zeros(size(decorrCIR_filt));
19/03/19 17:05 G:...\Description_on_Multispectral_images.m 2 of 3

idx = label2idx(L);
numRows = size(decorrCIR_filt,1);
numCols = size(decorrCIR_filt,2);
for labelVal = 1:N
redIdx = idx{labelVal};
greenIdx = idx{labelVal}+numRows*numCols;
blueIdx = idx{labelVal}+2*numRows*numCols;
outputImage(redIdx) = mean(decorrCIR_filt(redIdx));
outputImage(greenIdx) = mean(decorrCIR_filt(greenIdx));
outputImage(blueIdx) = mean(decorrCIR_filt(blueIdx));
end
figure;imshow(outputImage);title('Segmentation image segment map')

%% Getting the image descriptors


glcm = graycomatrix(outputImage(:,:,3),'NumLevels',8, 'Symmetric', true);
feat = graycoprops(glcm);
contr=mean(feat.Contrast);
corrm=mean(feat.Correlation);
energ=mean(feat.Energy);
homog=mean(feat.Homogeneity);
fprintf('contr= %f\n',contr);
fprintf('corrm= %f\n',corrm);
fprintf('energ= %f\n',energ);
fprintf('homog= %f\n',homog);
%% Activities:
% 1- To analize the code and interpret the images and indicators gotten.
% 2- To research about techniques to get the descriptors shown, and its procedure.
% 3- To research about more image descriptors.
% 4- To research about classification algorithms and techniques.
% 4- To expand the program in getting the image texture descriptors to all the image
% 5- To research and understand about multispectral imagery, with more descriptive
information
% 6- To research and understand about the principle of radar (backscattering and time).
% E- To implement an enhancement related with this program, trying to combine it with the
prior ones.
% - Suggestion: It can be an application of forest characteristics, using multispectral
imagery and selecting the appropriate channels, image filters, segmentation and image
descriptors.
% *As usual, free choice is valid. Just remember to follow the objectives.
%% Remembering the bands
% Band 1: Blue
% Band 2: Green
% Band 3: Red
% Band 4: Near Infrarred
% Band 5: Middle Infrarred
% Band 6: Far Infrarred
% Band 7: Thermal Infrarred
%
% * There can be more bands, and each one are stored in a 2D image
% * The sample images are stores with interleave BIL
%% References:
19/03/19 17:05 G:...\Description_on_Multispectral_images.m 3 of 3

% Textural Features for Image Classification, Robert Martin Haralick et al., 1973
% https://www.researchgate.
net/publication/302341151_Textural_Features_for_Image_Classification
% SLIC superpixels compared to state-of-the-art superpixel methods, Achanta R et al, 2012
% https://www.ncbi.nlm.nih.gov/pubmed/22641706
% Data images
% http://www.maths.lth.se/matstat/kurser/fmsn20masm25/matlab.html
% Image enhancement
% https://fr.mathworks.com/help/images/examples/enhancing-multispectral-color-composite-
images.html
%% Material to be used as consultation:
% R. C. Gonzalez, and R. E. Woods, Digital image processing, 3rd ed.
% Upper Saddle River, NJ, USA: Prentice-Hall, 2008
%-About Image Types and Formats
% https://www.e-education.psu.edu/geog883/node/503
% https://www.loc.gov/preservation/digital/formats/fdd/fdd000305.shtml
% http://knightlab.org/rscc/legacy/RSCC_Digital_Image_Data_Formats.pdf
% https://gisgeography.com/multispectral-vs-hyperspectral-imagery-explained/
%-About mutispectral imagery
% https://www.esri.
com/training/assets/courses/5a26e1d773ca583026a3b905/ImageryAndGIS_SampleChapter.pdf
% https://onlinelibrary.wiley.com/doi/pdf/10.1002/9781119994398.ch7
% Preview of the Chapter 7 on
% https://books.google.com.pe/books?
id=w3BpSIxN9ZYC&pg=PA669&lpg=PA669&dq=fundamentals+of+multispectral+image+processing&sour
ce=bl&ots=3L9ydJYF2G&sig=4bHs213mz9SA_6Al_OMTQAdCCDU&hl=es-
419&sa=X&ved=0ahUKEwiXvI77sdbbAhUH71MKHR1CACc4ChDoAQg-MAM#v=onepage&q=fundamentals%20of%
20multispectral%20image%20processing&f=false
% Article
% https://www.sciencedirect.com/science/article/pii/S0305440399904156
% For classification
% Olson, D., & Delen, D. (2008). Advanced Data Mining Techniques. Springer-Verlag. https:
//doi.org/10.1017/CBO9781107415324.004
% Lima-Peru, June 16th, 2018
%% PD
% 4- To introduce digital elevation models (Part 2: The Math and DIP)

Вам также может понравиться