1. BITAIC502: Digital Image Processing
Lecture-3: Digital Image Fundamental
Dr. Pabitra Pal
Assistant Professor
Department of Computer Applications
School of Information Science & Technology
MAULANA ABUL KALAM AZAD UNIVERSITY OF TECHNOLOGY
August 3, 2022
Dr. Pabitra. Pal (MAKAUT) DIP August 3, 2022 1/ 29
2. STRUCTURE OF THE HUMAN EYE
Simplified diagram of a cross section
of the human eye.
Human visual perception plays a
key role in selecting a technique.
The eye is nearly a sphere
enclosed by three membranes:
the cornea and sclera outer
cover; the choroid; and the
retina.
Lens and Cornea: focusing on
the objects.
Two receptors in the retina:
Cones and rods
Cones located in fovea and
are highly sensitive to color
Rods give a general overall
picture of view, are insensitive
to color and are sensitive to
low level of illumination.
Dr. Pabitra. Pal (MAKAUT) DIP August 3, 2022 2/ 29
3. IMAGE FORMATION IN THE EYE
Distribution of rods and cones in the retina.
Dr. Pabitra. Pal (MAKAUT) DIP August 3, 2022 3/ 29
4. STRUCTURE OF THE HUMAN EYE
Graphical representation of the eye looking at a palm tree. Point C is the
focal center of the lens.
Dr. Pabitra. Pal (MAKAUT) DIP August 3, 2022 4/ 29
5. IMAGE SENSING AND ACQUISITION
....
Most of the images in which we are interested are generated by the
combination of an “illumination” source and the reflection or absorption of
energy from that source by the elements of the “scene” being imaged.
Dr. Pabitra. Pal (MAKAUT) DIP August 3, 2022 5/ 29
6. IMAGE ACQUISITION USING A SINGLE SENSING
ELEMENT
....
A familiar sensor of this type is the photodiode, which is constructed of
silicon materials and whose output is a voltage proportional to light
intensity. Using a filter in front of a sensor improves its selectivity.
Dr. Pabitra. Pal (MAKAUT) DIP August 3, 2022 6/ 29
7. A SIMPLE IMAGE FORMATION MODEL
What is a Digital Image?
An image may be defined as a two- dimensional function, f(x,y) where x
and y are spatial (plane) coordinates, and the amplitude of f at any pair of
coordinates (x, y) is called the intensity or gray level of the image at that
point.
When x, y, and the amplitude values of f are all finite, discrete quantities,
we call the image a digital image.
Dr. Pabitra. Pal (MAKAUT) DIP August 3, 2022 7/ 29
8. Some Terminologies
(a) Illumination (energy) source. (b) A scene. (c) Imaging system. (d)
Projection of the scene onto the image plane. (e) Digitized image.
Dr. Pabitra. Pal (MAKAUT) DIP August 3, 2022 8/ 29
9. IMAGE SAMPLING AND QUANTIZATION
....
To create a digital image, we need to convert the continuous sensed
data into a digital format. This requires two processes: sampling and
quantization.
Digitizing the coordinate values is called sampling.
Digitizing the amplitude values is called quantization.
Dr. Pabitra. Pal (MAKAUT) DIP August 3, 2022 9/ 29
10. REPRESENTING DIGITAL IMAGES
....
Let we sample the continuous image into a digital image, f ( x, y),
containing M rows and N columns, where ( x, y) are discrete
coordinates.
For notational clarity and convenience, we use integer values for these
discrete coordinates: x = 0, 1, 2, ... , M - 1 and y = 0, 1, 2, ... , N
- 1.
Thus, for example, the value of the digital image at the origin is f (0,
0), and its value at the next coordinates along the first row is f (0, 1).
The section of the real plane spanned by the coordinates of an image
is called the spatial domain, with x and y being referred to as spatial
variables or spatial coordinates.
Dr. Pabitra. Pal (MAKAUT) DIP August 3, 2022 10 / 29
11. IMAGE INTERPOLATION
....
Interpolation is used in tasks such as zooming, shrinking, rotating,
and geometrically correcting digital images. Our principal objective in
this section is to introduce interpolation and apply it to image
resizing (shrinking and zooming), which are basically image
resampling methods.
Dr. Pabitra. Pal (MAKAUT) DIP August 3, 2022 11 / 29
12. Basic Relationships Between Pixels
Neighbors of a Pixel
A pixel p at coordinates ( x, y) has two horizontal and two vertical
neighbors with coordinates ( x + 1, y), ( x - 1, y), ( x, y + 1), ( x, y -
1)
This set of pixels, called the 4-neighbors of p, is denoted N4(p).
The four diagonal neighbors of p have coordinates ( x + 1, y + 1), (
x + 1, y - 1), ( x - 1, y + 1), ( x - 1, y - 1) and are denoted ND (p).
These neighbors, together with the 4-neighbors, are called the
8-neighbors of p, denoted by N8(p).
The set of image locations of the neighbors of a point p is called the
neighborhood of p. The neighborhood is said to be closed if it
contains p. Otherwise, the neighborhood is said to be open.
Some of the points in ND (p) and N8(p) fall outside the image if (x,
y) is on the border of the image.
Dr. Pabitra. Pal (MAKAUT) DIP August 3, 2022 12 / 29
13. ADJACENCY, CONNECTIVITY, REGIONS, AND
BOUNDARIES
.....
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 (also called mixed adjacency). 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 pixels whose values are
from V.
Dr. Pabitra. Pal (MAKAUT) DIP August 3, 2022 13 / 29
14. DISTANCE MEASURES
......
For pixels p, q, and s, with coordinates ( x, y), (u, v), and (w, z),
respectively, D is a distance function or metric if
D(p, q) ≥ 0 (D( p, q) = 0 iff p = q) ,
D( p, q) = D(q, p), and
D( p, s) ≤ D( p, q) + D(q, s).
The Euclidean distance between p and q is defined as
e
√
D (p, q) = (x − u) + (y − v)
2 2
The D4 distance (also called city-block distance) between p and q is
defined as D4(p, q) = |x − s|+ |y − t|
The D8 distance (called the chessboard distance) between p and q is
defined as D8(p, q) = max(x − u,y − v)
Dr. Pabitra. Pal (MAKAUT) DIP August 3, 2022 14 / 29
15. BASIC MATHEMATICAL TOOLS USED IN DIP
ELEMENTWISE VERSUS MATRIX OPERATIONS
An elementwise operation involving one or more images is carried out on a
pixel-by-pixel basis.
The elementwise product of two images is as follows
Dr. Pabitra. Pal (MAKAUT) DIP August 3, 2022 15 / 29
16. BASIC MATHEMATICAL TOOLS USED IN DIP
LINEAR VERSUS NONLINEAR OPERATIONS
One of the most important classifications of an image processing method
is whether it is linear or nonlinear. Consider a general operator, ϕ, that
produces an output image, g( x, y), from a given input image, f ( x, y):
ϕ[f (x, y)] = g(x,y)
Given two arbitrary constants, a and b, and two arbitrary images f1(x, y)
and f2(x, y), ϕ is said to be a linear operator if
ϕ[af1(x, y) + bf2(x, y)] = aϕ[f1(x, y)] + bϕ[f2(x, y)]
= ag1(x, y) + bg2(x, y)
This equation indicates that the output of a linear operation applied to the
sum of two inputs is the same as performing the operation individually on
the inputs and then summing the results. In addition, the output of a
linear operation on a constant multiplied by an input is the same as the
output of the operation due to the original input multiplied by that
constant. The first property is called the property of additivity, and the
second is called the property of homogeneity.
Dr. Pabitra. Pal (MAKAUT) DIP August 3, 2022 16 / 29
17. BASIC MATHEMATICAL TOOLS USED IN DIP
Arithmetic operations
Arithmetic operations between two images f (x, y) and g(x, y) are denoted
as
s(x,y) = f (x, y) + g(x,y)
d(x,y) = f (x,y) − g(x, y)
p(x, y) = f (x, y) × g(x, y)
v(x,y) = f (x,y)/ g(x,y)
Dr. Pabitra. Pal (MAKAUT) DIP August 3, 2022 17 / 29
18. SET AND LOGICAL OPERATIONS
Basic Set Operations
A set is a collection of distinct objects. If a is an element of set A,
then we write a ∈A
Similarly, if a is not an element of A we write a ∈
/A
The set with no elements is called the null or empty set, and is
denoted by ϕ.
A set is denoted by the contents of two braces: {}˙. For example, the
expression C = { c|c = −d, d ∈D} means that C is the set of
elements, c, such that c is formed by multiplying each of the elements
of set D by -1.
If every element of a set A is also an element of a set B, then A is
said to be a subset of B, denoted as A ⊆ B
Dr. Pabitra. Pal (MAKAUT) DIP August 3, 2022 18 / 29
19. SET AND LOGICAL OPERATIONS
Basic Set Operations
The union of two sets A and B, denoted as C= A ∪B is a set C
consisting of elements belonging either to A, to B, or to both.
Similarly, the intersection of two sets A and B, denoted by D = A ∩B
is a set D consisting of elements belonging to both A and B.
Sets A and B are said to be disjoint or mutually exclusive if they have
no elements in common, in which case, A ∩B = ϕ
The complement of a set A is the set of elements that are not in A:
Ac = { w|w ∈
/ A}
The difference of two sets A and B, denoted A - B, is defined as
A − B = { w|w ∈A, w ∈
/ B} =A ∩Bc
Dr. Pabitra. Pal (MAKAUT) DIP August 3, 2022 19 / 29
20. SET AND LOGICAL OPERATIONS
Some important set operations and relationships.
Dr. Pabitra. Pal (MAKAUT) DIP August 3, 2022 20 / 29
21. SET AND LOGICAL OPERATIONS
Venn diagrams corresponding to some of the set operations
Dr. Pabitra. Pal (MAKAUT) DIP August 3, 2022 21 / 29
22. Set operations involving grayscale images.
(a) Original image. (b) Image negative obtained using grayscale set
complementation. (c) The union of image (a) and a constant image.
Dr. Pabitra. Pal (MAKAUT) DIP August 3, 2022 22 / 29
23. Set operations involving grayscale images.
Cartesian product
The Cartesian product of two sets X and Y, denoted X × Y , is the set of
all possible ordered pairs whose first component is a member of X and
whose second component is a member of Y. In other words,
X × Y = { (x, y)x ∈X and y ∈Y
Dr. Pabitra. Pal (MAKAUT) DIP August 3, 2022 23 / 29
24. Set operations involving grayscale images.
Relation
A relation (or, more precisely, a binary relation) on a set A is a collection
of ordered pairs of elements from A. That is, a binary relation is a subset
of the Cartesian product A × A. A binary relation between two sets, A and
B, is a subset of A × B. A partial order on a set S is a relation R on S
such that R is:
(a) reflexive: for any a ∈S, aRa;
(b) transitive: for any a, b, c ∈ S , aRb and bRc implies that aRc;
(c) antisymmetric: for any a, b in S , aRb and bRa implies that a = b.
Dr. Pabitra. Pal (MAKAUT) DIP August 3, 2022 24 / 29
25. Logical Operations
Relation
Logical operations deal with TRUE (typically denoted by 1) and FALSE
(typically denoted by 0) variables and expressions. For our purposes, this
means binary images composed of foreground (1-valued) pixels, and a
background composed of 0-valued pixels.
We work with set and logical operators on binary images using one of two
basic approaches:
(1)we can use the coordinates of individual regions of foreground
pixels in a single image as sets, or
(2)wecan work with one or more images of the same size and
perform logical operations between corresponding pixels in those
arrays.
Dr. Pabitra. Pal (MAKAUT) DIP August 3, 2022 25 / 29
27. SPATIAL OPERATIONS
Spatial operations are performed directly on the pixels of an image. We
classify spatial operations into three broad categories:
(1)Single-pixel operations: The simplest operation we perform on
a digital image is to alter the intensity of its pixels individually using a
transformation function, T, of the form: s= T (z ). Where z is the
intensity of a pixel in the original image and s is the (mapped)
intensity of the corresponding pixel in the processed image.
(2)Neighborhood operations: Let Sxy denote the set of
coordinates of a neighborhood centered on an arbitrary point ( x, y)
in an image, f.
(3)Geometric spatial transformations: We use geometric
transformations modify the spatial arrangement of pixels in an image.
These transformations are called rubber-sheet transformations
because they may be viewed as analogous to “printing” an image on
a rubber sheet, then stretching or shrinking the sheet according to a
predefined set of rules.
Dr. Pabitra. Pal (MAKAUT) DIP August 3, 2022 27 / 29