Download presentation
Presentation is loading. Please wait.
Published byCandice Bradley Modified over 9 years ago
1
A Brief Introduction to MATLAB Digital Image Processing 2014 Fall NTU
2
Outline MATLAB overview Matrix 2-D plotting 3-D plotting Image Processing more about MATLAB Reference
3
Outline MATLAB overview Matrix 2-D plotting 3-D plotting Image Processing more about MATLAB Reference
4
MATLAB NTU AppShare ( 臺大雲端軟體運算銀行 ) – Windows & IE https://app.ntu.edu.tw/vdiportal/
5
MATLAB interface
6
basic operation
7
variables English alphabet, number, underline – first word must be English alphabet – variable length <= 32 characters variables need not be previously declared (default double) comments – %
8
operators arithmetic operators – +, -, *, /, ^ relational operators – ==, ~=, >, >=, <, <= logical operators – &, |, ~ bitwise operators – bitand, bitor, bitxor
9
flow control conditional control – if-else – switch loop control – for – while – continue
10
script or type “edit filename.m” to create a script from command window Click to create a new script
11
Outline MATLAB overview Matrix 2-D plotting 3-D plotting Image Processing more about MATLAB Reference
12
matrix creation row vector – R = [7 8 9 10]; – R = [7, 8, 9, 10]; column vector – C = [7; 8; 9; 10]; build vector fast – start:step:end – linspace(start, end, num);
13
extract sub-matrix A = [1 2 3 4; 5 6 7 8; 9 10 11 12]; B = A(1, 2:4); C = A(2:3, 2:3); D = A([1 3], [1 2 3]); 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 123123
14
Matrix operations add Scalar
15
Matrix operation(Cont’d) matrix multiplication array multiplication
16
Outline MATLAB overview Matrix 2-D plotting 3-D plotting Image Processing more about MATLAB Reference
17
2-D plotting
18
subplot Example 2 : create figure with multiple graphs
19
Axis control Axis control example :
20
histogram hist(data) : histogram plot – data = randn(1000, 3); – hist(data, 20);
21
Outline MATLAB overview Matrix 2-D plotting 3-D plotting Image Processing more about MATLAB Reference
22
3-D plotting Example 1 : mesh graph
23
3-D plotting (Cont’d) Example 2 : surface graph
24
3-D plotting (Cont’d) Example 3 : 3-d curve
25
Outline MATLAB overview Matrix 2-D plotting 3-D plotting Image Processing more about MATLAB Reference
26
overview Basic commands : – img = imread(‘lena.jpg’, ‘jpg’); – imwrite(img, ‘my_lena.jpg’, ‘jpg’); – imfinfo(‘lena.jpg’) – image(img);
27
Image load and display
28
image scale imresize(img, scale) – resize image
29
image rotation I2 = imrotate(I, 60, ‘nearest’); I3 = imrotate(I, 60, ‘bilinear’); Nearest interpolationBilinear interpolation Original image
30
filter h1 = fspecial(‘laplacian’); f1 = filter2(h1, double(f)/255); h2 = fspecial(‘sobel’); f2 = filter2(h2, double(f)/255); laplacian filtersobel filter original image
31
edge detection f3 = egde(f, ‘sobel’); f4 = edge(f, ‘canny’); edge detection by sobel method edge detection by canny method original image
32
Outline MATLAB overview Matrix 2-D plotting 3-D plotting Image Processing more about MATLAB Reference
33
more about MATLAB more on, more off : control paged output for command window help function_name : help for functions in command window lookfor keyword : search for keyword in all help entries
34
Outline MATLAB overview Matrix 2-D plotting 3-D plotting Image Processing more about MATLAB Reference
35
reference Mathworks document Mathworks forum Tutorial from Jyh-Shing Roger Jang
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.