DIGITAL IMAGE PROCESSING
Unit 1 — Complete Study Guide
6th Semester [Link] | IPU Exam Focused
Origins • Fields • Steps • Systems • Sampling • Quantization • Pixels • Connectivity • Distance • Operations
Syllabus Topics Covered
1. Origins of Digital Image Processing | 2. Fields Using DIP | 3. Fundamental Steps in
Image Processing | 4. Elements of DIP Systems | 5. Image Sampling & Quantization | 6.
Neighbours of a Pixel | 7. Connectivity (4, 8, m) | 8. Distance Measures (Euclidean, City
Block, Chessboard) | 9. Linear & Non-Linear Operations
SECTION 1: Origins of Digital Image Processing
Digital Image Processing (DIP) refers to the use of digital computers to process and manipulate
digital images through algorithms.
Digital Image — 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.
Key Definition — Digital Image
An image f(x,y) is digital when x, y, and the amplitude values of f are all finite and discrete
quantities. This is the most fundamental definition in DIP — memorize it.
1.1 Historical Timeline of DIP
Year / Era Milestone
1920s Early use: Newspaper industry used Bartlane cable picture
transmission system to digitize images for submarine cable
transmission between London and New York
1960s NASA used computers to process moon images from Ranger
7 spacecraft — first major application of DIP. Jet Propulsion
Laboratory (JPL) pioneered this.
1970s CT scanning (Computed Tomography) introduced — major
breakthrough in medical imaging. Also: development of first
practical image processing algorithms.
1980s Commercial DIP systems became affordable. Remote
sensing, satellite imaging gained momentum.
1990s Internet boom — JPEG, GIF, PNG formats. Digital cameras
replaced film cameras.
2000s–Present Deep Learning + DIP merged — CNNs for image recognition,
object detection, autonomous vehicles, medical AI diagnostics.
📝 EXAM TIP: IPU Exam Favorite: The FIRST application of DIP was NASA's
processing of moon images by JPL using Ranger 7 spacecraft in the 1960s. Also
mention the Bartlane system (1920s) as the historical precursor.
1.2 Two Principal Application Areas that Started DIP
• Improvement of pictorial information for human interpretation
• Processing of scene data for autonomous machine perception (computers understanding
images)
Continuous vs Digital Image Processing
Continuous Image Processing: Processes images using optical/analog hardware (lens, film)
Digital Image Processing: Processes images using digital computers and algorithms Hybrid:
Combination of both — often used in practice
SECTION 2: Fields that Use Digital Image Processing
DIP is used across a remarkably wide range of fields. IPU exams commonly ask you to list and explain
these fields with examples.
Field Application & Example
Gamma-Ray Imaging Used in nuclear medicine and astronomy. PET (Positron
Emission Tomography) scans use gamma rays to image the
body's metabolic activity. Also used in nuclear reactor
monitoring.
X-Ray Imaging Medical X-rays, CT scans, dental imaging. Also used in
industrial inspection (checking welds, cracks in metal). Oldest
form of imaging beyond visible light.
Ultraviolet (UV) Imaging Used in lithography for semiconductor manufacturing,
microscopy (detecting fluorescence), and studying surface
flaws. Also in astronomy for studying stars.
Visible Light Imaging Most common — includes digital cameras, surveillance
systems, autonomous vehicles, OCR (Optical Character
Recognition), biometric identification (face, iris).
Infrared (IR) Imaging Night vision cameras, heat maps, detecting faults in electrical
systems (thermal imaging), remote sensing of earth surface
temperatures, missile guidance.
Microwave Imaging RADAR (Radio Detection And Ranging) imaging. Used in
weather forecasting (Doppler radar), geology, and military
surveillance. Can penetrate clouds and darkness.
Radio Wave Imaging MRI (Magnetic Resonance Imaging) — creates 3D images of
internal organs using magnetic fields and radio waves. Most
detailed soft tissue imaging available.
Acoustic / Ultrasound Medical ultrasound (fetal imaging, organ scanning), sonar for
underwater mapping, non-destructive testing of materials.
Remote Sensing Satellites (LANDSAT, ISRO's Resourcesat) take multi-spectral
images of Earth. Used for crop monitoring, disaster
assessment, urban planning, deforestation tracking.
Medical Imaging CT, MRI, PET, X-ray, ultrasound — all use DIP techniques for
diagnosis, 3D reconstruction, tumor detection, surgical
planning.
Industrial Automation Quality control on assembly lines (detecting defects), robotic
vision, PCB inspection, automated sorting systems.
Biometrics Fingerprint, face, iris, retinal recognition. Used in Aadhaar
(India), passport control, smartphone unlock systems.
Document Analysis OCR for reading text in scanned documents, cheque
processing, license plate recognition (ANPR).
Astronomy Processing Hubble telescope images, detecting distant
galaxies, analyzing planetary surfaces (Mars rover images
processed by NASA).
📝 EXAM TIP: IPU often asks: 'List 5 fields using DIP with examples.' Cover: Medical,
Remote Sensing, Industrial, Biometrics, Astronomy. Always explain each with a
concrete example — this earns more marks.
SECTION 3: Fundamental Steps in Digital Image Processing
Gonzalez & Woods define a standard pipeline of steps in DIP. Understanding this pipeline is essential
for IPU exams.
Step Name Description
1 Image Acquisition Capturing the digital image
using a sensor (camera,
scanner, satellite). The image is
digitized — converted to a 2D
array of numbers (pixel values).
2 Image Enhancement Improving image quality for
better visual appearance or
analysis. Examples: brightness
adjustment, contrast stretching,
histogram equalization, noise
removal. Subjective process.
3 Image Restoration Recovering a degraded image
to its original form using a
mathematical model of the
degradation. Objective (model-
based) — unlike enhancement.
Examples: deblurring,
denoising.
4 Color Image Processing Dealing with color images (RGB,
HSI, CMY models). Color is
used for segmentation,
recognition, and compression.
Color spaces and
transformations are studied
here.
5 Wavelets & Multi-resolution Representing images at different
Processing levels of resolution. Used in
image compression (JPEG
2000), progressive image
transmission, and feature
extraction.
6 Compression Reducing the number of bits
needed to store/transmit an
image. Types: Lossless (PNG)
and Lossy (JPEG). Based on
removing redundancy (spatial,
temporal, psychovisual).
7 Morphological Processing Tools for extracting image
components useful for shape
representation. Operations:
Erosion, Dilation, Opening,
Closing. Works on binary and
grayscale images.
8 Segmentation Partitioning an image into
meaningful regions or objects.
Most difficult step. Methods:
Thresholding, Edge detection,
Region growing, Watershed
algorithm.
9 Representation & Description After segmentation, regions are
represented (boundary or
region-based) and described
using features (shape, texture,
color) for further analysis.
10 Object Recognition Assigning labels to objects
based on descriptors. Final step:
machine gives meaning to the
image. Includes classification
algorithms, CNNs, pattern
matching.
11 Image Storage & Storing processed images in
Communication standard formats (JPEG, PNG,
TIFF, BMP) and transmitting
them. Involves databases and
networking.
📝 EXAM TIP: These 11 steps form the DIP pipeline from Gonzalez & Woods (the
standard textbook). IPU asks: 'Explain the fundamental steps in DIP with a diagram.'
Draw a block diagram showing these steps in order — Enhancement, Restoration,
Segmentation, Recognition are the most commonly tested.
Key Distinction: Enhancement vs. Restoration
Enhancement: Subjective — makes the image look better to humans. No model of
degradation needed. (e.g., increase brightness) Restoration: Objective — uses a
mathematical model of how the image was degraded to reverse the degradation. (e.g.,
deblurring a motion-blurred photo) This distinction is a very common IPU short question.
SECTION 4: Elements of a Digital Image Processing System
A complete DIP system consists of several hardware and software components working together.
Component Role & Description
1. Image Sensing & Two components needed: (a) Physical device sensitive to
Acquisition energy band — camera, X-ray detector, infrared sensor; (b)
Digitizer — converts sensor output into digital form (ADC —
Analog-to-Digital Converter).
2. Image Storage Three types: (a) Short-term storage: RAM / frame buffer for
images being actively processed; (b) Online storage: Hard
drives, SSDs for large image databases; (c) Archival storage:
Optical discs, magnetic tape for long-term storage.
3. Image Processing Dedicated hardware for fast processing: (a) Image Processing
Hardware Board (IPB) with DSP chips; (b) GPU (Graphics Processing
Unit) — massively parallel, ideal for image processing; (c)
FPGA for real-time applications.
4. Computer / CPU General-purpose computer (PC, workstation, or server) that
runs DIP algorithms and software. Controls all other
components.
5. Software DIP algorithms implemented as software: MATLAB (Image
Processing Toolbox), OpenCV (Python/C++), ImageJ (medical
imaging), Photoshop (commercial). Includes custom
algorithms.
6. Image Display Monitors, projectors, or printers for displaying processed
images. Modern displays: 4K monitors, HDR displays.
Medical: high-resolution diagnostic monitors.
7. Hardcopy Devices Printers, laser printers, film recorders for producing permanent
hard copies of images. Used in medical printing (X-ray films),
newspaper printing, satellite maps.
8. Networking Transmitting images over networks (LAN, internet, satellite
link). Important for telemedicine, remote sensing data centers,
cloud-based image processing.
Complete DIP System Block Diagram
Image Source → Sensor/Camera → Digitizer (ADC) → Image Storage (RAM/HDD) → CPU
+ Processing Hardware → Software Algorithms → Display/Hardcopy Output Note: All
components are interconnected via a system bus. The computer acts as the central
controller.
📝 EXAM TIP: IPU exam often asks to draw and explain the block diagram of a DIP
system. The key components to always mention: Image Acquisition, Storage (3
types), Processing Hardware (GPU/DSP), Software, and Display.
SECTION 5: Image Sampling and Quantization
To process an image digitally, a continuous image must be converted into a discrete digital image. This
requires two operations: Sampling and Quantization.
The Big Picture
Continuous Image f(x,y) → [SAMPLING] → Discrete spatial coordinates →
[QUANTIZATION] → Discrete amplitude values → Digital Image f(x,y) Sampling makes the
spatial coordinates discrete. Quantization makes the intensity values discrete.
5.1 Sampling
Sampling is the process of digitizing the spatial (x, y) coordinates of a continuous image. It determines
the SPATIAL RESOLUTION of the image.
• A continuous image is divided into a grid of M rows × N columns
• Each intersection point in the grid is called a pixel (picture element)
• More samples = higher spatial resolution = sharper image = larger file size
• Sampling rate: Number of samples taken per unit distance (samples/mm or samples/inch —
DPI)
🔢 FORMULA — Image Size
Total pixels = M × N (M rows × N columns)
Nyquist Sampling Theorem (Critical for Exams):
Nyquist Theorem states that to perfectly reconstruct a continuous signal, the sampling rate must be at
least TWICE the highest frequency component in the signal.
🔢 FORMULA — Nyquist Criterion
Sampling Rate ≥ 2 × f_max (where f_max = maximum spatial
frequency in image)
• If sampling rate is too low → Aliasing occurs
Aliasing — a distortion artifact where high-frequency details appear as false low-frequency patterns
(e.g., Moiré patterns on fine fabric in photos)
• Anti-aliasing: Apply a low-pass filter BEFORE sampling to remove high frequencies
📝 EXAM TIP: Nyquist Theorem is a must-know formula. Aliasing = under-sampling
artifact. Anti-aliasing = low-pass filtering before sampling. These are standard IPU
short questions.
5.2 Quantization
Quantization is the process of digitizing the amplitude (intensity) values of a sampled image. It
determines the GRAY LEVEL RESOLUTION (number of distinct shades).
• Continuous intensity values are mapped to a finite set of discrete levels
• Number of gray levels: L = 2^k, where k = number of bits per pixel
• More bits → more gray levels → smoother gradients → larger file size
🔢 FORMULA — Gray Levels and Bits
L = 2^k Number of gray levels = 2 raised to the number of
bits Storage (bits) = M × N × k
Bits per pixel (k) Gray Levels (L = 2^k)
1 bit 2 levels (binary — black & white only)
2 bits 4 levels
4 bits 16 levels
6 bits 64 levels
8 bits 256 levels (standard grayscale — most common)
10 bits 1024 levels (medical imaging)
12 bits 4096 levels (scientific/astronomical imaging)
16 bits 65536 levels (high dynamic range imaging)
24 bits 16.7 million colors (standard color image: 8 bits × RGB)
False Contouring — when too few gray levels are used (e.g., 4 bits or less), smooth gradients appear
as abrupt steps, creating false edges called false contours.
🔢 FORMULA — Storage Calculation Example
512×512 image, 8-bit: Storage = 512 × 512 × 8 = 2,097,152 bits
= 256 KB 1024×1024 image, 8-bit: Storage = 8,388,608 bits = 1
MB
📝 EXAM TIP: VERY common IPU numerical: 'Calculate storage for a 256×256 image
with 64 gray levels.' Formula: Storage = M × N × k bits. Here k = log₂(64) = 6 bits.
Answer: 256 × 256 × 6 = 393,216 bits = 48 KB.
5.3 Spatial vs. Gray-Level Resolution
Spatial Resolution Gray-Level Resolution
Determined by SAMPLING Determined by QUANTIZATION (number of bits k)
(number of pixels M×N)
Measured in DPI (dots per Measured in bits per pixel or number of gray levels
inch) or PPI
More pixels = sharper More gray levels = smoother gradients, less false contouring
edges and fine details
Low spatial resolution = Low gray-level resolution = false contours, banding artifacts
blocky, pixelated image
Example: 1920×1080 (HD) Example: 8-bit (256 levels) vs 1-bit (binary)
vs 3840×2160 (4K)
Isopreference Curves
Gonzalez & Woods showed that for images with fine detail, spatial resolution is more
important than gray level resolution. For images with smooth regions (like portraits), more
gray levels matter more. This forms the basis of isopreference curves — a set of (M×N, k)
combinations that produce equal perceived quality.
SECTION 6: Basic Relationships Between Pixels
Understanding relationships between pixels is fundamental to image analysis, connectivity, and
segmentation algorithms.
6.1 Neighbours of a Pixel
Consider a pixel p at coordinates (x, y). Its neighbours are defined as follows:
A) 4-Neighbours — N₄(p)
4-Neighbours of pixel p at (x, y) are the four pixels directly adjacent horizontally and vertically:
🔢 FORMULA — 4-Neighbours of p(x,y)
N₄(p) = { (x+1, y), (x-1, y), (x, y+1), (x, y-1) }
4-Neighbours of p
(marked with N)
N
N P N
N
• Only 4 pixels: Top, Bottom, Left, Right
• Diagonal neighbours are NOT included in N₄
• If p is at the image border, some neighbours may fall outside the image
B) Diagonal Neighbours — N_D(p)
Diagonal Neighbours of pixel p at (x, y) are the four pixels diagonally adjacent:
🔢 FORMULA — Diagonal Neighbours of p(x,y)
N_D(p) = { (x+1,y+1), (x+1,y-1), (x-1,y+1), (x-1,y-1) }
Diagonal Neighbours of p
(marked with D)
D D
P
D D
• Only 4 diagonal pixels — no horizontal/vertical neighbours
C) 8-Neighbours — N₈(p)
8-Neighbours of pixel p are ALL 8 surrounding pixels — both the 4-neighbours AND the 4-diagonal
neighbours:
🔢 FORMULA — 8-Neighbours of p(x,y)
N₈(p) = N₄(p) ∪ N_D(p) = all 8 surrounding pixels
8-Neighbours of p (all
surrounding pixels)
N N N
N P N
N N N
📝 EXAM TIP: Exam trick: N₄ = 4 (top/bottom/left/right). N_D = 4 (diagonals). N₈ = 8 (all
surrounding). N₈(p) = N₄(p) + N_D(p). Boundary pixels may have fewer than 4 or 8
neighbours.
SECTION 7: Connectivity
Connectivity is a fundamental concept used to determine whether pixels are connected to each other
— essential for defining regions, boundaries, and objects in an image.
For two pixels to be connected, they must satisfy TWO conditions:
• They must be neighbours (spatially adjacent — in each other's neighbourhood)
• Their gray level values must be similar (satisfy some predefined condition, e.g., both belong to
the same gray level set V)
V = Set of gray-level values used to define adjacency (e.g., V = {1} for binary images, or V = {150,
151, ..., 200} for grayscale)
7.1 Types of Connectivity
A) 4-Connectivity
4-Connectivity: Two pixels p and q with values from set V are 4-connected if q is in N₄(p) — i.e., they
are horizontal or vertical neighbours with values in V.
4-Connectivity Rule
p and q are 4-connected ⟺ q ∈ N₄(p) AND both pixel values ∈ V Only horizontal and
vertical adjacency is considered — diagonal adjacency is ignored.
B) 8-Connectivity
8-Connectivity: Two pixels p and q are 8-connected if q is in N₈(p) — i.e., they are any of the 8
surrounding neighbours with values in V.
8-Connectivity Rule
p and q are 8-connected ⟺ q ∈ N₈(p) AND both pixel values ∈ V Both horizontal,
vertical, AND diagonal adjacency are considered.
C) Mixed (m-Connectivity) — Most Important for IPU
m-Connectivity (Mixed Connectivity): Introduced to eliminate ambiguity in 8-connectivity. Two pixels
p and q are m-connected if:
• q ∈ N₄(p) — they are 4-neighbours with values in V, OR
• q ∈ N_D(p) AND N₄(p) ∩ N₄(q) contains NO pixels with values in V
In simple words: Use diagonal connection ONLY if there is no 4-connected path between the two pixels
through common neighbours.
Why m-Connectivity? — The Ambiguity Problem
In 8-connectivity, there can be multiple paths between two pixels, creating ambiguity about
which connection is 'real.' m-Connectivity eliminates this ambiguity by using diagonal
connections only when no 4-path exists. Example: In the pattern below, pixels A and B
have two 8-paths, but m-connectivity picks only one. 1 1 1 1 Here, 8-connectivity
creates ambiguity at corners. m-connectivity resolves this.
Connectivity Type Neighbours Used & Key Property
4-Connectivity Uses only N₄ (horizontal + vertical). Simple but may
disconnect regions that are diagonally adjacent.
8-Connectivity Uses all N₈ (horizontal + vertical + diagonal). More inclusive
but can cause ambiguous multiple paths.
m-Connectivity Uses N₄ first; diagonal only if no common 4-neighbour exists.
Eliminates path ambiguity — most precise.
📝 EXAM TIP: m-Connectivity is the MOST important connectivity type for IPU exams.
It eliminates the ambiguity problem of 8-connectivity. Always explain why: '8-
connectivity creates multiple paths; m-connectivity allows diagonal connection
ONLY when no 4-path exists through a common neighbour.'
7.2 Paths and Connected Components
Path: A path from pixel p(x,y) to pixel q(s,t) is a sequence of distinct pixels: (x₀,y₀), (x₁,y₁), ..., (x ₙ,y ₙ)
where (x₀,y₀) = p and (xₙ,yₙ) = q, and each consecutive pair is connected.
• Path length = number of steps (n) in the path
• 4-path: Each step uses only 4-connectivity
• 8-path: Each step uses 8-connectivity
Connected Component: A set S of pixels where every pair of pixels in S has a path lying entirely
within S.
Region: A connected subset of pixels that shares similar gray-level properties.
Boundary: The set of pixels in a region that have at least one neighbour OUTSIDE the region.
📝 EXAM TIP: Foreground/Background Paradox: If foreground uses 4-connectivity,
background must use 8-connectivity (and vice versa) to avoid topological
contradictions. This is called the Jordan Curve Theorem applied to digital images.
SECTION 8: Distance Measures Between Pixels
For pixels p(x, y), q(s, t), and z(u, v), a distance function D must satisfy three properties:
Property Condition
Non-negativity D(p, q) ≥ 0 and D(p, q) = 0 iff p = q
Symmetry D(p, q) = D(q, p)
Triangle Inequality D(p, z) ≤ D(p, q) + D(q, z)
8.1 Euclidean Distance — D_e
Euclidean Distance is the straight-line distance between two pixels.
🔢 FORMULA — Euclidean Distance
D_e(p, q) = √[ (x−s)² + (y−t)² ]
• Pixels within Euclidean distance r of (x,y) form a CIRCLE (disk)
• Most intuitive distance — but involves square root computation (slower)
• Euclidean distance is NOT restricted to integer values
Example: p = (0,0), q = (3,4)
D_e = √(3² + 4²) = √(9 + 16) = √25 = 5
8.2 City Block Distance (Manhattan Distance) — D₄
City Block Distance (D₄) is the sum of absolute differences in x and y coordinates. Also called
Manhattan, L1, or Taxicab distance.
🔢 FORMULA — City Block Distance (D₄)
D₄(p, q) = |x − s| + |y − t|
• Pixels within city block distance r of (x,y) form a DIAMOND (rotated square) shape
• Called 'City Block' because it resembles navigating city blocks — only horizontal/vertical moves
• Related to 4-connectivity — the minimum D₄ path uses only 4-connected moves
Example: p = (0,0), q = (3,4)
D₄ = |0−3| + |0−4| = 3 + 4 = 7
D₄ = 2 neighborhood
(diamond shape —
values show D₄ distance
from center)
2
2 1 2
1 0 1
2 1 2
2
8.3 Chessboard Distance — D₈
Chessboard Distance (D₈) is the maximum of absolute differences in x and y. Named because it's the
number of moves a King takes in chess.
🔢 FORMULA — Chessboard Distance (D₈)
D₈(p, q) = max( |x − s|, |y − t| )
• Pixels within chessboard distance r of (x,y) form a SQUARE
• Related to 8-connectivity — the minimum D₈ path uses 8-connected moves
• Diagonal moves count the SAME as horizontal/vertical moves (like a king in chess)
Example: p = (0,0), q = (3,4)
D₈ = max(|0−3|, |0−4|) = max(3, 4) = 4
D₈ = 2 neighborhood (square shape —
values show D₈ distance from center)
2 2 2 2 2
2 1 1 1 2
2 1 0 1 2
2 1 1 1 2
2 2 2 2 2
8.4 Comparison of All Three Distance Measures
Distance Measure Formula | Shape | Example p(0,0) q(3,4) | Connectivity
Euclidean (D_e) sqrt[(x-s)^2 + (y-t)^2] | Circle shape | Result = 5.0 | N/A
(continuous)
City Block D4 |x-s| + |y-t| | Diamond shape | Result = 3+4 = 7 | 4-
connectivity
Chessboard D8 max(|x-s|, |y-t|) | Square shape | Result = max(3,4) = 4 | 8-
connectivity
Distance Relation D8(p,q) <= De(p,q) <= D4(p,q) -- ALWAYS TRUE for any two
pixels
🔢 FORMULA — Distance Relationship
D₈(p,q) ≤ D_e(p,q) ≤ D₄(p,q) (always true for any two
pixels)
📝 EXAM TIP: MOST TESTED: Numerical problems where you calculate all 3 distances
for given pixel coordinates. Also: 'D₄ gives a diamond shape; D₈ gives a square
shape; D_e gives a circle.' The relationship D₈ ≤ D_e ≤ D₄ is frequently asked as a
short question.
SECTION 9: Linear and Non-Linear Operations
Image processing operations are classified into Linear and Non-Linear operations based on whether
they satisfy the principles of superposition and homogeneity.
9.1 Linear Operations
Linear Operation: An operator H is linear if it satisfies both the Additivity (Superposition) and Scaling
(Homogeneity) properties.
A linear operator H must satisfy:
🔢 FORMULA — Superposition (Additivity)
H[ a·f(x,y) + b·g(x,y) ] = a·H[f(x,y)] + b·H[g(x,y)]
Where f and g are input images, and a, b are constants.
Two sub-conditions that must BOTH hold:
Property Condition
Additivity (Superposition) H[f(x,y) + g(x,y)] = H[f(x,y)] + H[g(x,y)] — the output of the
sum = sum of outputs
Scaling (Homogeneity) H[a · f(x,y)] = a · H[f(x,y)] — scaling input scales the output
by the same factor
Common Examples of Linear Operations:
• Image Addition: g(x,y) = f(x,y) + h(x,y) — adding two images
• Image Subtraction: g(x,y) = f(x,y) − h(x,y) — used to detect changes between images
• Scalar Multiplication: g(x,y) = c · f(x,y) — adjusting brightness
• Linear Spatial Filtering (Convolution): g(x,y) = f(x,y) * h(x,y) — using a kernel/mask
• Fourier Transform — transforms image to frequency domain (linear operation)
• Averaging (Mean Filter): replaces each pixel with the mean of its neighbourhood
Why Linear Operations Matter
Linear operations are mathematically tractable — they can be analyzed using linear
systems theory. Convolution (a linear operation) is the basis of most spatial filtering in DIP.
The Fourier Transform assumes linearity to decompose images into frequency components.
9.2 Non-Linear Operations
Non-Linear Operation: An operator that does NOT satisfy the superposition principle. Most real-world
image processing tasks involve non-linear operations.
Non-Linear condition (fails superposition):
🔢 FORMULA — Non-Linear Violation
H[a·f + b·g] ≠ a·H[f] + b·H[g]
Common Examples of Non-Linear Operations:
• Median Filter: Replaces each pixel with the median value of its neighbourhood. Excellent for
removing Salt-and-Pepper noise. Non-linear because median is not a linear function.
• Max Filter: Replace pixel with maximum value in neighbourhood — used for dilation
• Min Filter: Replace pixel with minimum value in neighbourhood — used for erosion
• Morphological Operations: Erosion, Dilation, Opening, Closing — all non-linear
• Histogram Equalization: Non-linear contrast enhancement — maps pixel values non-linearly
• Logarithmic Transformation: g(x,y) = c · log(1 + f(x,y)) — compresses dynamic range
• Power-Law (Gamma) Transformation: g(x,y) = c · f(x,y)^γ — used for gamma correction
• Thresholding: g(x,y) = 1 if f(x,y) ≥ T, else 0 — creates binary image
• Image AND, OR, NOT: Logical operations on binary images — non-linear
9.3 Linear vs. Non-Linear — Full Comparison
Linear Operations Non-Linear Operations
Satisfy superposition: Do NOT satisfy superposition
H[af+bg] = aH[f]+bH[g]
Mathematically simpler to Harder to analyze mathematically but often more effective
analyze
Examples: Convolution, Examples: Median filter, Morphological ops, Gamma
Averaging, Fourier correction, Thresholding, Histogram equalization
Transform, Image
Addition/Subtraction
Linear filters blur edges Median filter removes noise WITHOUT blurring edges
while removing noise
Used in frequency domain Used in robust noise removal, segmentation, enhancement
analysis
Mean filter is linear — Median filter is non-linear — robust to outliers/impulse noise
affected by outliers
📝 EXAM TIP: Most important non-linear operation for IPU: Median Filter. Key
advantage over mean filter: 'Median filter removes salt-and-pepper noise WITHOUT
blurring edges, unlike the mean filter.' Always write this comparison.
9.4 Image Operations Summary
Operation Type Description & Formula
Image Addition g(x,y) = f₁(x,y) + f₂(x,y). Used for: averaging multiple images
to reduce noise.
Image Subtraction g(x,y) = f₁(x,y) − f₂(x,y). Used for: detecting differences,
motion detection, background subtraction.
Image Multiplication g(x,y) = f(x,y) × h(x,y). Used for: masking regions of interest
(applying masks).
Image Division g(x,y) = f(x,y) / h(x,y). Used for: correcting shading artifacts,
image ratio analysis.
AND Operation g(x,y) = f₁(x,y) AND f₂(x,y). Used for: masking, extracting ROI
from binary images.
OR Operation g(x,y) = f₁(x,y) OR f₂(x,y). Used for: combining two binary
images.
NOT Operation g(x,y) = NOT f(x,y). Used for: creating negative image
(complement).
XOR Operation g(x,y) = f₁(x,y) XOR f₂(x,y). Used for: detecting differences
between two binary images.
Image Averaging — Classic Application of Linear Operations
Problem: A single image has random noise. Solution: Take K images of the same scene
and average them. g̅ (x,y) = (1/K) Σ gᵢ(x,y) Result: As K increases, noise is reduced. For
K→∞, the averaged image approaches the noise-free original. This works because:
E[η(x,y)] = 0 (noise has zero mean), and variance reduces by factor K. This is a linear
operation and a standard IPU exam question.
QUICK REVISION SUMMARY — DIP Unit 1
Topic Key Formula / Author One-Line Summary
Digital Image Gonzalez & Woods f(x,y) where x,y are spatial
coords; f = intensity. All discrete.
First DIP application NASA/JPL (1960s) Processing moon images from
Ranger 7 spacecraft
Bartlane System 1920s First digital transmission of
newspaper images via cable
Fundamental Steps 11-step pipeline Acquisition→Enhancement→Re
storation→Segmentation→Reco
gnition
Enhancement vs — Enhancement=subjective;
Restoration Restoration=model-based/object
ive
DIP System 8 components Sensor, Storage(3 types),
Components Processing HW, CPU, Software,
Display
Sampling Nyquist Theorem Digitizes spatial coords; rate ≥
2×f_max to avoid aliasing
Quantization L = 2^k Digitizes intensity values; k bits
= 2^k gray levels
Storage Formula M×N×k bits For M×N image with k bits per
pixel
False Contouring < 4 bits Artifact from too few gray levels
— looks like false edges
4-Neighbours N₄ N₄(p) Top, Bottom, Left, Right — 4
pixels only
8-Neighbours N₈ N₄ ∪ N_D All 8 surrounding pixels
including diagonals
m-Connectivity Most important Diagonal only if no common 4-
neighbour — eliminates
ambiguity
Euclidean Distance √[(x-s)²+(y-t)²] Straight line; circular
neighbourhood
City Block D₄ |x-s|+|y-t| Diamond neighbourhood;
related to 4-connectivity
Chessboard D₈ max(|x-s|,|y-t|) Square neighbourhood; related
to 8-connectivity
Distance Relation D₈ ≤ D_e ≤ D₄ Chessboard ≤ Euclidean ≤ City
Block — always
Linear Operation H[af+bg]=aH[f]+bH[g] Satisfies superposition:
convolution, mean filter, Fourier
Non-Linear Operation Fails superposition Median filter, morphology,
gamma correction, thresholding
Median Filter Non-linear Best for salt-and-pepper noise;
preserves edges unlike mean
filter
Image Averaging (1/K)Σgᵢ(x,y) Linear; reduces noise by factor
K as K increases
TOP 7 Most Asked IPU Questions — DIP Unit 1
1. Explain the fundamental steps in Digital Image Processing with a block diagram. 2. What
is Sampling and Quantization? Explain with formulas. Derive storage formula. 3. Define 4-
connectivity, 8-connectivity, and m-connectivity. Why is m-connectivity preferred? 4. Explain
the three distance measures (Euclidean, City Block, Chessboard) with examples and
numerical. 5. Differentiate between Linear and Non-Linear operations. Give examples of
each. 6. Explain the elements of a Digital Image Processing System with a block diagram.
7. List and explain 5 fields where DIP is used with examples. NUMERICAL GUARANTEE:
At least one problem on: (a) Storage calculation, (b) Distance measures.