Image Digitization
Image digitization is the process of converting a continuous image function f(x,y), which is
defined on a plane, into a digital form suitable for computer processing. This process
consists of two key steps: sampling and quantization. Let’s explore these in detail :
1. Sampling
Sampling in image processing refers to converting a continuous image f(x,y) into a
discrete representation by measuring its intensity at specific points on a grid. This is a
fundamental step in digitizing images, where both spatial dimensions (x and y) are
divided into a grid of discrete points.
Sampling Grid
The continuous image f(x,y) is divided into a grid of M×N points.
Each point corresponds to a pixel in the digital image.
The grid forms a matrix where each element represents the intensity value of the
image at that point.
Sampling Interval
The distance between neighboring sampling points along the x-axis (Δx) and y-axis
(Δy) is called the sampling period.
Smaller Δx and Δy mean closer sampling points, while larger intervals mean more
spaced-out points.
These intervals define the spatial resolution of the digital image:
o Higher Resolution: Smaller sampling intervals (more pixels per unit area).
o Lower Resolution: Larger sampling intervals (fewer pixels per unit area).
Effect of Sampling Rate
The sampling rate (frequency) determines how accurately the discrete grid represents the
continuous image:
Finer Sampling (High Sampling Rate):
o Smaller Δx and Δy result in more sampling points.
o Captures finer details of the image, closely approximating the original
continuous function.
o Produces a higher-resolution image, but requires more storage and
computational resources.
Coarser Sampling (Low Sampling Rate):
o Larger Δx and Δy result in fewer sampling points.
o Loses fine details, as subtle variations between neighboring points are
ignored.
o Can lead to aliasing, where high-frequency details appear distorted or
misrepresented in the sampled image.
Shannon's Sampling Theorem
Shannon's Sampling Theorem provides a rule to ensure that a continuous image is
accurately converted into its digital form without losing essential details.
Shannon's theorem provides a guideline for choosing the sampling period:
Sampling periods Δx and Δy should satisfy
where U and V are the maximum frequency components in the image along the x-
and y-axes, respectively.
In simpler terms, the sampling rate must be at least twice the maximum frequency of
the image details (Nyquist rate).
Why Shannon's Theorem is Important:
To capture an image's details accurately and reconstruct it faithfully:
o The sampling rate must be at least twice the highest frequency in the image.
o Choosing finer sampling intervals (Δx,Δy,) helps avoid aliasing and ensures
high-quality digitization.
Consequences of Violating Shannon's Theorem
What happens if this condition is violated?
Aliasing:
o If Δx or Δy are too large,
The sampling rate becomes insufficient to capture the finer details of the
image.
High-frequency details in the image are misinterpreted as lower
frequencies, resulting in distortion.
Aliasing - Simplified Example
Imagine watching a spinning wheel (like a fan blade) under a camera with a low
frame rate: If the frame rate is too low, the wheel may appear to spin in the opposite
direction or move oddly. This visual distortion is an example of aliasing.
Geometric Arrangement of Sampling Points
The arrangement of sampling points determines how a continuous image is
converted into its digital form. The geometric structure of these points affects the
efficiency and quality of the sampled image.
What is a Sampling Grid?
A sampling grid is a structured layout of points where the continuous image intensity
values are measured.
These points can be arranged in different geometric patterns.
Types of Grids:
1. Square Grid:
o Sampling points are arranged in a regular grid pattern, forming squares.
o Advantages:
Most commonly used due to simplicity and ease of implementation in
digital systems.
Pixels in a square grid are easy to represent and process in a matrix
format.
o Disadvantage:
Can be less efficient in covering circular or curved features compared
to other arrangements.
2. Hexagonal Grid:
o Sampling points are arranged in a hexagonal pattern, resembling a
honeycomb.
o Advantages:
Provides a better approximation of circular features and uniform
coverage.
More efficient in sampling because each hexagonal pixel has six
neighbors, reducing redundancy.
o Disadvantage:
Complex implementation in digital systems, as it doesn’t align
naturally with standard rectangular matrix representations.
Pixels
What are Pixels?
Each sampling point corresponds to a pixel, the smallest unit of a digital image.
The pixel holds a value representing the intensity or color of the image at that point.
How Pixels Form an Image?
The collection of all pixels, arranged in the sampling grid, creates the discrete (digital)
image.
The total number of pixels determines the resolution:
o Higher number of pixels (dense grid): Higher resolution and more details.
o Lower number of pixels (sparse grid): Lower resolution and fewer details.
2. Quantization
Quantization is the process of converting the continuous brightness values of a sampled
image into a finite set of discrete levels. This step is necessary to represent the image
digitally but introduces some degree of approximation.
Key Points in Quantization
1. Assigning Brightness Values:
o Each sampled point f(jΔx,kΔy) has a continuous brightness value.
o This value is mapped to the nearest level within a predefined range of
quantization levels.
2. Quantization Levels (K):
o The continuous brightness range is divided into K discrete levels.
o For example, in an 8-bit grayscale image (K=256), the brightness values range
from 0 to 255.
3. Rounding to Nearest Level:
o Each brightness value is rounded to the closest quantization level.
o This rounding introduces some approximation, leading to a quantization
error.
Quantization Details
1. Quantization Error:
The error arises from the difference between the actual continuous brightness value
and the rounded quantized level.
Goal: Minimize this error to ensure the digital image closely resembles the original.
Excessive quantization error can cause visible artifacts, reducing image quality.
2. Number of Levels (K):
Increasing K (the number of quantization levels) improves image quality by capturing
finer brightness variations.
b
K is determined by the number of bits per pixel (b): K=2 Examples:
o b=1: 2 levels (binary image).
o b=8: 256 levels (standard grayscale image).
o b=24: Over 16 million levels (used for high-quality color images).
3. False Contours:
When K is too small (low quantization levels):
o Smooth transitions in brightness become abrupt, creating visible false
contours in the image.
o These contours are artificial lines where the brightness levels change
noticeably, especially in regions with gradual intensity changes (e.g., skies or
shadows).
Example: Grayscale Quantization
Consider a grayscale image:
o High K (256 levels): Gradual transitions between light and dark appear
smooth.
o Low K (16 levels): Brightness transitions become stepped, leading to false
contours.