Dsp
Dsp
Image Enhancement in
Spatial Domain
What is Image Enhancement?
▪ Image Negative
▪ Thresholding
▪ Clipping
▪ Intensity Level Slicing Without Background
▪ Intensity Level Slicing With Background
▪ Bit Plane Slicing
▪ Contrast Stretching
▪ Log Transformation
Point Processing Transformations/ Zero
Memory Operations
▪ Image Negative
In general,
s=(L−1)−r
Example Applications
• - Useful in display of medical images
• - Can be used in producing negative prints of an
image
Point Processing Transformations/ Zero
Memory Operations
▪ Image Negative
Point Processing Transformations/ Zero
Memory Operations
▪ Thresholding
▪ Thresholding transformations are particularly useful for
segmentation in which we want to isolate an object of
interest from a background
Point Processing Transformations/ Zero
Memory Operations
▪ Thresholding
Point Processing Transformations/ Zero
Memory Operations
▪ Thresholding
Point Processing Transformations/ Zero
Memory Operations
▪ Clipping ( Grey Level Slicing Without Background)
▪ Useful in highlighting features in an image
Point Processing Transformations/ Zero
Memory Operations
▪ Clipping ( Grey Level Slicing Without Background)
Point Processing Transformations/ Zero
Memory Operations
▪ Grey Level Slicing With Background
▪ Useful in highlighting features in an image while retaining
the background
Point Processing Transformations/ Zero
Memory Operations
▪ Grey Level Slicing
▪ Example
Point Processing Transformations/ Zero
Memory Operations
▪ Bit Plane Slicing
▪ Often by isolating particular bits of the pixel values in an
image we can highlight interesting aspects of that image
▪ Higher-order bits usually contain most of the significant
visual information
▪ Lower-order bits contain subtle details
Point Processing Transformations/ Zero
Memory Operations
▪ Bit Plane Slicing
▪ Example
Point Processing Transformations/ Zero
Memory Operations
▪ Bit Plane Slicing
▪ Example
Point Processing Transformations/ Zero
Memory Operations
▪ Contrast Stretching ( Piecewise Linear
Transformation)
▪ Can be used to add contrast to a poor quality image
Point Processing Transformations/ Zero
Memory Operations
▪ Contrast Stretching ( Piecewise Linear Transformation)
Point Processing Transformations/ Zero
Memory Operations
▪ Contrast Stretching ( Piecewise Linear Transformation)
Point Processing Transformations/ Zero
Memory Operations
▪ Contrast Stretching ( Piecewise Linear Transformation)
Point Processing Transformations/ Zero
Memory Operations
▪ Contrast Stretching ( Piecewise Linear Transformation)
Point Processing Transformations/ Zero
Memory Operations
▪ Log Transformation( Dynamic Range Compression)
▪ Log functions are particularly useful when the input grey level values
may have an extremely large range of values
▪ s = c log(r + 1)
▪ Example
Neighbourhood Processing
▪ Smoothening Filters
▪ Median Filters
▪ Instead of simply replacing the pixel value with the mean of neighbouring
pixel values, it replaces it with the median of those values.
▪ The median is calculated by first sorting all the pixel values from the
surrounding neighbourhood into numerical order and then replacing the
pixel being considered with the middle pixel value.
▪ Advantages of median filter over averaging filter
▪ The median is a more robust average than the mean and so a single very
unrepresentative pixel in a neighbourhood will not affect the median value
significantly.
▪ Since the median value must actually be the value of one of the pixels in
the neighbourhood, the median filter does not create new unrealistic pixel
values when the filter straddles an edge. For this reason the median filter is
much better at preserving sharp edges than the mean filter.
Neighbourhood Processing
▪ Median Filters
Neighbourhood Processing
▪ Sharpening Filters
▪ High Pass Filter
▪ A high pass filter tends to retain the high frequency information within an image while
reducing the low frequency information.
▪ The kernel of the high pass filter is designed to increase the brightness of the centre pixel
relative to neighbouring pixels.
▪ The kernel array usually contains a single positive value at its centre, which is completely
surrounded by negative values.
▪ The following array is an example of a 3 by 3 kernel for a high pass filter:
Neighbourhood Processing
▪ Sharpening Filters
▪ High Pass Filter
Chapter 6
Image Segmentation
The Segmentation Problem
•Segmentation attempts to partition the pixels of
an image into groups that strongly correlate with
the objects in an image
•Typically the first step in any automated
computer vision application
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Segmentation Examples
Image Segmentation
Discontinuity Based Approach
•There are three basic types of grey level
discontinuities that we tend to look for in digital
images:
– Points
– Lines
– Edges
•We typically find discontinuities using masks
and correlation
Point Detection
Point detection can be achieved simply using the
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
mask below:
lines
•The masks below will extract lines that are one
pixel thick and running in a particular direction
Line Detection (cont…)
Binary image of a wire bond
mask
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
After
Result of
processing with
thresholding
-45° line
filtering result
detector
Edge Detection
•An edge is a set of connected pixels that lie on
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
• Edge-Based Segmentation
• Region-Based Segmentation
• Thresholding Segmentation
• Watershed Segmentation
Edge Based Segmentation
•Given a 3*3 region of an image the following
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Operator)
Laplacian Edge Detection ( 2nd Derivative
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
•Variations of Laplacians
•Highest Between Class- Variance is found for Gray Level 3. Therefore, Set Threshold=3
Otsu’s Method Solved Example
•Step 5- Set all pixel values < Threshold to 0 and all pixel values >= Threshold to
1.
Practice Question
Variable Thresholding Using Moving
Averages
•Thresholding based on moving averages works well when the objects are small
with respect to the image size
• Quite useful in document processing
•The scanning (moving) typically is carried out line by line in zigzag pattern to
reduce illumination bias
Variable Thresholding Using Moving
Averages
Variable Thresholding Using Moving
Averages