Week 5 Image Enhacement (Sharpening Noise Updated)
Week 5 Image Enhacement (Sharpening Noise Updated)
WEEK 4
INTRODUCTION TO IMAGE ENHANCEMENT
(SHARPENING & NOISE REMOVAL)
1. Edge Detection:
The sharpening process typically involves identifying edges within the image.
Edges are areas where there's a significant change in color or brightness.
2. Contrast Enhancement:
Once the edges are identified, the contrast along these edges is increased.
The pixels on either side of an edge are adjusted to intensify the transition
between them. This makes the edges more distinct.
• Combined Effect:
– Often, contrast adjustment and sharpening are used together in image
processing workflows.
– Applying contrast adjustment first can improve the overall visibility of the
image,
– making subsequent sharpening more effective by enhancing the edges and
details that have become more distinguishable.
• Both contrast adjustment and sharpening play crucial roles in improving the visual
quality of images, and their combined use can significantly enhance the overall
appearance of an image.
Module Code & Module Title Slide Title SLIDE 10
4. Noise Reduction
• Noise can degrade the quality of an image, making it harder to extract useful
information or affect the visual appearance by adding unwanted artifacts.
• Normally if there is black dots in the image, we called it pepper noise and
• if there is white dots in the image, we called it salt noise.
• By isolated we mean that they have a value very different from their
neighbors.
• It is important because it can improve the visual quality and clarity of the
image and make it easier to analyze or process using computer algorithms.
• There are several techniques for reducing noise, including using filters such as
the median filter.
• One common method for removing noise from images using OpenCV and
Python is to use a median filter.
• The median filter works by replacing each pixel in the image with the
median value of a set of neighboring pixels.
• This can help to smooth out noise and reduce artifacts in the image.
1
Cont.
5 5 6
Example : Given the following 3×3 neighborhood (window ) : 3 4 5
3 4 7
• Sort the values in window (ascending order) (3,3,4,4,5,5,5,6,7)
• Then we select the middle value ,in this case it is 5. 5 5 6
• The middle value 5 is then placed in center location. 3 5 5
3 4 7
Module Code & Module Title Slide Title SLIDE 24
Median Filter Procedure
■ The window is overlaid on the upper left corner of the image, and the median value is
determined.
■ This value (median) is put into the output image (buffer) corresponding to the center location
of the window.
■ The window is then slide one pixel over, and the process is repeated
■ When the end of the row is reached, the window is slide back to the left side of the image
and down one row, and the process is repeated.
■ This process continues until the entire image has been processed.
1 4 0 1
Solution:
2 2 4 2
1. Overlade (3x3) window at the upper left corner of the input image :
1 0 1 0
2. Sort the pixels values (ascending order) : 0, 0, 1, 1, 1, 2, 2, 4, 4 1 2 1 0
1 4 0 1
Pixel value at 2 1 1 2
the center
1 1 1 0
location
1 2 1 0
Filtered Image
■ The minimum filter selects the smallest value within an ordered window of pixels values
and replaces the central pixel with the smallest value (darkest one) in the ordered
window .
Maximum filter
Minimum filter
Solution: 1 4 0 1
1. Overlade (3x3) window at the upper left corner of the input image : 2 2 4 2
• Adjusting parameters like radius, amount, and threshold allows for control over the
degree and type of sharpening applied to an image.