You are on page 1of 30

Basic Pixel Relationships

Connectivity
• Two pixels are connected if:

• They are neighbors (i.e. adjacent in some sense -- e.g. N4(p), N8(p), …)
• Their gray levels satisfy a specified criterion of similarity (e.g. equality, …)

• V is the set of gray-level values used to define adjacency (e.g. V={1}


for adjacency of pixels of value 1)
Adjacency
• We consider three types of adjacency:
• V is the set of gray-level values used to define adjacency (e.g. V={1}
for adjacency of pixels of value 1)( the matrix considered for binary
image so it has 0 and 1)
• 4-adjacency: two pixels p and q with values from V are 4-adjacent if q is in the
set N4(p)
• 8-adjacency : p & q are 8- adjacent if q is in the set N8(p)
q
0 1 1 0 1 1
0 p1 0 0 1 0
0 0 1 0 0 1
4-Adjacency 8-Adjacency
Adjacency
• The third type of adjacency:

• m-adjacency: p & q with values from V are m-adjacent if

• q should be in N4(p) or
• q should be in ND(p) and the set N4(p)N4(q) has no pixels with values from V

0 1 1
0 1 0
0 0 1
m-Adjacency
Adjacency
• Mixed adjacency is a modification of 8-adjacency and is used to
eliminate the multiple path connections that often arise when 8-
adjacency is used.

0 1 1 0 1 1 0 1 1
0 1 0 0 1 0 0 1 0
0 0 1 0 0 1 0 0 1
4-Adjacency 8-Adjacency m-Adjacency
Digital path
• Line connecting the pixel is called digital path
Digital path

0 1 1
0 1 0
0 0 1
Connectivity
• For any pixel p and q in in a set of pixels ,S(subset of pixels) , the set of
pixels in S that are connected to p and q through digital path is called

connectivity. Digital path

• If S has only one connected component then S is called a connected


set.
• Connectivity in a subset S of an image
• – Two pixels are connected if there is a path between them that lies
completely within S
• Connected Component
• – The set of all pixels in S that are connected to a given pixel
• Connected Set
• – If S has only one connected component
Region
• The connectivity gives rise to another concept of
region (R ).
• Region is nothing but a subset of pixels which are
connected. Or connected set of pixels is called
region.
• Ri and Rj are two joint sets and they are adjacent
to each other. They are connected by 8-
adjacency marked(both diagonals are 1) in red
(fig-1). The joint set gives rise to back ground of 0 1 1
image. 0 1 0
• Ri and Rj are not connected marked in red arrow 0 0 1
Ri
(as there is 0 and 1 in diagonal )are called the 0 1 1
disjoint sets, This disjoint sets gives rise to fore
ground of image. 0 1 0 Rj
0 0 1
Boundary
• It is defined as that the boundary will be having
at least one set of
pixels from back ground of the image or edge.

• Edge can be the region boundary (in binary images)


• Its boundary (border, contour) is the set of pixels in R that have at
least one neighbor not in R.
Back ground

Edge boundary

Foreground
• If a region corresponds to the whole image, 1st and last rows &
columns are treated as boundary
• Difference
• – Edges Intensity Discontinuities
• – Boundaries Closed Path
Distance Measures
• For pixels p,q,z with coordinates (x,y), (s,t), (u,v), D is a distance
function or metric if the three conditions satisfies:

• D(p,q) ≥ 0 [D(p,q)=0 iff p=q( if p and q are located at same position)]


• D(p,q) = D(q,p) (if distance between p and q are equal) and
• D(p,z) ≤ D(p,q) + D(q,z)
Distance Measures
• Euclidean distance:

• De(p,q) = [(x-s)2 + (y-t)2]1/2

• Points (pixels) having a distance less than or equal to r from (x,y) are
contained in a disk of radius r centered at (x,y).
Distance Measures
• D4 distance (city-block distance):

• D4(p,q) = |x-s| + |y-t|


• forms a diamond centered at (x,y)
• e.g. pixels with D4≤2 from p

2
2 1 2
2 1 0 1 2 D4 = 1 are the 4-neighbors of p
2 1 2
2
Distance Measures
• D8 distance (chessboard distance): ( Like a king moves 8-ways in chess
board)
• D8(p,q) = max(|x-s|,|y-t|)
• Forms a square centered at p
• e.g. pixels with D8≤2 from p
2 2 2 2 2
2 1 1 1 2
2 1 0 1 2 D8 = 1 are the 8-neighbors of p
2 1 1 1 2
2 2 2 2 2
Distance Measures
• D4 and D8 distances between p and q are independent of any paths
that exist between the points because these distances involve only
the coordinates of the points (regardless of whether a connected path
exists between them).
Distance Measures
• However, for m-connectivity the value of the distance (length of path)
between two pixels depends on the values of the pixels along the
path and those of their neighbors.
Interpolation
• Required in image resizing such as shrinking
and zooming
• Using known data to estimate data at
unknown points
Morphing
Images
Image formation
Electromagnetic (EM) energyspectrum

Major uses
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

Weeks 1 & 2
First photograph
• First photograph due to Niepce,
• First on record shown - 1822
• Basic abstraction is the pinhole camera

• First successful commercial


photograph due to Eastman in late
19th
First digital picture

You might also like