Lab of COMP 319

Preview:

DESCRIPTION

Lab of COMP 319. Final Project: Image Compression with MATLAB. Lab tutor : Yao Zhang, Shenghua ZHONG Email: zsh696@gmail.com csshzhong@comp.polyu.edu.hk Lab 4: Nov 30, 2011. Outline of Lab 4. Some important reminders of final project - PowerPoint PPT Presentation

Citation preview

1

Lab of COMP 319

Lab tutor : Yao Zhang, Shenghua ZHONGEmail: zsh696@gmail.com

csshzhong@comp.polyu.edu.hk

Lab 4: Nov 30, 2011

Final Project: Image Compression with MATLAB

2

Outline of Lab 4

Some important reminders of final project

Some important steps and information of final project

How to debug the user defined function

3

Important reminders of final project

1. Deadline: Mon Dec. 15 at 23:59pm .

Penalty for late submission

Tue. Dec. 16       00:00 - 23:59          25% deductionWed. Dec. 17     00:00 - 23:59           50% deductionThu. Dec. 18       00:00 - 23:59          75% deductionAfter Dec. 18 23:59                       Zero point

• Please try your best to finish the project and submit it on time !

4

Important reminders of final project

2. There are only two functions should be and can be modified and submitted: Compress.m and Decompress.m.

• There is no need to submit a final project report.

• your personal compress.m and decompress.m functions will be scored by using the uniform main.m function, so submission of other functions or files is useless and unallowed.

5

Important reminders of final project

3. You can observe the MSE value and the compression ratio to check the performance of your functions.

• The MSE value and compression ratio will be given above your recovered image, you can check them according to the grading sample listed on the course’s webpage.

• The compression ratio should larger than 1, otherwise the score of your final project will be zero!

6

Important reminders of final project

4. The components in the matrixes orig_image, comp_image and reco_image should be the integers.

• The size of the reco_image should be same with the size of orig_image.

• Don't make any modification of the provided functions expect  Compress.m  and  Decompress.m.

• Don't read the image file when you modify Compress.m  and  Decompress.m, otherwise, you will get zero point in the final project.

77

How to Debug User-Defined Function

• User-defined functions are stored as M-files. Each must start with a function definition line that contains the word “function”, one or several variables that defines the function output, a function name, and one or several variables used for the input argument. Save the function as M-file using the same name in your function

• Some examples: • function output = my_function(x) • function [output1, output2] = my_function(x1,x2,x3)

• Hints: The function name and the names of the input and output variables are arbitrary and selected by the programmer, but the word “function” can not be changed.

88

Review of Lab 2 about User-Defined Function

function output = poly(x)% This function calculates the value of a third-order % polynomialoutput = 3*x.^3+5*x.^2-2*x+1

Save above commands into an M-file and then type the below commands in command window to observe the results: >> a=4; >> poly(a) >> b=1:5; >> poly(b)

comments

9

How to Debug User-Defined Function

• Compress.m, Decompress.m, and xxx.m except main.m are both user-defined function.

• They like a black box (user only know the input and output parameters)

• Debug is important to check whether the programms are correct.

10

The First Step to Debug User-Defined Function

Set breakpoint at the line of the Entry to the user-defined function in the main.m

11

The Second Step to Debug User-Defined Function

Run main.m to the Entry

12

The Third Step to Debug User-Defined Function

Click Step in button and go into the user-defined function

Recommended