Ch03 Enhancement 3
Ch03 Enhancement 3
Image enhancement
Principle Objective of Enhancement
● Process an image so that the result will be more suitable than the original image for a specific
application.
● A method which is quite useful for enhancing an image may not necessarily be the best
approach for enhancing another images
● Frequency Domain :
Techniques are based on modifying the Fourier transform of an image.
Spatial Domain
where
- f(x,y)f(x,y) is the input image
- g(x,y)g(x,y) is the processed
image
- T is an operator on f defined over
some neighborhood of (x,y)(x,y)
Spatial Domain
● Neighborhood of a point (x,y) can be defined by
using a square/rectangular (common used) or
circular subimage area centered at (x,y)
● The center of the sub-image is moved from
pixel to pixel starting at the top of the corner
Point Processing
● Neighborhood = 1x1 pixel
● g depends on only the value of f at (x,y)
● T = gray level (or intensity or mapping) transformation function
○ s = T(r)
● Where
○ r = gray level of f(x,y)
○ s = gray level of g(x,y)
Contrast Stretching
● Produce higher contrast than the
original by:
background
Another Examplr
Piecewise-Linear Transformation Functions
● Advantage:
○ Allow more control on the complexity of T(r).
● Disadvantage:
○ Their specification requires considerably more user input
● Contrast stretching.
● Gray-level slicing.
● Bit-plane slicing.
Contrast Stretching
Gray-level slicing
Gray-level slicing
Bit-plane slicing
❏ Highlighting the contribution
made to total image
appearance by specific bits
❏ Suppose each pixel is
represented by 8 bits
❏ Higher-order bits contain
the majority of the visually
significant data
❏ Useful for analyzing the
relative importance played
by each bit of the image
Bit-plane slicing
● The (binary) image for bit-plane 7 can be
obtained by processing the input image with
a thresholding gray-level transformation.
segmentation
3. For each gray level k, scale the sum by (max gray level)/(number of pixels).
5. Replace each gray level k in the input image by the corresponding level
obtained in 4.
Histogram Equalization Implementation
Histogram Equalization Implementation
Color Image Histograms
Two types:
1. Intensity histogram:
● histograms (R,G,B)
Enhancement using Arithmetic/Logic Operations
● Arithmetic/Logic operations are performed on pixel by pixel basis between two
or more images
● except NOT operation which perform only on a single image
● Logic operation is performed on gray level images, the pixel values are
processed as binary numbers
● NOT operation = negative transformation
Example of AND Operation
Example of OR Operation
Image Subtraction
A A
g(x,y) = f(x,y) – h(x,y)
● enhancement of the differences between
images
● Image similarity
● We may have to adjust the grayscale of the
subtracted image to be [0, 255] (if 8-bit is used)
● Subtraction is also used in segmentation of
moving pictures to track the changes.
● after subtract the sequenced images, what is left
should be the moving elements in the image,
plus noise
●
Histogram
A-B Equalization of A-B
Image Averaging
Consider a noisy image modeled as:
g(x,y) = f(x,y) + η(x,y)
Where f(x,y) is the original image, and η(x,y) is a noise process
Objective: to reduce the noise content by averaging a set of noisy images
Define an image formed by averaging K different noisy images:
● sharp transitions
○ random noise in the image
○ edges of objects in the image
● thus, smoothing can reduce noises (desirable) and blur edges (may be
undesirable)
Smoothing Spatial Filters
Smoothing Spatial Filters: Example
Order-Statistics Filters (Nonlinear Filters)
❏ Nonlinear spatial filters whose response is based on ordering (ranking) the pixels
contained in the filter mask and then replacing the value of the center pixel with the
result of the ranking operation
example
Nonlinear filters
Linear filters
Order-Statistics Filters (Nonlinear Filters)
Sharpening Spatial Filters
❏ to highlight fine detail in an image
❏ or to enhance detail that has been blurred - either in error or as an effect of a method of
image acquisition.
❏ the sharpening must be accomplished by spatial spatial differentiation.
❏ In contrast to averaging which is similar to integration
Sharpening Spatial Filters
❏ First-order derivative (1D)
❏ a basic definition of the first-order derivative of a one-dimensional function f(x) is
the difference
❏ easily by adding the original and Laplacian image. be careful with the Laplacian filter
used
Example
a). image of the North pole of the moon
if we use Laplacian filter to create sharpen image fs(x,y) with addition of original image
High-boost Masks
A≥1
commonly approx:
Gradient Mask
❏ Sobel operators, 3x3
❏ An approximation using absolute values
❏ the weight value 2 is to achieve smoothing by giving more important to the center point
the summation of coefficients in all masks equals 0, indicating that they would give a
response of 0 in an area of constant gray level.
Example
Example of Combining Spatial Enhancement Methods
❏ want to sharpen the original
image and bring out more
skeletal detail.