Digital Image Processing Overview
Digital Image Processing Overview
CSE)
1. Introduction
Digital Image Processing (DIP) is the use of computer algorithms to process images
as digital (discrete) data. An image is formally a two-dimensional function f(x,y)
giving intensity at spatial location (x,y). When x, y and f are all finite and discrete, the
image is digital [Link] . Each elemental picture unit (pixel) has a unique
location and intensity value [Link] . DIP originated in the 1960s (e.g. NASA’s
lunar imagery) to enhance and analyze images by computer [Link] [Link] .
Unlike analog processing, DIP can apply many sophisticated algorithms and avoid
cumulative noise [Link] .
These elements cover the imaging pipeline from capture through processing to final
display [Link] .
Image Acquisition: Capture analog signals (light, X-ray, etc.) and digitize via
sampling and quantization.
Enhancement & Restoration: Improve image appearance (contrast, sharpness)
and correct degradations (blur, noise).
Early stages (“low-level processing”) take an image in and produce another image;
later stages (“high-level”) extract information or semantics [Link] [Link] .
For example, enhancement and restoration improve visual quality, while segmentation
and recognition enable object detection. As one survey notes, “Image enhancement
improves visual quality (e.g. noise removal via filtering); image restoration uses
knowledge of degradation to undo blur/noise” [Link] [Link] .
In the real world, an image represents light intensity. A common model separates
illumination (amount of incident light i(x,y)) and reflectance (fraction reflected r(x,y)),
so that the observed intensity is
′ ′
x = x + tx ,
y = y + ty ,
often written as
′
x 1 0 tx
x
′
y
= 0
1
ty
y
.
1 0 0 1 1
In translation, all
points shift by the same offset (tx , ty ).
′ ′
x = Sx x,
y = Sy y,
Sx 0
implemented by the matrix ( . For example, multiplying coordinates by 2
)
0 Sy
doubles the object’s dimensions [Link] . Rotation by an angle θ about the origin
maps
′ ′
x = x cos θ − y sin θ, y = x sin θ + y cos θ,
cos θ − sin θ
corresponding to the rotation matrix (
)
[Link] . Below are
sin θ cos θ
contracting in the other). The image is multiplied by the diagonal matrix diag(Sx , Sy )
[Link] .
Fig: Rotation of point P (x, y) by angle θ about the origin. The coordinates transform by
= x cos θ − y sin θ , y .
′ ′
x = x sin θ + y cos θ [Link]
X Y
x = f
, y = f
,
Z Z
[Link] . Non-uniform quantizers (μ-law, A-law) are used in some systems (audio,
telephony) to give higher precision near low amplitudes. Uniform quantization is
simple and optimal for signals with high SNR, whereas non-uniform quantization can
reduce error for signals with non-uniform amplitude distributions [Link] .
3. Mathematical Preliminaries
In a digital image, each pixel has adjacent neighbors. For a pixel p = (x, y) , the 4-
neighbors (N4 (p)) are the pixels that share an edge with p: (x
± 1, y) or (x, y ± 1)
[Link] . The 8-neighbors (N8 (p)) include the 4-neighbors plus the 4 diagonal
Common distance metrics between pixel coordinates (x1 , y1 ) and (x2 , y2 ) include:
Euclidean distance: DE
= (x1 − x2 )
2
+ (y1 − y2 )
2
.
= ∣x1 − x2 ∣ + ∣y1 − y2 ∣
.
Chessboard (Chebyshev) distance: D∞
= max(∣x1 − x2 ∣, ∣y1 − y2 ∣)
.
M −1 N −1
um vn
−j 2π(
+
)
F (u, v) = ∑ ∑ f (m, n) e
M N
.
m=0 n=0
Key properties of the 2D DFT include linearity, convolution, shift, and periodicity
[Link] [Link] :
the DFT:
um0 vn0
.
+
)] [Link]
M N
Rotation: Rotating an image by angle α rotates its spectrum by the same angle
[Link] .
The Discrete Cosine Transform (DCT) is a closely related transform that uses only
real cosine basis functions. The 2D DCT of an image expresses it as a sum of cosine
waves of varying frequency and amplitude. Because it concentrates most signal
energy into a few coefficients, the DCT is widely used in image compression (e.g.
JPEG) [Link] . In fact, “the DCT… is widely used in most digital media, including
digital images (such as JPEG) and video” [Link] . Analytically, the DCT of an
M × N image can be defined via a cosine transform along each dimension (we omit
the formula here for brevity).
The Discrete Sine Transform (DST) similarly uses sine basis functions and is also a
Fourier-related transform. Like the DCT, a DST represents an image as a weighted
sum of sinusoids, but with odd symmetry. In practice, DSTs are less common than
DCTs, but they arise in certain boundary-processing contexts. In essence, both DCT
and DST are variants of the DFT that operate on purely real data with symmetric
(DCT) or antisymmetric (DST) extension of the image edges [Link] [Link] .
4. Image Enhancement
g(x, y) =
Imax − Imin
to utilize the full range [0, L − 1]. This increases global contrast if the image
uses only a narrow portion of the available gray levels.
i
intensities i. Define the cumulative distribution T (i) = ∑
k=0
pf (k)
. The
equalized output is
This mapping flattens the histogram so intensities span the full range. As
Wikipedia notes, histogram equalization increases the global contrast especially
when the original image has intensities concentrated in a narrow range
[Link] . The result tends to brighten mid-tones and reveal detail in under- or
over-exposed regions. A drawback is it may boost noise, but it is very effective
for scientific images (e.g. X-rays) [Link] [Link] .
Image averaging: If multiple noisy frames of the same scene are available,
averaging them pixel-wise reduces random noise (by N
factor).
Mean filter (box filter): Replace each pixel by the average of itself and its
neighbors in a window (e.g. 3×3 or 5×5). This is a simple linear low-pass filter
that blurs the image [Link] .
∑
(s,t)∈W
f (x + s, y + t)h(s, t) where h is the mask (e.g. all 1’s for mean,
Gaussian weights, etc.). As GeeksforGeeks notes: “Low pass filter smoothens the
image by averaging the pixel of neighbouring value, thus minimizing random noise”
[Link] . Such filters achieve spatial domain smoothing directly.
High-pass filters: Convolve with a mask that has a strong positive center and
negative neighbors (e.g. Laplacian). This highlights areas of rapid intensity
change (edges). For instance, the discrete Laplacian operator
2
∇ f = f (x + 1, y) + f (x − 1, y) + f (x, y + 1) + f (x, y − 1) − 4f (x, y)
1 this reduces to the Laplacian. Larger k keeps more of the original detail. This
can be seen as adding back high-frequency content.
Thus, spatial and frequency methods are dual: averaging in space corresponds to
attenuating high-frequency components in the spectrum. Edge-detecting or high-
boost filters correspond to high-pass filters in frequency. Both domains provide a rich
toolbox: some enhancements (like homomorphic) combine both by log-transforming
(nonlinear) then filtering.
5. Image Restoration
where f (x, y) is the original image, h(x, y) is the point spread function (PSF) of blur
(e.g. motion blur, defocus), and n(x, y) is additive noise. In the discrete Fourier
domain, this becomes
Unconstrained inverse filtering: If H (u, v) is known and non-zero, one can form
the inverse filter F (u, v) = G(u, v)/H (u, v) . Inverse filtering is optimal with
no noise, but in practice noise or small values of H (where ∣H ∣ ≈ 0 ) amplify
errors.
Wiener filtering (minimum MSE): Incorporates a statistical model of noise vs.
signal. The Wiener filter in frequency domain is
∗
H (u, v)
^
F (u, v ) =
G(u, v),
2 Sn (u,v)
∣H (u, v)∣ +
Sf (u,v)
Point detection: Identifies isolated points or noise (outliers). For example, the
Laplacian of an image will be large only at isolated bright or dark pixels. A simple
3 × 3 mask that responds strongly to a single bright pixel can act as a point
detector.
Line detection: Uses oriented masks (e.g. horizontal, vertical, 45°) to detect line
segments of different orientations. These are small convolution kernels that
respond to straight lines (length ≥ 3) in specific directions.
and ∂y
highlights
Edge detectors are typically applied to the image and then thresholded to produce a
binary edge map. Combined detection (using multiple filters) can detect joined
features (e.g. corner detectors like Harris combine gradients).
One powerful global method is the Hough Transform, which detects shapes (lines,
circles) by mapping points into a parameter space. For straight lines, each edge point
(x, y) votes in (ρ, θ)-space via the line equation ρ = x cos θ + y sin θ . Peaks in
this accumulator indicate dominant lines, effectively linking colinear edge points
[Link] . (For circles, one uses a 3D parameter space (a, b, r).) The Hough
transform thus performs boundary detection by solving a global voting problem
rather than local neighbor linking.
6.3 Thresholding
1, f (x, y) > T ,
g(x, y) = {
0, f (x, y) ≤ T ,
for chosen T . (Or vice versa, depending on convention [Link] .) This segments
the image into two classes. In practice, one often normalizes intensities first.
Adaptive thresholding allows T to vary over the image (local windows) to account for
uneven lighting.
Split-and-merge: The image is recursively split (e.g. into quadrants) until each
region meets a homogeneity criterion (e.g. intensity variance below a threshold).
Then adjacent similar regions are merged. Wikipedia describes this as splitting
into quadrants and then merging adjacent homogeneous quadrants [Link] .
The result is a segmentation where each final region satisfies the homogeneity
condition.
These methods ensure that segmented regions are internally consistent. Split-and-
merge explicitly uses a quadtree structure and a predefined test (mean or variance) to
decide when to stop splitting [Link] . Region growing is simpler for smooth
images but can suffer from seed selection sensitivity.
Key formulas used: In segmentation, the binary thresholding rule is a basic formula
[Link] . Histogram equalization mapping T (i) uses the cumulative histogram
to spread intensities (see Section 4.1.3) [Link] [Link] . Geometric
transforms (Section 2.2) are given by linear matrix equations. The 2D DFT
(Section 3.4) is the double sum above [Link] . These formulas form the core
mathematical tools for DIP.
Sources: The above notes draw on standard DIP texts and references. Fundamental
concepts and definitions are cited from authoritative sources [Link]
Citations
[Link]
[Link]
[Link]
No Slide Title
[Link]
All Sources