DIGITAL IMAGE PROCESSING Lecture Series 3-Spring 2023

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 55

CS457 DIGITAL IMAGE PROCESSING

Lecture Series 3
Fundamentals of Image
Processing
https://m-wasim.wixsite.com/m-wasim DIGITAL IMAGE PROCESSING BY DR. M. WASIM 1
ORIGINS OF DIGITAL IMAGE
PROCESSING

Sent by submarine cable


between London and New
York, the transportation time
was reduced to less than
three hours from more than a
week

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 2


ORIGINS OF DIGITAL IMAGE
PROCESSING

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 3


SOURCES FOR IMAGES
 Electromagnetic (EM) energy spectrum
 Acoustic
 Ultrasonic
 Electronic
 Synthetic images produced by computer

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 4


ORIGINS OF DIGITAL IMAGE
PROCESSING

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 5


ELECTROMAGNETIC (EM)
ENERGY SPECTRUM

Gamma-ray imaging: nuclear medicine and astronomical observations


X-rays: medical diagnostics, industry, and astronomy, etc.
Ultraviolet: lithography, industrial inspection, microscopy, lasers, biological imaging, and astronomical
observations
Visible and infrared bands: light microscopy, astronomy, remote sensing, industry, and law enforcement
Microwave band: radar
Radio band: medicine (such as MRI) and astronomy

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 6


GAMA-RAYS IMAGING

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 7


X-RAY IMAGING

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 8


ULTRAVIOLET IMAGING

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 9


LIGHT MICROSCOPY IMAGING

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 10


VISUAL AND INFRARED
IMAGING

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 11


INFRARED SATTELITE
IMAGING

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 12


AUTOMATED VISUAL
INSPECTION

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 13


AUTOMATED VISUAL
INSPECTION

Results of
automated
reading of the
plate content by
the system

The area in which


the imaging system
detected the plate

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 14


EXAMPLE OF RADAR IMAGES

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 15


EXAMPLE OF MRI (RADIO
BAND)

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 16


ULTRA SOUND IMAGES

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 17


IMAGE ACQUISITION PROCESS

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 18


SIMPLE IMAGE FORMATION
MODEL
f ( x, y )  i ( x, y )r ( x, y )

f ( x, y ) : intensity at the point (x, y)


i ( x, y ) : illumination at the point (x, y )
(the amount of source illumination incident on the scene)
r ( x, y ) : reflectance/transmissivity at the point (x, y )
(the amount of illumination reflected/transmitted by the object)
where 0 < i ( x, y ) <  and 0 < r ( x, y) < 1

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 19


IMAGE SAMPLING &
QUANTIZATION

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 20


REPRESENTATION OF DIGITAL
IMAGES
The representation of an M×N numerical array as

 f (0, 0) f (0,1) ... f (0, N  1) 


 f (1, 0) f (1,1) ... f (1, N  1) 
f ( x, y )  
 ... ... ... ... 
 
 f ( M  1, 0) f ( M  1,1) ... f ( M  1, N  1) 

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 21


REPRESENTATION OF DIGITAL
IMAGES
The representation of an M×N numerical array as

 a0,0 a0,1 ... a0, N 1 


 a a1,1 ... a1, N 1  
A  1,0

 ... ... ... ... 


 
 aM 1,0 aM 1,1 ... aM 1, N 1 

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 22


REPRESENTATION OF DIGITAL
IMAGES
The representation of an M×N numerical array in
MATLAB

 f (1,1) f (1, 2) ... f (1, N ) 


 f (2,1) f (2, 2) ... f (2, N ) 
f ( x, y )  
 ... ... ... ... 
 
 f ( M ,1) f ( M , 2) ... f (M , N )

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 23


REPRESENTATION OF DIGITAL
IMAGES
Discrete intensity interval [0, L-1], L=2k

The number b of bits required to store a M × N digitized


image

b=M×N×k

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 24


REPRESENTATION OF DIGITAL
IMAGES

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 25


SPATIAL AND INTENSITY
RESOLUTION
• Spatial resolution
— A measure of the smallest discernible detail in an image
— stated with line pairs per unit distance, dots (pixels) per unit
distance, dots per inch (dpi)

• Intensity resolution
— The smallest discernible change in intensity level
— stated with 8 bits, 12 bits, 16 bits, etc.

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 26


IMAGES INTERPOLATION
• Interpolation — Process of using known data to estimate unknown values
e.g., zooming, shrinking, rotating, and geometric correction

• Interpolation (sometimes called resampling) — an imaging method to


increase (or decrease) the number of pixels in a digital image.
Some digital cameras use interpolation to produce a larger image than the
sensor captured or to create digital zoom

http://www.dpreview.com/learn/?/key=interpolation

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 27


NEAREST NEIGHBORHOOD
INTERPOLATION
f1(x2,y2) = f(x1,y1)
f(round(x2), round(y2))
=f(x1,y1)

f1(x3,y3) =
f(round(x3), round(y3))
=f(x1,y1)

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 28


BILINEAR INTERPOLATION

(x,y)

f 2 ( x, y )
 (1  a )(1  b) f (l , k )  a (1  b)  f (l  1, k )
 (1  a )b  f (l , k  1)  a b  f (l  1, k  1)
l  floor ( x ), k  floor ( y ), a  x  l , b  y  k .
DIGITAL IMAGE PROCESSING BY DR. M. WASIM 29
BI-CUBIC INTERPOLATION

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 30


BASIC RELATIONS BETWEEN
PIXELS
• Neighborhood

• Adjacency

• Connectivity

• Paths

• Regions and boundaries

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 31


BASIC RELATIONS BETWEEN
PIXELS
• Neighbors of a pixel p at coordinates (x,y)
• 4-neighbors of p, denoted by N4(p):
(x-1, y), (x+1, y), (x,y-1), and (x, y+1).
• 4 diagonal neighbors of p, denoted by ND(p):
(x-1, y-1), (x+1, y+1), (x+1,y-1), and (x-1, y+1).
• 8 neighbors of p, denoted N8(p)
N8(p) = N4(p) U ND(p)

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 32


BASIC RELATIONS BETWEEN
PIXELS
• Adjacency
Let V be the set of intensity values

• 4-adjacency: Two pixels p and q with values from V are


4-adjacent if q is in the set N4(p).

• 8-adjacency: Two pixels p and q with values from V are


8-adjacent if q is in the set N8(p).

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 33


BASIC RELATIONS BETWEEN
PIXELS
• Adjacency
Let V be the set of intensity values

• m-adjacency: Two pixels p and q with values from V are


m-adjacent if
(i) q is in the set N4(p), or
(ii) q is in the set ND(p) and the set N4(p) ∩ ND(p) has
no pixels whose values are from V.

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 34


BASIC RELATIONS BETWEEN
PIXELS
 Path
• A (digital) path (or curve) from pixel p with coordinates (x0, y0) to pixel q
with coordinates (xn, yn) is a sequence of distinct pixels with coordinates
(x0, y0), (x1, y1), …, (xn, yn)
Where (xi, yi) and (xi-1, yi-1) are adjacent for 1 ≤ i ≤ n.
• Here n is the length of the path.

• If (x0, y0) = (xn, yn), the path is closed path.


• We can define 4-, 8-, and m-paths based on the type of adjacency
used.

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 35


EXAMPLE: ADJACENCY AND
PATH
V = {1, 2}

0 1 1 0 1 1 0 1 1
0 2 0 0 2 0 0 2 0
0 0 1 0 0 1 0 0 1

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 36


EXAMPLE: ADJACENCY AND
PATH
V = {1, 2}

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 37


EXAMPLE: ADJACENCY AND
PATH

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 38


EXAMPLE: ADJACENCY AND
PATH

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 39


BASIC RELATIONS BETWEEN
PIXELS
Connected in S
Let S represent a subset of pixels in an image. Two pixels p with
coordinates (x0, y0) and q with coordinates (xn, yn) are said to be
connected in S if there exists a path

(x0, y0), (x1, y1), …, (xn, yn)

Where i, 0  i  n, ( xi , yi )  S

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 40


BASIC RELATIONS BETWEEN
PIXELS
Let S represent a subset of pixels in an image
• For every pixel p in S, the set of pixels in S that are connected to p
is called a connected component of S.
• If S has only one connected component, then S is called Connected
Set.
• We call R a region of the image if R is a connected set
• Two regions, Ri and Rj are said to be adjacent if their union forms a
connected set.
• Regions that are not to be adjacent are said to be disjoint.

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 41


BASIC RELATIONS BETWEEN
PIXELS
 Boundary (or border)
• The boundary of the region R is the set of pixels in the region that have one or
more neighbors that are not in R.
• If R happens to be an entire image, then its boundary is defined as the set of
pixels in the first and last rows and columns of the image.
• Foreground and background
• An image contains K disjoint regions, Rk, k = 1, 2, …, K. Let Ru denote the union of
all the K regions, and let (Ru)c denote its complement.
All the points in Ru is called foreground;
All the points in (Ru)c is called background.

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 42


BASIC RELATIONS BETWEEN
PIXELS
Boundary (or border)

The boundary of the region R is the set of pixels in the region that have one
or more neighbors that are not in R.
If R happens to be an entire image, then its boundary is defined as the set of
pixels in the first and last rows and columns of the image.

Foreground and background

An image contains K disjoint regions, Rk, k = 1, 2, …, K. Let Ru denote the


union of all the K regions, and let (Ru)c denote its complement.
All the points in Ru is called foreground;
All the points in (Ru)c is called background.
DIGITAL IMAGE PROCESSING BY DR. M. WASIM 43
BASIC RELATIONS BETWEEN
PIXELS

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 44


BASIC RELATIONS BETWEEN
PIXELS

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 45


BASIC RELATIONS BETWEEN
PIXELS

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 46


BASIC RELATIONS BETWEEN
PIXELS

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 47


BASIC RELATIONS BETWEEN
PIXELS

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 48


BASIC RELATIONS BETWEEN
PIXELS

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 49


BASIC RELATIONS BETWEEN
PIXELS
DISTANCE MEASURE

 Given pixels p, q and z with coordinates (x, y), (s, t), (u, v)
respectively, the distance function D has following properties:

 D(p, q) ≥ 0 [D(p, q) = 0, iff p = q]

 D(p, q) = D(q, p)

 D(p, z) ≤ D(p, q) + D(q, z)

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 50


BASIC RELATIONS BETWEEN
PIXELS

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 51


BASIC RELATIONS BETWEEN
PIXELS

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 52


BASIC RELATIONS BETWEEN
PIXELS

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 53


BASIC RELATIONS BETWEEN
PIXELS

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 54


BASIC RELATIONS BETWEEN
PIXELS

DIGITAL IMAGE PROCESSING BY DR. M. WASIM 55

You might also like