Lecture02-Part I
Lecture02-Part I
DS617
Image Processing
Lecture 2 – Part I
Digital Image Fundamentals
(1,1) x
y
(X-1,Y) (X,Y) (X+1,Y)
4-neighborhood relation
considers only the vertical
(X,Y-1)
and horizontal neighbors
(X-1,Y-1) (X+1,Y-1)
D-neighbors of pixel p at (X,Y):
(X-1,Y-1)
(X+1,Y-1)
p ND(p) =
(X-1,Y+1)
(X+1,Y+1)
(X-1,Y+1) (X+1,Y+1)
Two pixels are adjacent if they have the same intensity or color
and they are neighbors of one another.
q q q
8-adjacency from p to q m-adjacency from p
results in some ambiguity to q solves ambiguity
q
p
De ( p, q) ( x s)2 ( y t )2
D4 ( p, q) x s y t
2
2 1 2
2 1 0 1 2
2 1 2
2
The pixels with D4 (p) = 1 are 4-neighbors of p
The pixels having a D4-distance from (x,y) less than or equal to some
value r form a diamond centered at (x,y).
Some Basic Relationships Between Pixels-16
D8-distance (chessboard distance) between p and q is defined as:
D8 ( p, q) max( x s , y t )
2 2 2 2 2
2 1 1 1 2
2 1 0 1 2
2 1 1 1 2
2 2 2 2 2
The pixels with D8 (p) = 1 are 8-neighbors of p
The pixels having a D8-distance from (x,y) less than or equal to some
value r form a square centered at (x,y).
Some Basic Relationships Between Pixels-17
Dm-distance between p and q is defined as the shortest m-path
between them.
This distance will depend on the values of the pixels along the shortest
m-path, as well as the values of their neighbors, other than previously
defined three distances (De , D4 and D8) which depends only on the
coordinates of the pixels.
Where ai and aj, are arbitrary constants, and fi(x,y) and fj(x,y) are
arbitrary images of the same size.
If suppose that a1=1 and a2 = -1, then the equation right-hand side:
g(x,y)
g(x,y)
Point (Single-Pixel) Methods
T is pixel-wise enhancement operator or function.
f(x,y) g(x,y)
Image Addition
The value of an individual pixel location (m,n) in the output
enhancement image is mapped as follows:
Ioutput(m,n) = IA(m,n) + IB(m,n)
Ioutput(m,n) = IA(m,n) + C
Arithmetic Operations-2
Adding a value to each image pixel can be used to achieve the
contrast adjustment, because adding a positive constant, C, to each
pixel value increases (lightens) the pixel value.
Arithmetic Operations-3
Adding images together produces a composite image of both input
images. This can be used to produce blending effects using weighted
addition.
Arithmetic Operations-4
A clear example of using image addition operation is in calculating
the average image of a scene for noise reduction as enhancement
technique in the astronomy field.
Imaging under very low light levels frequently causes sensor noise to
render single images virtually useless for analysis.
The net effect of subtracting the mask, h(x,y), from each sample live
image, f(x,y), is that the areas that are different appear in the
output image, g(x,y), as enhanced detail.
Arithmetic Operations-9
Arithmetic Operations-10
Image Multiplication: Multiplying each image pixel by a value can
also be used to achieve the contrast adjustment, because multiplying
a positive constant, C, by each pixel value increases the pixel value
(e.g., increasing contrast by 50% = multiplication by 1.5).
Arithmetic Operations-11
A clear example of using image multiplication operation is in
masking, also called region of interest (ROI) extraction.
This approach can be used for all arithmetic operations, except when
performing division, an extra requirement that is a very small
number, ϵ (e.g., ϵ = 0.001), should be added to pixels of the divisor
image to avoid division by 0.
Set Operations
The sets are regions representing objects and backgrounds in images.
It is common to map the OR, AND, NOT and XOR to the set union,
intersection, complement and difference operations respectively.