IMP Module 4 Notes
IMP Module 4 Notes
CG & FIP
Dr. T. THIMMAIAH INSTITUTE OF TECHNOLOGY
(Estd. 1986) Oorgaum, Kolar Gold Fields, Karnataka – 563120
(Affiliated to VTU, Belgaum, Approved by AICTE - New Delhi)
NAAC Accredited 'A' Grade, NBA Accredited for CSE, ECE & Mining Engg Programs
Table of Contents
MODULE:4
Introduction to Image Processing
Topics Page No.
1. What is an 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.
i) Reflective mode imaging represents the simplest form of imaging and uses a
sensor toacquire the digital image. All video cameras, digital cameras, and
scanners use some types of sensors for capturing the image
ii) Emissive type imaging acquired from self-luminous objects without the help of a
radiation source. In emissive type imaging, the objects are self-luminous. The
radiation emitted by the object is directly captured by the sensor to form an
image. Thermal imaging is an example of emissive type imaging.
iii) Transmissive imaging is where the radiation source illuminates the object. The
absorption of radiation by the objects depends upon the nature of the
material.Some of the radiation passes through the objects. The attenuated
radiation is sensedinto an image.
• Optical image processingis an area that deals with the object, optics, and how processes
are applied to an image that is available in the form of reflected or transmitted
• Analog image processingis an area that deals with the processing of analog electrical
signals using analog circuits. The imaging systems that use film for recording images are
also known as analog imaging systems.
• Digital image processingis an area that uses digital circuits, systems, and software
algorithms to carry out the image processing operations. The image processing operations
may include quality enhancement of an image, countingof objects, and image analysis.
Prof Sophia S, Asst. Prof., Department of CSE, Dr. TTIT, KGF 4-1
21CS63 COMPUTER GRAPHICS AND FUNDAMENTALS OF IMAGE PROCESSING 23-24
It is easy to post-process the image. Small corrections can be made in the captured
image using software.
It is easy to store the image in the digital memory.
It is possible to transmit the image over networks. So sharing an image is quite easy.
A digital image does not require any chemical process. So it is very environment
friendly, as harmful film chemicals are not required or used.
It is easy to operate a digital camera.
Prof Sophia S, Asst. Prof., Department of CSE, Dr. TTIT, KGF 4-2
21CS63 COMPUTER GRAPHICS AND FUNDAMENTALS OF IMAGE PROCESSING 23-24
Image processing deals with raster data or bitmaps, whereas computer graphics
primarily deals with vector data.
Digital signal processing, in domain of image processing, one deals with visual
information that is often in two or more dimensions.
Machine vision is to interpret the image and to extract its physical, geometric, or
topological properties.
Video processing is an extension of image processing. Images are strongly related to
multimedia, as the field of multimedia broadly includes the study of audio, video,
images, graphics, and animation.
Optical image processing deals with lenses, light, lighting conditions, and associated
optical circuits. The study of lenses and lighting conditions has an important role in
the study of image processing.
Image analysis is an area that concerns the extraction and analysis of object
information from the image. Imaging applications involve both simple statistics such
as counting and menstruation.
An image can be defined as a 2D signal that varies over the spatial coordinates x and y,
and can be written mathematically as f (x, y)
Image f(x,y) is divided into X rows and Y rows. Where { x=0,1,…..,X-1} (y=0,1,….,Y-
1}.At the interaction of row & column pixel is present.
The value of the function f (x, y) at every point indexed by a row and a column is called
grey value or intensity of the image.
Resolution is the ability of the imaging system to produce the smallest discernable
details, i.e., the smallest sized object clearly, and differentiate it from the neighboring
small objects that are present in the image.
Image resolution depends on two factors—optical resolution of the lens and spatial
resolution.
Prof Sophia S, Asst. Prof., Department of CSE, Dr. TTIT, KGF 4-3
21CS63 COMPUTER GRAPHICS AND FUNDAMENTALS OF IMAGE PROCESSING 23-24
Spatial resolution show the object and its separation from other spatial objects present in
image. It depends on two factor
• The number of pixels of the image
• The number of bits necessary for adequate intensity resolution, referred to as the
bit depth.
• The number of bits necessary to encode the pixel value is called bit depth. Bit
depth is a power of two; it can be written as powers of 2.
So the total number of bits necessary torepresent the image is
Number of rows = Number of columns *Bit depth
i. Based on Nature
a) Natural Images
Produced byCameras and Scanners
b) Synthetic Images
Prof Sophia S, Asst. Prof., Department of CSE, Dr. TTIT, KGF 4-4
21CS63 COMPUTER GRAPHICS AND FUNDAMENTALS OF IMAGE PROCESSING 23-24
e) Unsigned
vi. Based on Domain
a) Range Images
Image encounter in computer vision
Pixel value denotes the distance betweencamera and object
b) Multispectral Images
Image encounter in remote sensing application.
Many band images encountered in remote sensing
Image topology is a branch of image processing that deals with the fundamental properties of
the image such as image neighbourhood. Neighborhood of given references pixels with
are those pixel shares its edge and corner.
i) 4 neighbourhood
In N4(p),the reference pixels p (x, y) at the coordinate position (x, y) has two
horizontal and two vertical pixels as neighbor.
4-Neighbourhood N4(p)
ii) Diagonal element ND(p)
Pixel may have four diagonal neighbor they are (x-1,y-1),(x+1,y+1),(x-1,y+1),
(x+1,y-1) for reference pixel p(x,y).
iii) 8 neighbourhood
Prof Sophia S, Asst. Prof., Department of CSE, Dr. TTIT, KGF 4-6
21CS63 COMPUTER GRAPHICS AND FUNDAMENTALS OF IMAGE PROCESSING 23-24
8-Neighbourhood N8(p)
a) 4- Connectivity:
• The pixels p and q have same values as specified by the set V.
• If q is said to be in set N 4(p) means any path from p to q on which
every other pixel is 4-connected to next pixel.
b) 8-connectivity: p and q share a common grey scale value if q is in set N8(p).
c) Mixed connectivity :
• q is in N4(p) or
• q is in ND(p) and intersection of N4(p) and N4(q) is empty.
10. Explain Euclidean Distance Measure.
Distance between pixels p and q in image can be given by distance measure –
Euclidean distance.
The Euclidean distance between the pixels p and q with coordinates(x,y) and
(s,t) can be defined as
D8 distance D8(p,q)=(│x-s│,│y-t│)
Prof Sophia S, Asst. Prof., Department of CSE, Dr. TTIT, KGF 4-7
21CS63 COMPUTER GRAPHICS AND FUNDAMENTALS OF IMAGE PROCESSING 23-24
i) Based on Neighbourhood
a) Point operation
Output values at a specific coordinate are dependent only on the input
value.
b) Local operation.
Output value at specific coordinate is dependent on the input values in
the neighborhood of that pixel
c) Global operation
Output value at specific coordinate is dependent on all the values in
the input image.
ii) Based on properties.
a) Linear operation: obeys the rules of additive and homogeneity.
Property of additivity
H(a1f1(x, y) + a2f2(x, y)) = H(a1f1{(x, y))+ H(a2 f2(x, y))
=a1H(f1{(x, y))+a2 H(f2(x, y))
=a1 x g1(x, y)+a2xg2(x, y)
Property of homogeneity:
i. Image addition:
Prof Sophia S, Asst. Prof., Department of CSE, Dr. TTIT, KGF 4-8
21CS63 COMPUTER GRAPHICS AND FUNDAMENTALS OF IMAGE PROCESSING 23-24
Application of division
*Change detection
* Separation of luminance and reflectance components
Prof Sophia S, Asst. Prof., Department of CSE, Dr. TTIT, KGF 4-9
21CS63 COMPUTER GRAPHICS AND FUNDAMENTALS OF IMAGE PROCESSING 23-24
* Contrast reduction
i. AND/NAND:
The operator AND and NAND take two image as input and
produce one output image.
Truth table of AND & NAND
A B C(AND) C(NAND)
0 0 0 1
0 1 0 1
1 0 0 1
1 1 1 0
A B C(OR C(NOR)
)
0 0 0 1
0 1 1 0
1 0 1 0
1 1 1 0
iii. XOR/XNOR:
The Truth table of XOR & XNOR
A B C(XOR) C(XNOR)
0 0 0 1
0 1 1 0
1 0 1 0
1 1 0 1
Prof Sophia S, Asst. Prof., Department of CSE, Dr. TTIT, KGF 4-10
21CS63 COMPUTER GRAPHICS AND FUNDAMENTALS OF IMAGE PROCESSING 23-24
- A C(Not)
0 1
1 0
Application of the inversion operator is
* Obtaining the negative of an image.
* making feature clear to the observer
* Morphological processing.
Prof Sophia S, Asst. Prof., Department of CSE, Dr. TTIT, KGF 4-11
21CS63 COMPUTER GRAPHICS AND FUNDAMENTALS OF IMAGE PROCESSING 23-24
iv. Shearing:
Transformation that produces a distortion of shape, that can be applied
either in the x- direction or y- direction
In this transformation the parallel and opposite of the object.
Shearing done using following method and represented in matrix form as
Yshear is gven as
v. Rotation
An image can be rotated by various degree such as 90˚,180˚ ,or 270˚.
Matrix form as
Prof Sophia S, Asst. Prof., Department of CSE, Dr. TTIT, KGF 4-12
21CS63 COMPUTER GRAPHICS AND FUNDAMENTALS OF IMAGE PROCESSING 23-24
ix. 3D transforms:
Medical images such as computerized tomography (CT) and magnetic
resonance imaging (MRI) images are three dimensional images.
To apply translation, rotation and scaling on 3D image,3D
transformations are required.
Prof Sophia S, Asst. Prof., Department of CSE, Dr. TTIT, KGF 4-13
21CS63 COMPUTER GRAPHICS AND FUNDAMENTALS OF IMAGE PROCESSING 23-24
Prof Sophia S, Asst. Prof., Department of CSE, Dr. TTIT, KGF 4-14
21CS63 COMPUTER GRAPHICS AND FUNDAMENTALS OF IMAGE PROCESSING 23-24
Binary image can be visualized as a set A, where A = {(0, 0), (0, 2), (2, 2)}.
The coordinates' values represent the value of 1.
Set operators can then be applied to the set to get the resultant, which is
useful for image analysis.
The complement of set A can be defined as the set of pixels that does not belong
to the set A
}
The union of two sets, A and B, can be represented as
Prof Sophia S, Asst. Prof., Department of CSE, Dr. TTIT, KGF 4-15
21CS63 COMPUTER GRAPHICS AND FUNDAMENTALS OF IMAGE PROCESSING 23-24
17. Consider the following binary image. Show the results of the dilation and erosion
operations. Let the structured element S be [1 1] with coordinates {(0, 0), (0, 1)}. Show the
results of dilation and erosion.
Prof Sophia S, Asst. Prof., Department of CSE, Dr. TTIT, KGF 4-16
21CS63 COMPUTER GRAPHICS AND FUNDAMENTALS OF IMAGE PROCESSING 23-24
18. What is mean, median, mode, standard deviation and variance of the image?
. Statistical operations can be applied to the image to get the desired results such as
manipulation of brightness and contrast.
.
i) Mean: Mean is the average of all the values in the sample (population) and is
denoted as
The overall brightness of the grey scale image is measured using the mean.
This calculated by summing all the values of the pixels of an image and
dividing it by number of pixels in the image.
Prof Sophia S, Asst. Prof., Department of CSE, Dr. TTIT, KGF 4-17
21CS63 COMPUTER GRAPHICS AND FUNDAMENTALS OF IMAGE PROCESSING 23-24
ii) Median: Median is the value where the given X, is divided into two equal halves,
with he of the values being lower than the median and the other half higher.
.
iii) Mode: Mode is the value that occurs most frequently in the dataset. The
procedure finding the mode is to calculate the frequencies for all of the values in
the data.
Based on the mode, the data’s is classified as unimodal, bimodal, and trimodal.
Dataset that has two modes is called bimodal.
iv) Percentile:Percentiles are data that are less than the coordinate by some
percentage of the total value.
v) Standard deviation and variance: commonly used measures of dispersion are
variance and standard deviation.
vi) Standard deviation is the average distance from the mean of the dataset to each
point. The formula for standard deviation is given by
vii) Variance is another measure of the spread of the data. It is the square of standard
deviation.
viii) Entropy: Measure of the amount of orderliness that is present in the image.
The entropy can be calculated by assuming that the pixels are totally
uncorrelated.. Entropy also indicates the average global information content. Its
unit is bits per pixel. It can be computed using the formula
Prof Sophia S, Asst. Prof., Department of CSE, Dr. TTIT, KGF 4-18
21CS63 COMPUTER GRAPHICS AND FUNDAMENTALS OF IMAGE PROCESSING 23-24
Prof Sophia S, Asst. Prof., Department of CSE, Dr. TTIT, KGF 4-19
21CS63 COMPUTER GRAPHICS AND FUNDAMENTALS OF IMAGE PROCESSING 23-24
157 1 57
00 0 0 2 0 0 00
Prof Sophia S, Asst. Prof., Department of CSE, Dr. TTIT, KGF 4-20
21CS63 COMPUTER GRAPHICS AND FUNDAMENTALS OF IMAGE PROCESSING 23-24
ii) Correlation is very useful in useful in recognizing the basic shapes in the
image.
Correlation reduces to convolution if the kernels are symmetric.
Difference between the correlation and convolution is that the
mask or template is applied directly without any prior rotation.
Step 1:
75 1 7 5 1
0 0 0 2 0 0 0 0
Step 2:
Prof Sophia S, Asst. Prof., Department of CSE, Dr. TTIT, KGF 4-21
21CS63 COMPUTER GRAPHICS AND FUNDAMENTALS OF IMAGE PROCESSING 23-24
Prof Sophia S, Asst. Prof., Department of CSE, Dr. TTIT, KGF 4-22
21CS63 COMPUTER GRAPHICS AND FUNDAMENTALS OF IMAGE PROCESSING 23-24
Question Bank
1) Define connectivity.
2) What is the difference between 8-connectivity and m-connectivity?
3) Define Euclidean, D4, and Dg distances.
4) What are the image arithmetic operations?
5) List some of the applications of image arithmetic operations.
6) What is the need for interpolation techniques?
7) What is the significance of image entropy?
8) What is the difference between image convolution and correlation? 9. What is the role of
a data structure in imaging applications?
9) Consider two pixels p and q whose coordinates are (0, 0) and (6, 3).
Calculate the De, D4, and Dg distances between the pixels p and q.
10) Consider the following adjacent regions
1100 0100
0000 1000
1111 0111
1100 0100
R1 R2
What is the connectivity between these two regions?
11) For the values of a1 =-1 and a2 = 1, check whether the median operationis a linear
operation or not.
12) Consider the following images of unit 8 type.
10 40 30
F1= 40 100 90
90 80 70
40 140 90
F2 = 140 100 90
90 80 190
Perform the image addition, multiplication and division operations. Suppose the image is
changed to type uint16, will the results change?
13) Find the convolution and correlation of the following streams of data.
A= {1 7 9 6} and {1 3 5}
B= {1 2 3 4} and {1 1}
14) Consider following image
130 11 67
F= 10 10 50
80 90 100
What is mean, median, mode, standard deviation and variance of the image.
Prof Sophia S, Asst. Prof., Department of CSE, Dr. TTIT, KGF 4-23