Module 1 Introduction
Module 1 Introduction
Syllabus
What is Digital Image Processing?
Origins of Digital Image Processing,
Examples of fields that use DIP,
Fundamental Steps in Digital Image Processing,
Components of an Image Processing System,
Elements of Visual Perception,
Image Sensing and Acquisition,
Image Sampling and Quantization,
Some Basic Relationships Between Pixels,
Linear and Nonlinear Operations.
WHAT IS DIGITAL IMAGE PROCESSING?
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 as a digital image.
These each discrete, finite element has particular location and value. These
basic elements are referred as picture elements, image elements, pels, and
pixels.
Applications based on light source used (electromagnetic spectrum e.g., visual, x-ray etc).
[ Back Ground: Electromagnetic waves can be represented as stream of mass less particles
called photons. If spectral bands are grouped according to energy per photon, we obtain the
spectrum ranging from gamma rays (highest energy) at the one end to radio waves (lowest
energy) at the other.]
X-rays for medical and industrial imaging are generated using an x-ray tube [vacuum
tube with a cathode and anode]. When cathode is heated, free electrons are released.
These electrons flow at high speed to the positively charged anode.
When the electron strike a nucleus, energy is released in the form x-ray radiation. The
energy (penetrating power) of the x-rays is controlled by a current applied to the
filament in the cathode.
Angiography is another major application in an area called contrast enhancement
radiography. The procedure is used to obtain images of blood vessels. A catheter ( a
small flexible hollow tube) is inserted, for example into an artery of vein in the groin.
The catheter is threaded into the blood vessel and guided to the area to be studied.
When the catheter reaches the site under investigation, an x-ray contrast medium is
injected through the catheter. This enhances contrast of the blood vessles and enables
the radiologist to see any irregularities or blockages.
Image enhancement:
Image Enhancement is the process of manipulating an image so that the result is more
suitable than the original for a specific application
Enhancement techniques highlight certain features of interest in an image & improve
the quality of unclear image.
Image enhancement is a very subjective. Example: To increase the contrast of an
image
Image Restoration:
It also deals with improving the appearance & quality of an image.
The Enhancement is subjective, whereas image restoration is objective, means
restoration techniques are based on mathematical or probabilistic models of image
degradation.
In image restoration the noise content is also removed to improve the quality of the
image, whereas image enhancement only deals with contrast enhancement.
Compression:
It deals with techniques to reduce the storage space required to save an image, or the
bandwidth required to transmit it over the network. It has to major approaches
a) Lossless Compression
b) Lossy Compression
Morphological processing:
It deals with extracting image components which are useful in the representation and
description of shape and boundary of objects.
It is majorly used in automated inspection applications.
Knowledge base:
Knowledge about a problem domain is coded into an image processing system in the
form of a knowledge base.
As information or details of an image is located in knowledge base, thus it avoids search
that has to be conducted in seeking the information.
Segmentation:
Image Segmentation is the process by which a digital image is partitioned into
various subgroups called Image Objects, which can reduce the complexity of the
image, and thus analysing the image becomes simpler.
Image segmentation is mainly used to locate objects and boundaries (lines, curves,
etc.) in images.
Computer
It is a general-purpose computer and can range from a PC to a supercomputer
depending on the application. In dedicated applications, especially designed computer
are used to achieve a required level of Performance
iv) Software:
It consists of specialized modules that perform specific tasks.
More sophisticated software packages allow the integration of different specialised
libraires & modules
Well-designed IDE with GUI, packages & different tools ease process of writing
code, thus user can focus on development of algorithms.
v) Mass storage:
This capability is a must in image processing applications.
An image of size 1024 x1024 pixels, in which the intensity of each pixel is an 8- bit
quantity requires one megabytes of storage space if the image is not compressed.
Image processing applications falls into three principal categories of storage
i) Short term storage for use during processing
ii) On line storage for relatively fast retrieval
iii) Archival storage such as magnetic tapes and disks
ELEMENTS OF VISUAL PERCEPTION
Eye characteristics
Nearly spherical
Approximately 20 mm in diameter
Three membranes (layers)
Outer membrane:
o It’s made up 2 things; Cornea (transparent) & Sclera (opaque).
o The Sclera is white outer layer of the eyeball. It provides attachments for the
muscles that control the eye’s movement.
o The cornea is the transparent part of the eye that covers the front portion of the
eye. It covers the pupil & iris. It serves as the eye’s “window”, which allows the
light in and bends its rays, thereby providing most of the eye’s focusing power.
o
o Two types of photoreceptor cells: rods and cones. Rods provide the perception of
black-and-white vision, mostly in dim light, whereas cones help to see colours in
daylight.
o Cones and rods convert light energy into signal to human brain via optic nerve
Function of eye:
Our eyes capture and focus light like a camera. Below are the steps of how an eye works:
Light rays enter the eye through the cornea. The amount of light which is passed
through the pupil is controlled and maintained by iris.
From Iris, the light hits the lens. From lens, light rays focus onto the retina.
When the light rays reach the retina (sensory system), the light-sensitive nerve layer is
activated in which the image appears inverted.
Problem:
From the Observer is looking at 15m height tree at distance of 100m. Calculate the
calculate the size of the retinal image?
Solution:
Brightness Adaptation and Discrimination & Weber ratio
• The human visual system can perceive approximately 1010 different light intensities levels.
• But, at a given point of time, eye cannot operate over the entire range simultaneously, the
eye can only observe a small range of illuminations.
• Human eye takes finite time to adjust its sensitivity level to accomplish large variation in
the intensities of the light. This phenomenon is known as brightness adaptation.
• Example: When the power supply of our homes is cut-off in the night. Everything seems
to be pitch dark and nothing can be seen for some time. This is because the eye takes a
finite time to adapt itself to this new range. Gradually eyes adjust to this low level of
illumination and then things start getting visible in dark.
• For any given set of conditions, the current sensitivity level of human eye is called the
brightness adaptation level.
• Brightness discrimination is the ability of the eye to discriminate between changes
in light intensity at any specific adaptation level.
Weber ratio:
• Ratio of increment of illumination (Ic) discriminable 50% of the time to background
illumination I, is called the Weber ratio
Image Acquisition
1. Image Acquisition using a single sensor
2. Image Acquisition using a Sensor strips
3. Image Acquisition using a Sensor Arrays
1. Image Acquisition using a single sensor
The most commonly used this type of sensor is photodiode, it is constructed using silicon
materials and its output voltage waveform is proportional to light.
The filter is used in front of a sensor to improve the selectivity. For example, a green
(pass) filter in front of a light sensor allows only the green band light of the colour
spectrum. So, the sensor output will be stronger for green light than for other components
in the visible spectrum.
In order to generate a 2-D image using a single sensor, there has to be relative
displacements in both the x- and y-directions between the sensor and the area to be
imaged.
Figure shows an arrangement used for 2D Image scanning;
o A film negative is mounted on a drum. Mechanical rotation of drum provides
displacement in one dimension.
o The single sensor is mounted on a lead screw that provides motion in the
perpendicular direction.
Since mechanical motion can be controlled with high precision, this method is an
inexpensive (but slow) way to obtain high-resolution images.
Other similar mechanical arrangements use a flat bed, with the sensor moving in two
linear directions.
The intensity of a monochrome image at any coordinates (x,y) is called as the gray level (l) of
the image at that point.
=f(x,y).
The interval of l ranges from [0, L-1].
Where l=0 indicates black and l=1 indicates white.
All intermediate values are shades of gray varying from black to white.
The value of L depends on the number of bits used to represent each pixel.
If 8 bits are used, then L = 28 = 256
Then interval of l ranges from [0, 255].
A moiré pattern is a secondary and visually evident superimposed pattern created, for example,
when two identical (usually transparent) patterns on a flat or curved surface (such as closely
spaced straight lines drawn radiating from a point or taking the form of a grid) are overlaid
while displaced or rotated a small amount from one another
Shrinking:
Image shrinking is done in a similar manner as just described for zooming. The equivalent process of
pixel replication is row-column deletion. For example, to shrink an image by one-half, we delete every
other row and column.
Neighbours of a Pixel
1. N4 (p) : 4-neighbors of p.
2. ND(p) : Diagonal neighbours of p.
3. N8 (p): 8-neighbors of p.
1. N4 (p) : 4-neighbors of p.
Any pixel p(x, y) has two vertical and two horizontal neighbours, given by
(x+1, y), (x-1, y), (x, y+1),
(x, y-1)
This set of pixels are called the 4-neighbors of P, and is denoted by N4 (P)
Each of them is at a unit distance from P.
2. N8 (p): 8-neighbors of p.
N4 (P)and ND(p) together are called 8-neighbors of p, denoted by N8 (p).
N8 = N4 U ND
Some of the points in the N4 , ND and N8 may fall outside image when P lies on the
border of image
Adjacency
Two pixels are connected if
they are neighbours [N4(P), ND(P), N8(P) ] and
their grey levels satisfy similarity criteria (should be part of set V)
4-adjacency:
Two pixels p & q are 4-adjacencant if
1 (q4)
1 p 0 (q5)
1 (q4)
1 p 0 (q5)
1 (q6)
0 (q7) 1 (q8)
1 (q6)
0 (q7) 1 (q8)
1. (p, q2) ∈ V & (p, q2) are N4(P); hence p & q2 are adjacent
Now :
2. (p, q4) ∈ V & (p, q4) are N4(P); hence p & q4 are adjacent
8-adjacency :
Two pixels p & q are 8-adjacencant if
0 ( q1)
1 (q2) 1 (q3)
0 ( q1)
1 (q2) 1 (q3)
0 (q4)
1 p 0 (q5)
0 (q4)
1 p 0 (q5)
0 (q6)
0 (q7)
1 (q8)
0 (q6)
0 (q7)
1 (q8)
1. (p, q2) ∈ V & (p, q2) are N8(P); hence p & q2 are adjacent
Now :
2. (p, q3) ∈ V & (p, q3) are N8(P); hence p & q3 are adjacent
1. (p, q8) ∈ V & (p, q8) are N8(P); hence p & q8 are adjacent
m-a djacency :
Two pixels p & q are m-adjacent if
1. p & q should belong to set V
2. q is in N4(p) OR
q is in ND(p) & the set N4(p) n N4(q) have no pixels whose values are from ‘V’.
Example :
1. Check whether q2 & q3 are m-adjacent
V= {1}
0 ( q1)
1 (q2) 1 (q3)
0 (q4)
1 p 0 (q5)
0 (q6)
0 (q7) 2 (q8)
1. (q2, q3) ∈ V
Soln :
2. (q2, q3) ∈ N4
Hence (q2, q3) are m adjacent
0 ( q1)
1 (q2) 1 (q3)
0 (q4)
1 p 0 (q5)
0 (q6)
0 (q7) 2 (q8)
Soln :
Here p & q3 are NOT m adjacent
0 (q4)
1 p 0 (q5)
0 (q6)
0 (q7)
2 (q8)
Soln :
m adjacent
Connectivity
Two pixels are said to be connected if they are adjacent in some sense.
They are neighbours (N4, ND, N8) and o Their intensity values (gray levels) are similar.
Problem :
Consider the two image subsets, S1 and S2, shown in the following figure.
For V={1}, determine whether these two subsets are (a) 4-adjacent, (b) 8-adjacent, or (c) m-adjacent.
Solution:
Let p and q be as shown in Fig. Then:
(a) S1 and S2 are not 4-connected because q is not in the set N4(p);
(b) S1 and S2 are 8-connected because q is in the set N8(p);
(c) S1 and S2 are m-connected because (i) q is in ND(p), and (ii) the set N4(p) ∩ N4(q) is empty
Path
A path (curve) from pixel p(x,y) to pixel q (s,t) is a sequence of distinct pixels:
(x0, y0), (x1,y1), ……., (xn, yn)
where (x0, y0) = (x, y), (xn, yn) = (s, t) => ie path is from p (x0, y0) to q (xn, yn)
and pixels (xi, yi) and (xi-1, yi-1) are adjacent for 1≤ i ≤ n.
In this case, n is the length of the path.
If (x0, y0) = (xn, yn) the path is a closed path.
The path can be defined 4-,8-, m-paths depending on adjacency type.
Let S be a subset of pixels in an image.
Two pixels p and q are said to be connected in S if there exists a path between them
consisting entirely of pixels in S
For any pixel p in S, the set of pixels that are connected to it in S is called a connected
component of S. If it only has one connected component, then set S is called a connected
set.
Problems:
1. Consider the image segment shown. Let V={0, 1} and compute the lengths of the shortest
4-path, 8-path, and m-path between p and q. If a particular path does not exist between these
two points, explain why.
Soln :
4-path
Given : V={0, 1}
4-path does not exist between p and q because it is impossible to get from p to q by traveling along
points that are both 4-adjacent and also have values from V .
8-path
Given : V={0, 1}
m-path
Given : V={0, 1}
Distance Measures
Given pixels p, q and z with coordinates (x, y), (s, t), (u, v) respectively, the distance function D has
following properties:
D(p, q) ≥ 0 [D(p, q) = 0, iff p = q]
D(p, q) = D(q, p)
D(p, z) ≤ D(p, q) + D(q, z)
The pixels having a distance less than or equal to some value r from (x, y) are the points contained in a
disk of radius r centered at (x, y).
Problem
A common measure of transmission for digital data is the baud rate defined as the bits transmitted per
second. Generally, transmission is accomplished in packets consisting of a start bit, A byte (8 bits) of
information and a stop bit using these facts. Find how many minutes would it take to transmit a
2048x2048 image with 256 intensity levels using a 33.6 K baud modem?
Solution :
Time = 41943040 x 1
33.6 x 103