Lect 5 Image (Quantization) Post
Lect 5 Image (Quantization) Post
• The points ND(P) and N4(P) are together known as 8-neighbors of the point P, denoted by N8(P).
• Some of the points in the N4, ND and N8 may fall outside image when P lies on the border of image.
Neighbours of a Pixel
Open Neighbourhood
Closed Neighbourhood
Adjacency and connectivity
• Two pixels are connected if: –
• They are neighbors (i.e. adjacent in some sense).
• Their gray levels satisfy a specified criterion of similarity.
• V is the set of gray-level values used to define adjacency.
(e.g. V={1} for adjacency of pixels of value 1)
Adjacency and connectivity
• In a binary image two pixels are connected if they are 4-neighbors and have
same value (0/1).
• Let v: a set of intensity values used to define adjacency and connectivity.
• In a binary Image v={1}, if we are referring to adjacency of pixels with value 1.
• In a Gray scale image, the idea is the same, but v typically contains more
elements, for example v= {180, 181, 182,....,200}.
• If the possible intensity values are 0 to 255, v set could be any subset of these
256 values.
Types of adjacency
• 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).
• m-adjacency (mixed): two pixels p and q with values from v are m-adjacent
• if: q is in N4 (p) or q is in ND (P) and The set N4 (p) ∩ N4 (q) has no pixel whose values
are from v (No intersection).
• Pixel arrangement as shown in figure for v= {1}
M-Adjacency
Adjacency and connectivity
Adjacency and connectivity
• Mixed adjacency is a modification of 8-adjacency ''introduced to eliminate the
ambiguities that often arise when 8- adjacency is used. (eliminate multiple path
connection)
• In this example, we can note that to connect between two pixels (finding
a path between two pixels):
• In 8-adjacency way, you can find multiple paths between two pixels
• While, in m-adjacency, you can find only one path between two pixels
• So, m-adjacency has eliminated the multiple path connection that has been
generated by the 8-adjacency
Solve
Connectivity
• To determine whether the pixels are adjacent in some
sense.
• Let V be the set of gray-level values used to define
connectivity; then Two pixels p, q that have values
from the set V are:
• a. 4-connected, if q is in the set N4(p)
• b. 8-connected, if q is in the set N8(p)
• c. m-connected, iff
• i. q is in N4(p) or
• ii. q is in ND(p) and the set N4 (p) ∩ N4 (q) is empty
Adjacency/Connectivity
Solve
Solve
To solve
Solve
• Q3 (i)
Solve
• Q3 (ii) V = [2,6]……
• Path does not exist between p and q.
Path
• A path from pixel p with coordinates (x, y) to pixel q with coordinates
(s, t) is a sequence of distinct pixels with coordinates:
(x0, y0), (x1, y1), (x2, y2) … (xn, yn),
where (x0, y0)=(x, y)
and (xn, yn)=(s, t);
and (xi, yi ) is adjacent to (xi-1, yi-1).
• We can define 4-, 8-, and m-paths based on type of adjacency used.
Path
Connected Components
• If p and q are pixels of an image subset S then p is connected to q in S,
if there is a path from p to q consisting entirely of pixels in S.