Notes written while working on HW1 by Nasser Abbasi
(http://12000.org)
Course EE 203A, UCI. Digital image processing. UC
Irvine, california. Fall 2004.
In matlab, these are some commands I used to display the raster image:
img=imread('cat.ras','ras');
colormap gray
image(img)
But the above uses gray levels of 0..1 the default in matlab, so I needed to change it to scale the values to 1..256, which is what the raster file format is. This is done like this:
>> colormap gray
>> imagesc(img,[1 256])
Now the image looks the same as from the xv command.
Now I can use matlab to finish the HW.
Wrote a function to do this problem.
>> imfinfo('cat.ras')
ans =
Filename: 'cat.ras'
FileModDate: '02-Oct-2004 12:54:49'
FileSize: 307232
Format: 'RAS'
FormatVersion: []
Width: 640
Height: 480
BitDepth: 8
ColorType: 'indexed'
FormatSignature: 1.5041e+009
Length: 307200
Type: 1
MapType: 0
MapLength: 1