Lab of comp 3 19 Image Processing with MATLAB Lab tutor: Shenghua ZHONG Email:Zsh696(@gmail.com cSshzhong@comp. polyu. edu. hk Lab 2: nov 9.2011
1 Lab of COMP 319 Lab tutor : Shenghua ZHONG Email: zsh696@gmail.com csshzhong@comp.polyu.edu.hk Lab 2: Nov 9, 2011 Image Processing with MATLAB
Outline of lab 3 1. Review of lab 2 2. user defined function 3. Execution control 4. Plots and graphs using Matlab 5. Basic manipulation in image processing 6. Color image compression
3 Outline of Lab 3 1. Review of Lab 2 2. User defined function 3. Execution control 4. Plots and graphs using Matlab 5. Basic manipulation in image processing 6. Color image compression
Review of Lab 2 about Data StructureA 1. Introduction the basic data structure in matlab Vector and array 2. The distinct attributes of these data structures Numerical value ndex /22 2 门 Index The second row and first collum mI m2 Value: a
4 Review of Lab 2 about Data Structure 1. Introduction the basic data structure in Matlab • Vector and Array 2. The distinct attributes of these data structures • Numerical Value • Index
Review of Lab 2 about Data StructureA 3. What we have learnt How to create them For example: A=3, 4, 5; 6,5.5,01 How to manipulate them For example: A(1, 1: 2)=A(1, 1: 2 )+2 How to access their elements For example: B=A(1, 1: 2) How to perform mathematical and logical operations on them For example: C=A /2.5; D= sum(sum(A) For example: E=A>0.5
5 Review of Lab 2 about Data Structure 3. What we have learnt • How to create them • For example: A = [3, 4, 5; 6, 5.5, 0] • How to manipulate them • For example: A(1,1:2) = A(1,1:2) + 2 • How to access their elements • For example: B = A(1,1:2) • How to perform mathematical and logical operations on them • For example: C = A./2.5; D = sum(sum(A)) • For example: E = A > 0.5
Review of lab 2 about m file File”-“New”-“ Script”/“ Function” 1)MATLAB 7.12.0(R2011a 口x File Edit Debug Desktop Window Help New Ctrl+N win 32\ Matlab\R2011a\ bin Ctrl+o Function Close Command window Enumeration 日x× Workspace Import Data see Demos Save Workspace As Curls Figure 回回喝区se variable value Set Path. Preferences GUI Page Setup Deployment Project Print Ctrl+P 1 D: \.A2\Lab2\exercise2.m 2 D: \.A2\Lab2\exercise1. m 3 C: \. Desktop\exercise1.m Command History 十口X 4 C: \. Desktop\exercises.m Exit MATLAB mean (A) omcc. bat mean (mean(A)) 自 mex. pl 可] mexext, bat exercise 回 mexsetup pm 回 mexutils pm mean (A) a msvc_modules_installer,pm Lmax v, max w]= max (A) %—2011-10-1119:52% a Start Ready 6
6 Review of Lab 2 about M file • “File” - “New” - “Script”/“Function