Homework  2

 

Download the problems here

 

Due date: 12th July before 4:00 PM

 

 

You would need the following files for your home work:

 

trgIris.dat

band1.irs

band2.irs

band3.irs

band4.irs

lena_std.pgm

 

 

Description of the files:

 

trgIris.dat is an ascii file containing data for a classification problem. The first four columns contains the 4 features and the remaining

3 columns are the class labels.

 

band1.irs, band2.irs, band3.irs and band4.irs are binary files containing a satellite image of Kolkata captured in 4 different

frequencies. All these files have 512 * 512 bytes and one byte represents 1 pixel. The data in this file can be transferred to a matrix of

integers using the following matlab commands:

 

fp = fopen('band1.irs','r');

a=fread(fp,[512,512],’int8’);

fclose(fp)

 

You can use the following commands to display the images:

 

imagesc(a); colormap gray;

 

 

lena_std.pgm contains a 256 * 256 pixel image in the pgm format. You can read and display this image in matlab using the following commands:

 

>> a = imread('lena_std.pgm','pgm'); % reads the image in matrix a

>> imagesc(a); colormap gray; axis equal; % displays the image in a