Introduction to Image Processing
by
Dr. Anirban Dasgupta
Assistant Professor, Dept. of Electronics and Electrical Engineering
Associated Faculty, Dept. of Design
Associated Faculty, Centre for Intelligent Cyber Physical Systems
IIT Guwahati
Digital Images – What Are They?
Definition
A digital image can be represented as a 2D array of pixels, where each pixel corresponds
to a small square (or dot) in the image grid and contains information about the image's
color or intensity at that point.
Digital Color Images
Grayscale vs Color
A digital image can be represented as three 2D arrays each denoting a channel (Red,
Green, Blue – RGB)
Digital Image Attributes
Image Resolution
• Image resolution refers to the amount of detail an image holds.
• It is defined by the number of pixels in the image.
• Measured as: Width × Height (in pixels)
• Example: 1920 × 1080 means 1920 pixels wide and 1080 pixels tall.
• Higher resolution = More detail (but also larger file size and more processing power
needed).
Resolution Common Name Use Case
640 × 480 VGA Basic webcams, early robotics
1280 × 720 HD (720p) Standard video processing
1920 × 1080 Full HD (1080p) High-quality video, robotics vision
3840 × 2160 4K UHD Precision tasks, high-detail imaging
Digital Image Attributes
Aspect Ratio
• Aspect ratio is the proportional relationship between the width and height of an image.
• Formula: Width : Height.
• Example: A 1920 × 1080 image has an aspect ratio of 16:9.
Aspect Ratio Shape Common Uses
4:3 More square Old TVs, standard camera sensors
16:9 Wide HD video, modern screens
1:1 Square Instagram photos, profile images
Cinematic displays, some robot vision
21:9 Ultra-wide
systems
Digital Image Attributes
Bit Depth
• Bit depth refers to the number of bits used to represent the color or intensity of a single
pixel in an image. It directly affects how many shades of gray (in grayscale) or colors
(in color images) can be displayed.
In Grayscale Images
• 8-bit grayscale = 256 possible intensity levels (0 = black, 255 = white).
• More bit depth = finer gradation between light and dark.
In Color Images (RGB)
• 24-bit color = 8 bits per channel (R, G, B).
• Each channel can store 256 values → 256 × 256 × 256 = 16,777,216 possible colors.
Image Coordinate System
• The image coordinate system is a way of locating and referencing pixels in a digital
image.
• It defines how pixel positions are labeled using X (horizontal) and Y (vertical) axes.
• Origin (0, 0) is at the top-left corner of the image.
• The X-axis increases to the right.
• The Y-axis increases downward.
(0,0) (1,0) (2,0) (3,0) (4,0) (5,0) (6,0)
(0,1) (1,1) (2,1) (3,1) (4,1) (5,1) (6,1)
(0,2) (1,2) (2,2) (3,2) (4,2) (5,2) (6,2)
Image Metrics
• quantitative measures used to • Brightness
evaluate the properties, quality, • Contrast
or features of an image. • Saturation
• help analyze images for tasks • Sharpness
like enhancement, compression, • Dynamic Range
comparison, or computer vision. • Histogram
• Entropy
Image Brightness
Image Contrast
Michelson contrast
Image Saturation
• The intensity or purity of colors in an image
• High Saturation = vivid colors,
• Low Saturation = washed-out, faded
• Zero saturation = grayscale image
Image Sharpness
• Clarity of detail or edge definition in an image
• Often measured using edge strength or high-frequency components
• Variance of Laplacian, which measures how much an image changes at edges
Image Dynamic Range
• Dynamic range in an image refers to the ratio between the brightest and darkest parts
that can be represented or detected.
• It tells you how much detail is visible in both shadows and highlights.
• High dynamic range (HDR): Captures both very dark and very bright areas with detail.
• Low dynamic range: Loses details in shadows (black crush) or highlights (blown out).
• High dynamic range often leads to high
contrast, but they are not synonymous.
• Dynamic range is about the amount of
information an imaging system can capture,
while contrast is about how that information
is presented visually.
Image Histogram
• An image histogram is a graphical representation that shows the distribution of pixel
intensity values in an image.
• It helps answer:
• How many pixels are bright vs. dark?
• Is the image well-exposed, too bright, or too dark?
• How is the contrast distributed?
Histogram Computation
Image Histogram
Image Entropy
Image Entropy
Introduction to Color Spaces
What is a color space?
• A method of representing colors numerically
• Defines how color components are related to each other
Why are color spaces important in computer vision?
• Different tasks (e.g., object detection, image segmentation) require
specific color representations.
• Color spaces provide efficient ways to handle color variations and
lighting conditions.
RGB Color Space
Additive color model
• colors created by combining
different intensities of the
three primary colors.
• Used in digital cameras,
displays, and scanners.
• Advantages: Direct
representation in hardware
(e.g., monitors, cameras).
• Limitations: Not perceptually
uniform
RGB Color Space
Grayscale Conversion
HSV Color Space
• HSV stands for Hue, Saturation,
Value.
• Hue: The type of color (0° to 360°).
• Saturation: The intensity or purity
of the color (0% to 100%).
• Value: The brightness (0% to
100%).
• Separates chromatic content (hue)
from intensity (value).
• More intuitive for human users to
adjust color.
HSV Color Space
Hue represents the type or shade of color
usually represented on a scale from 0° to
360°, where each value corresponds to a
specific color
Saturation refers to the intensity or purity
of a color.
Value, also called Brightness indicates how
much light is perceived in the color.
HSV Color Space
Bayer Filter Mosaic
• Bayer filter mosaic is a color filter
array (CFA) for arranging RGB
color filters on a square 2×2 grid
pattern of photosensors
• Bayer filter pattern is arranged in
a checkerboard-like layout,
consisting of 50% green filters,
25% red filters, and 25% blue
filters
• human eye sees green better than
any color in the spectrum
Image Enhancement
What is image enhancement?
Image enhancement is the process of adjusting digital images so that the
results are more suitable for display or further image analysis.
Image Enhancement
Image
Enhancement
Brightness Contrast Sharpness Noise
Enhancement Enhancement Enhancement Removal
Image Enhancement
Linear Brightness: Increases
brightness by adding a fixed
value to pixel intensities.
Gamma Correction: Adjusts
brightness non-linearly, affecting
Brightness Enhancement
contrast and visibility.
Histogram Equalization:
Redistributes pixel intensities to
cover the full range, improving
global contrast.
CLAHE: Performs adaptive
local histogram equalization to
enhance contrast without
amplifying noise too much.
Adaptive Brightness: Uses local
windows
Image Enhancement
Histogram
Equalization
Contrast Enhancement
CLAHE
Contrast Stretching
(Normalization)
Logarithmic
Transformation
Exponential
Transformation
Image Enhancement
Laplacian sharpening
Sharpness Enhancement
Unsharp Masking
High-pass filter
enhancement
Kernel-based sharpening
(custom kernel)
Detail enhancement using
bilateral filtering
Image Enhancement
Gaussian Blur
Median Filter
Noise Removal
Bilateral Filter
Non-local Means
Denoising
Wiener Filter
Image Smoothing
What is image smoothing?
• Smoothing in image processing refers to the process of reducing noise or
other unwanted artifacts in an image while preserving important features
and structures
• Smoothing techniques use various algorithms, such as filters or
convolutions, to remove noise or other distortions in the image.
Types of Smoothing Filters
•Mean filter
•Median filter
•Gaussian filter
•Custom filter
•Bilateral filter
•Non-local Means filter
•Wavelet filter bank
Introduction
What is image sharpening?
• Sharpening enhances the definition of edges in an image.
• A sharpened image is that in which the edges are clearly distinguishable by
the viewer
• If the change of intensity and contrast at the edge is significant then the
image is said to be sharp.
Edges in Images
• Edges are significant local changes of intensity in a digital image. An edge
can be defined as a set of connected pixels that forms a boundary between two
disjoint regions. There are three types of edges:
• Horizontal edges
• Vertical edges
• Diagonal edges
Horizontal edges Vertical edges Diagonal edges
Types of Sharpening Filters
• Edge Detectors
• Sobel
• Prewitt
• Robert
• Laplacian Filter
• Laplacian of Gaussian Filter
• Canny
• High Boost Filter
• Unsharp Masking
• Custom filter
Types of Sharpening Filters
What is a Geometric Transformation?
• Geometric transformation in image
transformation consists of two steps,
• spatial transformation of pixels or
coordinates
• intensity interpolation.
• The pixel having coordinate (x, y)
will be moved to coordinate (x', y').
Image Registration
• Image registration is the process of aligning multiple images into a single coordinate
system
• Usually multiple images of the same scene taken at different times, from different
viewpoints, or using different sensors to achieve spatial correspondence
Image Segmentation
• is the process of partitioning an image into multiple regions to simplify its
analysis and interpretation
• can be used to isolate specific objects or boundaries in an image, enabling
tasks like object detection, face recognition, and medical image analysis
Source: The Gradient
Image Segmentation
Segmentation Types
Semantic Instance Panoptic
Segmentation Segmentation Segmentation
Resources & Further Reading
R. C. Gonzalez and R. E. Woods, Digital Image
Processing, 4th ed. New York, NY, USA: Pearson,
2018.
9/7/2025 12:50:33 PM 42
Dr. Anirban Dasgupta, EEE, IIT Guwahati