120 likes | 280 Views
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
E N D
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 • Some important steps and information of final project • How to debug the user defined function
Important reminders of final project • Deadline:Mon Dec. 15 at 23:59pm. • Penalty for late submission • Tue. Dec. 16 00:00 - 23:59 25% deduction • Wed. Dec. 17 00:00 - 23:59 50% deduction • Thu. Dec. 18 00:00 - 23:59 75% deduction • After Dec. 18 23:59 Zero point • Please try your best to finish the project and submit it on time !
Important reminders of final project • 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.
Important reminders of final project • 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!
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.mandDecompress.m. • Don't read the image file when youmodify Compress.mandDecompress.m, otherwise, you will get zero point in the final project.
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 variablesused 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. 7
Review of Lab 2 about User-Defined Function function output = poly(x) % This function calculates the value of a third-order % polynomial output = 3*x.^3+5*x.^2-2*x+1 comments 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) 8
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.
The First Step to Debug User-Defined Function Set breakpoint at the line of the Entry to the user-defined functionin the main.m
The Second Step to Debug User-Defined Function Run main.m to the Entry
The Third Step to Debug User-Defined Function Click Step in button and go into the user-defined function