Homework Assignments

 

Introduction

Homework assignments throughout the course are in MATLAB.
Matlab is a C-based interpreter. The basic structures in Matlab are vectors and matrices and
as such Matlab is appropriate for Image Processing.

Where Do I find Matlab?

1)  At Haifa University, Matlab is available on the PCs in computer labs around the university:

http://computerclasses.haifa.ac.il/programs/ls0%20.htm
http://computerclasses.haifa.ac.il/


2) The university offers student free Matlab

https://www.haifa.ac.il/index.php/he/2015-11-19-07-16-50.html


3) You can purchase the MATLAB student version License for MATLAB
for this IP course you can choose the option with no toolboxes.

4) You can work at home on the Free Octave program which is compatible with matlab.
HOWEVER the HW will be checked on MATLAB and it is your responsibility to check
that it works on MATLAB without a hitch.
For example you can complete the homework on Octave and then test in Matlab in
the University labs.

 

HELP on Matlab?

Matlab Help desk is available on-line at :  

http://www.mathworks.com/access/helpdesk/help/techdoc/matlab.html

Matlab Manuals are available for download:

http://www.mathworks.com/academia/student_center/tutorials/launchpad.html

 

Online Manuals and Tutorials – there are hundreds.  For Example:

https://blog.udemy.com/matlab-tutorial/


Also some locally downloaded files:

Matlab Reference List
Matlab Primer

Matlab Primer (text format on web page)

 

If all else fails, there is always the "help" command in Matlab.


How do I start Matlab?

On the lab PCs :
Find the Matlab Icon in the Mathematics directory. 
Double clicking on the icon will start the matlab environment.
A shell window with the ">" prompt will open. This is the command line.
You can also start matlab by double clicking on a matlab file (XXX.m) in which case the Matlab environment
will start and an editor/debugger window will open with the file.


How do I work with Matlab?

The recommended way of working in Matlab is to open Matlab in one window and open the Matlab editor in another window. Select commands in the editor then apply them using F9 or the Run command under the Tools menu. This way you can rerun commands, discover your errors, and interactively build your scripts and functions (don't forget that Matlab is an interpreter based language).  The Matlab environment provides an editor/debugger that checks syntax and can run the edited file.


Image Processing Homework in Matlab

Exercises in IP will deal with grayscale images (binary images will be stored as grayscale but having only 2 distinct gray values). An image in Matlab is a 2D matrix with entries ranging in [0..255]. Matlab can deal directly with images, however for the convenience of the IP course, several functions are provided to read, write and display these images. These functions should be made available to your Matlab session. This is done by adding the path to the location of these routines.

If you are working on a different machine you should copy these files to a local directory on your machine and set the path accordingly. This is done by choosing the "set path" command from the File menu, or at the Matlab command line call:  path(path,'full path to directory of routines');

The routines are in the TOOLBOX directory which can be found  here .
The available files (1 routine per file) are:
readImage.m - reads a grayscale image from a file. Image is in TIF format.
writeImage.m - writes a grayscale image onto a file in TIF format.
showImage.m - opens a window and displays a grayscale image in its true size.
putImage.m - opens a window and displays a grayscale image in a resizable mode.

In the TOOLBOX you can also find some sample programs (see below).
In the IMAGES directory you can find some sample images to work with.

These routines may not be compatible with Matlab Version 4.

What do I hand in as IP homework?

The homework assignments will be to write "programs" in Matlab. In practice this will usually mean writing scripts and/or functions (m-file). Your function may call other functions which you have created.
Your homework will be evaluated interactively by calling your function with various inputs. That is why you
must make sure the m-files are named according to the function names defined in the homework.
Examples of functions in m-files can also be found in the toolbox. The available examples are:
thresholdImage.m - creates a binary image by thresholding a grayscale image.
euler.m - returns the Euler number of a binary image.

How do I hand in IP homework?

Since homework checking will be performed interactively you will have to submit all m-files associated with your homework.  Homework will be submitted via email. Make sure student names and i.d. are marked.

How will homework be graded?

Checking will be interactive. Points will be given per correct output for each input. The efficiency of your algorithm will be checked as well. Try to avoid loops in your program if  Matlab enables it.  Points will also be given for clean and well documented m-files!!! Make sure you write documentation at the head of each function/file and also in the midst (see example m-files). Make sure your Names and Student I.D.s are also in the documentation at the head of the file. Homework must be submitted ON TIME. Penalty points (10) will be deducted for every day beyond the deadline.

Back to Image Processing home page