MATLAB Examples

Demo for Linear Stretching

This script provides a demo for th function linstretchrgb. This script is used to perform linear contrast stretching of a % 3-band image(FCC). The script is designed as a part of the laboraory exercise for the course CE671A: iNTRODUCTION TO REMOTE SENSING

Written by Doctorand M.Sc.-Ing Divyesh Varade Editorial Board NERD, IIT Kanpur Indian Institute of Technology, Geoinformatics Division, Department of Civil Engineering Kanpur-208016 --------------------------------------------------

Contents

Reading Data

Ib = imread('L3-NG44I02-099-053-14oct08-BAND2.tif');
Ig = imread('L3-NG44I02-099-053-14oct08-BAND3.tif');
Ir = imread('L3-NG44I02-099-053-14oct08-BAND4.tif');

Creating & Visualizing the Original FCC

L3_orig(:,:,1)=Ir;
L3_orig(:,:,2)=Ig;
L3_orig(:,:,3)=Ib;
image(L3_orig)

Linear Stretching to entire 8-bit range(0-255)

Initializing the range values

nmin = 0;
nmax = 255;
% Performing the contrast enhancement by linear stretching
[L3_linstr] = linstretchrgb(Ir,Ig,Ib,nmin,nmax);
figure; image(L3_linstr)