1 lab of comp 319 lab tutor : yao zhang, shenghua zhong email: [email protected]...
TRANSCRIPT
![Page 1: 1 Lab of COMP 319 Lab tutor : Yao Zhang, Shenghua ZHONG Email: zsh696@gmail.com csshzhong@comp.polyu.edu.hk Lab 4: Nov 30, 2011 Final Project: Image Compression](https://reader036.vdocuments.net/reader036/viewer/2022062314/56649ec95503460f94bd735f/html5/thumbnails/1.jpg)
1
Lab of COMP 319
Lab tutor : Yao Zhang, Shenghua ZHONGEmail: [email protected]
Lab 4: Nov 30, 2011
Final Project: Image Compression with MATLAB
![Page 2: 1 Lab of COMP 319 Lab tutor : Yao Zhang, Shenghua ZHONG Email: zsh696@gmail.com csshzhong@comp.polyu.edu.hk Lab 4: Nov 30, 2011 Final Project: Image Compression](https://reader036.vdocuments.net/reader036/viewer/2022062314/56649ec95503460f94bd735f/html5/thumbnails/2.jpg)
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
![Page 3: 1 Lab of COMP 319 Lab tutor : Yao Zhang, Shenghua ZHONG Email: zsh696@gmail.com csshzhong@comp.polyu.edu.hk Lab 4: Nov 30, 2011 Final Project: Image Compression](https://reader036.vdocuments.net/reader036/viewer/2022062314/56649ec95503460f94bd735f/html5/thumbnails/3.jpg)
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 !
![Page 4: 1 Lab of COMP 319 Lab tutor : Yao Zhang, Shenghua ZHONG Email: zsh696@gmail.com csshzhong@comp.polyu.edu.hk Lab 4: Nov 30, 2011 Final Project: Image Compression](https://reader036.vdocuments.net/reader036/viewer/2022062314/56649ec95503460f94bd735f/html5/thumbnails/4.jpg)
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.
![Page 5: 1 Lab of COMP 319 Lab tutor : Yao Zhang, Shenghua ZHONG Email: zsh696@gmail.com csshzhong@comp.polyu.edu.hk Lab 4: Nov 30, 2011 Final Project: Image Compression](https://reader036.vdocuments.net/reader036/viewer/2022062314/56649ec95503460f94bd735f/html5/thumbnails/5.jpg)
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!
![Page 6: 1 Lab of COMP 319 Lab tutor : Yao Zhang, Shenghua ZHONG Email: zsh696@gmail.com csshzhong@comp.polyu.edu.hk Lab 4: Nov 30, 2011 Final Project: Image Compression](https://reader036.vdocuments.net/reader036/viewer/2022062314/56649ec95503460f94bd735f/html5/thumbnails/6.jpg)
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.
![Page 7: 1 Lab of COMP 319 Lab tutor : Yao Zhang, Shenghua ZHONG Email: zsh696@gmail.com csshzhong@comp.polyu.edu.hk Lab 4: Nov 30, 2011 Final Project: Image Compression](https://reader036.vdocuments.net/reader036/viewer/2022062314/56649ec95503460f94bd735f/html5/thumbnails/7.jpg)
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.
![Page 8: 1 Lab of COMP 319 Lab tutor : Yao Zhang, Shenghua ZHONG Email: zsh696@gmail.com csshzhong@comp.polyu.edu.hk Lab 4: Nov 30, 2011 Final Project: Image Compression](https://reader036.vdocuments.net/reader036/viewer/2022062314/56649ec95503460f94bd735f/html5/thumbnails/8.jpg)
88
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
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
![Page 9: 1 Lab of COMP 319 Lab tutor : Yao Zhang, Shenghua ZHONG Email: zsh696@gmail.com csshzhong@comp.polyu.edu.hk Lab 4: Nov 30, 2011 Final Project: Image Compression](https://reader036.vdocuments.net/reader036/viewer/2022062314/56649ec95503460f94bd735f/html5/thumbnails/9.jpg)
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.
![Page 10: 1 Lab of COMP 319 Lab tutor : Yao Zhang, Shenghua ZHONG Email: zsh696@gmail.com csshzhong@comp.polyu.edu.hk Lab 4: Nov 30, 2011 Final Project: Image Compression](https://reader036.vdocuments.net/reader036/viewer/2022062314/56649ec95503460f94bd735f/html5/thumbnails/10.jpg)
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
![Page 11: 1 Lab of COMP 319 Lab tutor : Yao Zhang, Shenghua ZHONG Email: zsh696@gmail.com csshzhong@comp.polyu.edu.hk Lab 4: Nov 30, 2011 Final Project: Image Compression](https://reader036.vdocuments.net/reader036/viewer/2022062314/56649ec95503460f94bd735f/html5/thumbnails/11.jpg)
11
The Second Step to Debug User-Defined Function
Run main.m to the Entry
![Page 12: 1 Lab of COMP 319 Lab tutor : Yao Zhang, Shenghua ZHONG Email: zsh696@gmail.com csshzhong@comp.polyu.edu.hk Lab 4: Nov 30, 2011 Final Project: Image Compression](https://reader036.vdocuments.net/reader036/viewer/2022062314/56649ec95503460f94bd735f/html5/thumbnails/12.jpg)
12
The Third Step to Debug User-Defined Function
Click Step in button and go into the user-defined function