Introduction
Introduction
References
1
Syllabus
2
Introduction
Digital Image
Two dimensional function denoted as f(x, y)
x and y are spatial coordinates
Amplitude of f is called intensity or gray level
at the point (x, y)
5
Digital Image Display
Displayed on CRTs or LCDs
6
Digital Image Processing
7
MATLAB
MATLAB stands for matrix laboratory.
9
MATLAB Editor
10
MATLAB Coordinate Convention
11
Digital Image
12
Digital Image Formats
DICOM (Digital Imaging and Communications in
Medicine) is the most widely used image format in
medical imaging
14
Other Digital Image Formats
15
Image Input
Images are read into MATLAB using imread function
For example
>> f = imread (‘chestxray.jpg’);
Reads the JPEG image chestxray.jpg into
image array f
Semicolon ; at the end of a command line is used to
suppress the output. If ; is not included MATLAB
displays the results of the operation specified in that
line
Prompt symbol (>>) designates the beginning of a
command line
16
DICOM Image Input
For example
17
Displaying Images
Syntax: imshow(f, G)
18
Displaying Images
19
Displaying Images
20
Displaying Images
22
Data Classes and Image Types
23
Data Classes and Image Types
M
24
Data Classes and Image Types
25
Binary Images
26
Binary Images
27
Binary Images
28
Image Types
MATLAB supports four types of images
1. Intensity images
2. Binary images
3. Indexed images
4. RGB images
29
Intensity Images
30
Converting between Image Classes and Types
M
31
Matrix Indexing
Matrices can be represented as a sequence of row
vectors enclosed by square brackets and separated
by semicolons. For example typing
>> A = [1 2 3; 4 5 6; 7 8 9]
32
Some Important Standard Arrays
Can generate simple image arrays using
34
MATLAB Function Programming
First line of a function M-file is the function definition
line and it has the form
Example
function [s, p] = sumprod (f, g)
36
Arithmetic Operators
38
MATLAB Arithmetic Operators
39
Relational Operators
Operator Name
< Less than
<= Less than or equal
> Greater than
>= Greater than or equal
== Equal to
~= Not equal to
40
Logical Operators
Operator Description
& Elementwise AND
| Elementwise OR
~ Elementwise and scaler NOT
&& Scalar AND
|| Scalar OR
41
Flow Control Statements
M
42