0% found this document useful (0 votes)
25 views5 pages

Lec - 07 SIP CIS-322 - Funda3

kl;,./

Uploaded by

Farah Jahangir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views5 pages

Lec - 07 SIP CIS-322 - Funda3

kl;,./

Uploaded by

Farah Jahangir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

11/24/2024

Objectives

Lecture No. 7
• Image interpolation

Digital Image Fundamentals • Relationships between pixels

• Distance measures

CIS-322

Image Interpolation Image Interpolation (contd.)

• The process of using known data to estimate values at • Three techniques are:
unknown locations
• Image Interpolation is used extensively for  Nearest Neighbor Interpolation
 Zooming
 Shrinking  Bilinear Interpolation
 Rotating
 Geometric corrections  Bicubic Interpolation
• Zooming requires:
 The creation of new pixel locations
 The assignment of gray levels to those new locations

Nearest Neighbor Interpolation (contd.) Nearest Neighbor Interpolation (contd.)

• 500 x 500 sized image to be scaled to 1.5 times


• 750 x 750 grid is prepared with the same pels
spacing as in the above image
• We now compress the grid of 7502 to 5002
• The pixels spacing in the new image is shrunken
• We have to assign the correct intensity to the overlay
• By selecting the proper intensity from the underlay
image, the overlay is ready
• 7502 image is expanded to the original size to get the
actual picture quality

1
11/24/2024

Nearest Neighbor Interpolation (contd.)

• Method is quite simple:

 Assign to each new location the intensity of its Some Basic Relationships
nearest neighbor between Pixels
• Quick as it is very simple (advantage)

• Hardly used because of straight edges distortion artifact


(disadvantage)

Neighbors of a Pixel Neighbors of a Pixel (contd.)

• 4-neighbors of “p” are the four horizontal and vertical • The four diagonal neighbors of p(x, y) are ND(p)
neighbors of a point p(x, y) as given by N4(p) (x+1, y+1), (x+1, y-1), (x-1, y+1), (x-1, y-1)
(x+1, y), (x-1, y), (x, y +1), (x, y-1)

(x) (x+1)
(x-1) (x) (x+1)
f(x,y) is a yellow circle
(x-1)
f(x,y) is a yellow circle
(y-1) f(x,y-1) is top one (y-1) f(x+1,y-1) is top-right one
f(x-1,y) is left one (y)
f(x-1,y-1) is top-left one
(y)
f(x,y+1) is bottom one f(x-1,y+1) is bottom-left one
(y+1)
(y+1)
f(x+1,y) is right one f(x+1,y+1) is bottom-right one

Neighbors of a Pixel (contd.) Adjacency

• The 4-neighbors together with diagonal neighbors of (x, y) • V is the set of gray-level values used to define
are called 8-neighbors N8(p) of (x, y)
adjacency (e.g. V={1} for adjacency of pixels of
value 1)
• Three types are:
(x) (x+1)
(x-1)
f(x,y) is a yellow circle
(y-1) (x-1,y-1), (x,y-1),(x+1,y-1),  4-Adjacency
(y)
(x-1,y), (x,y), (x+1,y),  8-Adjacency
(x-1,y+1),(x,y+1), (x+1,y+1)  m-adjacency
(y+1)

2
11/24/2024

Adjacency (contd.) Adjacency (contd.)

• 4-Adjacency: Two pixels p and q with values from V • 8-Adjacency: Two pixels p and q with values from
are 4-adjacent if q is in the set N4(p), V ={1} V are 8-adjacent if q is in the set N8(p), V ={1}

0 1 1 0 0 1 1 0

1 1 0 1 1 1 0 1

0 0 1 1 0 0 1 1

Adjacency (contd.) Adjacency (contd.)

• m-adjacency (mixed adjacency): Two pixels p • m-adjacency (mixed adjacency)


and q with values from V are m-adjacent if
 q is in N4(p), or
0 1 1 0
 q is in ND(p) and the set N4(p)∩N4(q) has no
pixels whose values are from V
1 1 0 1
• Mixed adjacency is a modification of 8-adjacency
and is used to eliminate the multiple path
connections that often arise when 8-adjacency is 0 0 1 1

used

Adjacency (contd.) Path


• A path from pixel p(x, y) to pixel q(s, t) is a sequence of
pixels with coordinates (x0, y0),(x1, y1)………(xn, yn) such
that
 (x0, y0) = (x, y)
 (xn, yn) = (s, t)
 Intermediate pixels are adjacent (n is the length of the path)

• For a closed path (xo, yo) = (xn, yn)


• 4-, 8- and m-paths may be defined depending on the type
of adjacency specified

3
11/24/2024

Path Connectivity

• S = Subset of pixels in an image


• Two pixels p and q are connected if path is
between them in S (lying in V)
• For any pixel p in S, the set of pixels that are
connected to it in S is called a connected
8-paths m-paths component of S
• If S has only one connected component then S is
called a connected set

Region Region (contd.)

• R = Subset of pixels in an image. We call R a region • Only 4- and 8- adjacency is considered for regions
of the image if R is a connected set • Ri and Rj are considered adjacent by 8-adjacency
only (no 4 path exists between the two regions, so their
• Regions not connected are disjoint union is not a connected set in that case)

• Ri and Rj are said to be adjacent if their union forms


a connected set

Foreground and Background of Image Boundary


• The boundary of a region R is constituted of the set of
points that are adjacent to points in the complement of R
• An image have K disjoint regions Rk, where k = 1,
2, 3,…, K • In another way, it is set of pels that have at least one
background neighbor
• Ru = Union of all the K regions • Regional points and background points are defined in
terms of 8-connectivity (4-connectivity fails between
• (Ru)c = Complement of Ru background and region)

• All points in Ru are called the Foreground of the


image
• All points in (Ru)c denoted as Background of the
image

4
11/24/2024

Edge Distance Measures


• The boundary of a finite region forms a closed path
(a global concept) • For pixels p, q, z with coordinates (x, y), (s, t), (u,
• Edges are formed from pixels with derivative v), D is a distance function if:
values that exceed a preset threshold (a local
concept)  D(p, q) ≥ 0 (D(p, q) = 0 iff p = q)
• Edges are based on intensity level measurement at  D(p, q) = D(q, p)
a discontinuity  D(p, z) ≤ D(p, q) + D(q, z)
• Exception: edge and boundary are same in case of
binary images (the edge extracted from binary region
would be same as the region boundary)

Distance Measures (contd.) Distance Measures (contd.)

• The Euclidean distance between p and q is • The D4 distance (also called city-block distance) between p and q
is
𝐷4 𝑝, 𝑞 = 𝑥 − 𝑠 + 𝑦 − 𝑡
De(p, q)=[(x-s)2+(y-t)2]1/2  the pels having a D4 distance from (x, y) less than or equal to
some value r form a diamond centered at (x, y)
[Fig: pixels with D4 ≤ 2 from (x, y) ]
• Pixels having a distance from (x, y) less than or 2
equal to a disc of radius r centered at (x, y) 2 1 2
2 1 0 1 2
2 1 2
2

Distance Measures (contd.) Distance Measures (contd.)

• The D8 distance (or chessboard distance) between p and q is • For example assume p, p2, p4 = 1
𝐷8 𝑝, 𝑞 = max( 𝑥 − 𝑠 , 𝑦 − 𝑡 ) p1, p3 = 0 or 1
 the pels with a D8 distance from (x, y) less than or equal to some
value r form a square centered at (x, y)  If only connectivity of pixels valued 1 is
[Fig: pixels with D8≤2 from (x, y) ] p3 p4 allowed, and p1 and p3 are 0, the m-distance
p1 p2 between p and p4 is 2
2 2 2 2 2
p  If either p1 or p3 is 1, the distance is 3
2 1 1 1 2
2 1 0 1 2
 If both p1 and p3 are 1, the distance is 4
2 1 1 1 2
2 2 2 2 2

You might also like