Chapter-1 Digital Image
Fundamentals
What Is the Electromagnetic Spectrum?
The electromagnetic spectrum is a range of frequencies, wavelengths and photon
energies covering frequencies from below 1 hertz to above 1025 Hz,
corresponding to wavelengths which are a few kilo meters to a fraction of the size
of an atomic nucleus in the spectrum of electromagnetic waves. Generally, in a
vacuum, electromagnetic waves tend to travel at speeds which is similar to that of
light. However, they do so at a wide range of wavelengths, frequencies and
photon energies.
The electromagnetic spectrum consists of a span of all electromagnetic radiation
which further contains many subranges, which are commonly referred to as
portions. These can be further classified as infrared radiation, visible light or
ultraviolet radiation.
Electromagnetic Waves in the
Electromagnetic Spectrum
The entire range (electromagnetic spectrum) is given by radio waves, microwaves,
infrared radiation, visible light, ultra-violet radiation, X-rays, gamma rays and
cosmic rays in the increasing order of frequency and decreasing order of
wavelength. The type of radiation and their frequency and wavelength ranges are
as follows:
Type of Radiation Frequency Range (Hz) Wavelength Range
Gamma-rays 1020 – 1024 < 10-12 m
X-rays 1017 – 1020 1 nm – 1 pm
Ultraviolet 1015 – 1017 400 nm – 1 nm
Visible 4 x 1014 – 7.5 x 1014 750 nm – 400 nm
Near-infrared 1 x 1014 – 4 x1014 2.5 μm – 750 nm
Chapter-1 Digital Image Fundamentals 1
Infrared 1013 – 1014 25 μm – 2.5 μm
Microwaves 3 x 1011 – 1013 1 mm – 25 μm
Radio waves < 3 x 1011 > 1 mm
The electromagnetic spectrum can be depicted as follows:
Properties of Light:
Wavelength (λ): Distance between successive peaks of the wave;
determines the color of visible light.
Frequency (ν): Number of waves that pass a point in one second.
Energy (E): Related to frequency by the formula E=hν (where h is Planck’s
constant).
E=hνE = hν
Visible Spectrum:
The visible spectrum includes wavelengths between 380 nm (violet) to
700 nm (red).
White light is a mixture of all colors in the visible spectrum.
Interaction of Light with Matter:
Chapter-1 Digital Image Fundamentals 2
Reflection: Light bounces off a surface.
Refraction: Light bends as it passes through different mediums.
Absorption: Light is absorbed by the medium, converting it to heat or
another form of energy.
Diffraction: Light spreads out when it passes through a small opening.
Components of an Image Processing System:
1. Image Acquisition:
The process of capturing an image using sensors like cameras or
scanners.
Acquired images are converted into digital form using analog-to-digital
conversion.
2. Preprocessing:
Enhances image quality and removes noise.
Common techniques include:
Filtering: Smoothing (blur) or sharpening of images.
Normalization: Adjusting the range of pixel values.
Thresholding: Converting grayscale images to binary by setting pixel
intensity thresholds.
3. Segmentation:
Divides an image into its constituent parts or objects.
Techniques include:
Edge detection: Identifying the boundaries of objects (e.g., Sobel,
Canny).
Region-based segmentation: Grouping pixels into regions based on
similarity.
4. Feature Extraction:
Chapter-1 Digital Image Fundamentals 3
Identifying significant information from the segmented image.
Examples:
Shape, texture, color features.
Edges and corners as key features in object recognition.
5. Image Representation:
Images are represented as a matrix of pixels (picture elements), where
each pixel has a value corresponding to the intensity of the color
(grayscale or RGB).
6. Image Compression:
Reducing the file size of the image to save storage or transmission time.
Methods include:
Lossless compression: No data is lost (e.g., PNG).
Lossy compression: Some data is discarded for smaller sizes (e.g.,
JPEG).
7. Image Enhancement:
Improves visual quality by enhancing details and contrast.
Techniques include:
Histogram equalization: Adjusting contrast.
Noise reduction: Removing unnecessary signals (Gaussian filters).
8. Object Recognition:
The system identifies specific objects within an image.
Techniques involve pattern recognition and the use of algorithms like:
Machine learning (SVM, k-NN) and deep learning (CNNs).
9. Image Reconstruction:
Used to restore images from incomplete or corrupted data.
Applied in medical imaging (MRI, CT scans) or in the recovery of images.
Chapter-1 Digital Image Fundamentals 4
10. Output/Display:
The processed image is presented in a user-friendly format.
May involve rendering images on screens or printing.
Chapter-1 Digital Image Fundamentals 5
Image Formation and Digitization Concepts
1. Image Formation
Image formation is the process by which a real-world scene is captured and
transformed into an image that can be processed and analyzed. This process
involves several steps, including the interaction of light with objects and the
capturing of light by a sensor.
Optical System:
Lens: In cameras, the lens focuses light rays from a scene onto a sensor.
The lens has properties such as focal length, which controls
magnification, and aperture, which controls the amount of light entering.
Field of View (FOV): Determines how much of the scene is captured by
the camera.
Light Interaction:
Reflection: Light reflects off surfaces and reaches the camera.
Transmission: Light passes through transparent objects.
Absorption: Certain wavelengths of light are absorbed by objects and not
captured.
Perspective Projection:
Real-world 3D scenes are projected onto a 2D plane (image sensor) using
perspective geometry.
Objects farther away appear smaller, while closer objects appear larger.
Image Sensors:
The sensor (e.g., CCD or CMOS) in a camera converts light into electrical
signals. Each sensor is composed of a grid of photosensitive elements
(pixels).
Pixel: The smallest unit of a digital image, capturing light intensity or color
information at a specific point.
2. Image Digitization
Chapter-1 Digital Image Fundamentals 6
Digitization is the process of converting the analog image captured by an optical
system into a digital format, suitable for computer processing. This involves two
key steps: sampling and quantization.
Sampling
Sampling refers to dividing the continuous real-world image into a grid of discrete
points, each corresponding to a pixel in the digital image.
Spatial Sampling:
The scene is sampled at discrete intervals based on the resolution of the
sensor (e.g., 1920x1080 pixels).
The spatial resolution is determined by the number of pixels; higher
resolution captures more detail.
Nyquist Theorem:
To avoid loss of information (aliasing), the image must be sampled at a
frequency that is at least twice the highest frequency present in the scene.
Quantization
Quantization is the process of mapping the continuous intensity or color
information captured by the sensor into a limited set of discrete values.
Grayscale Quantization:
In grayscale images, each pixel represents a specific shade of gray based
on the amount of light captured.
The pixel’s intensity is quantized into a specific number of levels, typically
256 levels (8-bit) ranging from 0 (black) to 255 (white).
Color Quantization:
In color images, the intensity of each primary color (usually RGB – Red,
Green, Blue) is quantized separately.
A typical 24-bit color image uses 8 bits per color channel, allowing for 16.7
million possible colors.
Bit Depth:
Chapter-1 Digital Image Fundamentals 7
The number of bits used for each pixel to represent color or intensity.
Higher bit depth allows for more detailed gradations in color and
brightness.
Common bit depths:
8-bit: 256 levels of intensity for grayscale.
24-bit: 8 bits for each RGB channel (16.7 million colors).
Resolution and Pixel Density:
Spatial Resolution: Number of pixels in an image (e.g., 1920x1080). A higher
resolution means more detail.
Pixel Density: Measured in pixels per inch (PPI) or dots per inch (DPI), it
determines how many pixels are packed into a given space.
Aliasing and Anti-Aliasing:
Aliasing: Occurs when the image is undersampled, causing distortions such
as jagged edges (staircasing).
Anti-aliasing: A technique used to smooth out jagged edges by blending pixel
colors, improving the visual appearance of edges in digital images.
3. Color Models
RGB Model:
The most common color model used in digital imaging. Each pixel is
represented by a combination of Red, Green, and Blue values.
Other Models:
CMYK: Used in printing (Cyan, Magenta, Yellow, Black).
HSV: Represents colors by Hue, Saturation, and Value (brightness).
4. Image Formats:
Bitmap (BMP): Uncompressed format with a direct representation of pixel
values.
Chapter-1 Digital Image Fundamentals 8
JPEG: Compressed format, often used for photos with some loss of quality
(lossy compression).
PNG: Lossless compression, useful for graphics with transparency.
TIFF: High-quality, often used in professional imaging.
5. Common Issues in Image Formation:
Noise: Unwanted variations in brightness or color, often caused by low lighting
or sensor limitations.
Motion Blur: Caused by object or camera movement during image capture.
Depth of Field: The range of distances within a scene that appears sharp,
controlled by the aperture setting of the lens.
Neighbours of a Pixel
A pixel, denoted as p at position (x, y) in a digital image, has neighboring
pixels that are either adjacent in horizontal/vertical or diagonal directions.
1. 4-Neighbours of a Pixel (N4(p)):
The 4-neighbours of a pixel are the pixels that share a horizontal or vertical edge
with it. If the pixel is located at (x, y), its 4-neighbours are:
(x+1, y): the pixel to the right.
(x-1, y): the pixel to the left.
(x, y+1): the pixel below.
(x, y-1): the pixel above.
2. Diagonal Neighbours of a Pixel (ND(p)):
The diagonal neighbours of a pixel are the pixels located at diagonal positions
relative to p. If the pixel is located at (x, y), its diagonal neighbours are:
(x+1, y+1): the pixel at the bottom-right diagonal.
(x+1, y-1): the pixel at the top-right diagonal.
(x-1, y+1): the pixel at the bottom-left diagonal.
Chapter-1 Digital Image Fundamentals 9
(x-1, y-1): the pixel at the top-left diagonal.
3. 8-Neighbours of a Pixel (N8(p)):
The 8-neighbours of a pixel consist of both the 4-neighbours and the diagonal
neighbours combined. If the pixel is located at (x, y), its 8-neighbours are:
Horizontal/Vertical neighbours: (x+1, y), (x-1, y), (x, y+1), (x, y-1).
Diagonal neighbours: (x+1, y+1), (x+1, y-1), (x-1, y+1), (x-1, y-1).
Adjacency Between Pixels
Adjacency is a concept used to determine how pixels are connected in an image.
It depends on their intensity values and the type of neighbors they have.
Set V:
V is a set of intensity values used to define adjacency.
In a binary image, for example, V = {1} if we are considering pixels with value
1 for adjacency.
In a grayscale image, where the pixel intensity values range from 0 to 255, V
could be any subset of these 256 values.
Types of Adjacency:
1. 4-adjacency:
Two pixels p and q with intensity values from V are said to be 4-adjacent
if q is one of the 4-neighbours of p.
2. 8-adjacency:
Two pixels p and q with intensity values from V are 8-adjacent if q is one
of the 8-neighbours of p.
3. m-adjacency (mixed adjacency):
Two pixels p and q with values from V are m-adjacent if:
q is in N4(p), or
Chapter-1 Digital Image Fundamentals 10
q is in ND(p), and the set N4(p) ∩ N4(q) has no pixels whose values
are from V.
This type of adjacency eliminates some ambiguities in connectivity,
particularly when dealing with diagonal connections.
Connectivity Between Pixels
Connectivity describes how groups of pixels are connected or form regions
based on adjacency. This is crucial for segmenting objects in an image.
1. 4-Connectivity:
A set of pixels are 4-connected if they are 4-adjacent to each other.
This form of connectivity considers only horizontal and vertical neighbors.
2. 8-Connectivity:
A set of pixels are 8-connected if they are 8-adjacent to each other.
This form of connectivity includes diagonal neighbors in addition to horizontal
and vertical neighbors.
3. m-Connectivity:
A set of pixels are m-connected if they are m-adjacent to each other.
This type of connectivity combines 4-adjacency and diagonal adjacency
(under specific conditions), offering a more refined way to establish
connectivity and avoid certain ambiguities that arise with purely 8-adjacency.
Chapter-1 Digital Image Fundamentals 11
Region
A region in an image is a subset of pixels, denoted as R, that forms a
connected set. This means that all pixels in R are connected to each other
according to the defined connectivity (either 4-, 8-, or m-connectivity).
For example, consider the following binary matrix:
000000
010010
011010
010110
000000
Chapter-1 Digital Image Fundamentals 12
In this example, the regions are the connected sets of pixels with the value 1.
Using 4-connectivity, there would be different regions, but using 8-connectivity,
certain clusters of pixels would be grouped together as a single region.
Boundary
The boundary (also called border or contour) of a region R is the set of pixels
within R that have at least one neighboring pixel that is not in R.
If R is the entire image, the boundary includes the pixels in the first and last
rows and columns.
For example, in the binary matrix given above, for the largest region formed using
8-connectivity, the boundary pixels are those 1's that have 0's as their neighbors.
These pixels define the shape of the region.
Digital Path
A digital path (or curve) is a sequence of distinct pixels that are adjacent to one
another, forming a continuous line from one pixel to another in an image.
Definition:
A digital path is defined from a pixel p at coordinates (x, y) to another pixel q
at coordinates (s, t) by a sequence of distinct pixels with coordinates:
where:
(X_0, Y_0) is the starting pixel (which is p).
(X_n, Y_n) is the ending pixel (which is q).
(X_i, Y_i) and (X_{i-1}, Y_{i-1}) are adjacent for all 1 ≤ i ≤ n.
The length of the path is n, the number of steps taken to reach from pixel p to
pixel q.
If the starting and ending points are the same ((X_0, Y_0) = (X_n, Y_n)), the
path is referred to as a closed path.
Types of Paths:
Chapter-1 Digital Image Fundamentals 13
4-path: A digital path that uses 4-adjacency, where each pixel in the path is a
4-neighbor of the previous pixel.
8-path: A digital path that uses 8-adjacency, where each pixel is an 8-
neighbor of the previous pixel.
m-path: A digital path that uses mixed adjacency, where both 4- and diagonal
neighbors are allowed under certain conditions.
These paths are essential in image processing tasks such as contour tracing,
boundary detection, and object recognition.
Distance Measures
1. Distance Function
A distance function (or metric) measures the "distance" between two points
(or pixels) in a space. It's used to quantify how similar or dissimilar two points
are.
Commonly used in image processing, pattern recognition, and clustering.
2. Euclidean Distance
Euclidean Distance is the straight-line distance between two points in
Euclidean space.
For two points \((x_1, y_1)\) and \((x_2, y_2)\), it is calculated as:
d = sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}
Represents the "as-the-crow-flies" distance, often used in image analysis and
spatial calculations.
3. City-Block Distance (D4)
City-Block Distance, also known as Manhattan Distance or D4 Distance,
measures the distance between two points by summing the absolute
differences of their coordinates.
For two points (x_1, y_1) and (x_2, y_2), it is:
d = |x_2 - x_1| + |y_2 - y_1|
Chapter-1 Digital Image Fundamentals 14
Represents the distance one would travel along grid lines, akin to moving
along streets in a grid layout.
4. Chessboard Distance (D8)
Chessboard Distance, also known as D8 Distance, measures the distance
between two points based on the maximum of the absolute differences of their
coordinates.
For two points (x_1, y_1)and (x_2, y_2), it is:
d =max(|x_2 - x_1|, |y_2 - y_1|
Represents the distance a king would travel on a chessboard, moving in any
direction (horizontal, vertical, or diagonal).
Applications of image processing
Image processing has a wide range of applications across various industries and
fields. Here are some prominent areas where image processing is applied:
1. Medical Imaging
CT Scans, MRIs, and X-rays: Enhance image quality, aid in diagnosis by
highlighting abnormalities like tumors, and reconstruct 3D images of internal
organs.
Microscopy: Used to improve visualization in biological imaging, such as
identifying bacteria, viruses, or cellular structures.
2. Computer Vision
Autonomous Vehicles: Object detection and recognition (e.g., identifying
pedestrians, vehicles, and road signs) for safe navigation.
Facial Recognition: Used in security systems, smartphones, and surveillance
to identify or verify a person's identity.
3. Remote Sensing
Chapter-1 Digital Image Fundamentals 15
Satellite Image Analysis: Monitoring land use, vegetation, climate changes,
and disaster management through analysis of satellite images.
Weather Prediction: Processing meteorological images to forecast weather
and track storms.
4. Digital Photography
Image Enhancement: Adjusting brightness, contrast, and colors to improve
the appearance of digital photos.
Photo Restoration: Removing noise, scratches, and restoring damaged
images.
5. Augmented Reality (AR) and Virtual Reality (VR)
Overlay of Digital Content: Image processing helps merge real-world images
with digital data for immersive experiences in applications like gaming,
education, and training.
6. Industrial Automation and Quality Control
Defect Detection: Used to inspect products for defects in manufacturing lines
(e.g., detecting cracks, misalignment).
Robotic Vision: Enables robots to "see" and recognize objects, making them
capable of sorting, assembling, or performing other tasks.
7. Forensic Analysis
Crime Scene Investigation: Enhances low-quality images or videos to help in
identifying objects or people.
Document Authentication: Verifies the authenticity of documents by
examining patterns and details that may not be visible to the naked eye.
8. Entertainment and Media
Special Effects: Used in movies and video games for creating visual effects,
3D rendering, and animations.
Chapter-1 Digital Image Fundamentals 16
Video Enhancement: Enhancing video quality in streaming, broadcasting, and
post-production processing.
9. Optical Character Recognition (OCR)
Text Extraction: Converts images of typed, handwritten, or printed text into
machine-readable formats for use in document digitization and translation.
10. Security and Surveillance
Motion Detection: Identify movement in security cameras to detect suspicious
activities.
License Plate Recognition: Automatically identifying vehicle license plates in
real time for traffic monitoring and law enforcement.
11. Biometrics
Fingerprint Analysis: Used for personal identification in access control and
security systems.
Iris and Retina Scanning: For highly secure biometric identification.
12. Agriculture
Crop Monitoring: Satellite and drone imagery help monitor crop health, detect
pests, and optimize agricultural practices.
Soil and Water Assessment: Image processing techniques help in assessing
soil moisture levels and water distribution.
13. Astronomy
Space Exploration: Enhancing and analyzing astronomical images to study
distant celestial objects, stars, galaxies, and black holes.
Noise Reduction: Removing cosmic noise from images captured by space
telescopes to improve clarity.
Image processing has evolved to become critical in various technological
advances, and its applications continue to expand as new imaging techniques and
machine learning methods emerge.
Chapter-1 Digital Image Fundamentals 17
Chapter-1 Digital Image Fundamentals 18