Intro into Matlab

Few external links

Programming Resources

Matlab will be used for the Labs. Image Processing Toolbox (IPT) will be advantageous for us. The documentation [pdf] of IPT toolbox. functions we will use are included to a standard Matlab package.

Matlab hints
help function_name Simple help in command line.
helpwin function_name The window with text help.
doc Documentation in HTML format. Not available for IPT functions
help images Listing of IPT functions with short descriptions.

Image manipulation functions
DomainPossible functions
I/O operationsimread, imwrite, print
Displayingfigure, imshow, image, imagesc, axis, colormap ...
Numerical format conversionsim2double, im2uint8, double, uint8
True color format conversionrgb2hsv, hsv2rgb
Brightness manipulationbrighten, histeq, imhist
Frequency domainfft2, ifft2, fftshift
Spatial domainconv2, medfilt2, fspecial ...

Matlab and IPT - first steps

Write the following line to the Matlab prompt:

>> a=1:2:20

What is a', a(:), a(1:2:end), a(end:-1:1) ?

Create a simple image IM:

>> a=1:16
>> IM=a'*a-1;

Display its dimensions (in pixels):

>> size(IM)

Try to display the image by several manners:

>> figure; imagesc(IM);
>> axis equal
>> colormap gray
>> figure; imshow(IM,[]);

Look at the histogram of brightness levels in this image:

>> h=hist(IM(:),256);
>> figure;plot(h);

What does IM(:) mean ?
Display the maximum and minimum brightness values of the image:

>> min(IM(:))
>> max(IM(:))

Compute the cumulative histogram of brightness levels, and display it:

>> cumh=cumsum(h);
>> plot(cumh);