SlideShare a Scribd company logo
CSC447: Digital Image
Processing
Chapter 3: Image Enhancement in the
Spatial Domain
Prof. Dr. Mostafa Gadal-Haqq M. Mostafa
Computer Science Department
Faculty of Computer & Information Sciences
AIN SHAMS UNIVERSITY
Pixel (Point) Operations
 The intensity transformation operations
always obey the equation:
s = T( r )
 r: the input pixel intensity
 s: the output pixel intensity
 T: the operation
 For example:
 Image Thresholding
2CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Some Point Transforms
 Image Binarisation
 Converting image to Black & White
 Image Thresholding
 S = ?
3CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Some Point Transforms
 Image Negatives
s = L - 1 - r
4CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Some Point Transforms
 Power-Law Transformations
s = c r
5CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Some Point Transforms
 Gamma Correction
s = c r
6CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Some Point Transforms
 Gamma Correction
s = c r
7CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Some Point Transforms
 Power-Law Transformations
8CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Some Point Transforms
 Piecewise-Linear Transformation Functions
9CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Some Point Transforms
 Transformation Functions for Intensity Range
10CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Some Point Transforms
 Transformation Functions for Intensity Range
11CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Contrast Stretching
 Contrast Stretching:
Contrast stretching is another way to
enhance the image contrast by stretching the
gray levels in the image over the dynamic
range of the gray scale.
12CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Contrast Stretching
1. Contrast stretching.
or
13CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Contrast Stretching
1. Contrast stretching.
14CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Histogram-based Operations
 What is image histogram?
 The histogram of an image or a region, h(r ) is a
function whose domain is the gray levels and its
codomain is the frequency of occurrence of those
gray levels in the image or the region.
 The histogram is computed by counting the
number of times that each brightness (gray level)
occurs in the image or the region.
 That is: h(r ) = nr = no. of pixels with intensity g
 The normalized histogram is h(r ) = nr /n; where
n is the total number of pixels in the image
15CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Histogram-based Operations
 Examples of image histograms:
16CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Histogram-based Operations
 Examples of image histograms:
17CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Histogram-based Operations
 Examples of image
histograms:
18CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Histogram-based Operations
1. Histogram Equalization:
Histogram equalization is a way to enhance
the image contrast by extending the image
intensity over the full dynamic range of the
gray scale.
19CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Histogram-based Operations
1. (Continuous) Histogram Equalization.
20CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Histogram-based Operations
1. (Discrete) Histogram Equalization.


r
g
gh
n
rPs
0
)(
1
)255()(
s
r
21CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Histogram-based Operations
1. Histogram Equalization.
22CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Histogram-based Operations
1. Local Histogram Equalization.
23CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Histogram-based Operations
1. Local Histogram Equalization.
24CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Histogram-based Operations
1. Histogram Equalization.
25CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Histogram-based Operations
 Histogram equalization (Matlab)
26CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Histogram-based Operations
Original Histogram Equalization Contrast stretching
27CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Arithmetic/Logic Operations
Logical Operators
28CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Arithmetic/Logic Operations
Image Averaging
 Consider a noisy image g(x, y) formed by the addition
of noise (x, y) to an original image f(x, y); That is:
 If the noise is uncorrelated, we can remove the noise
by averaging K noisy images
where
29CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Arithmetic/Logic Operations
Image Averaging
 where E{g(x, y)} is the expected value
of g(x, y) at coordinates (x, y).
 The standard deviation at any
point in the average image is
 As K increase the variability
(noise) in the pixel value decrease
30CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Arithmetic/Logic Operations
Image Averaging
 where E{g(x, y)} is the expected
value of g(x, y) at coordinates (x, y).
 The standard deviation at any
point in the average image is
31CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Local Operations
Convolution and
Image Filtering
32CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Spatial Filtering: Foundations
 Linear Filtering:
Using convolution
Filter, mask, filter
Mask, kernel, window
a=(m-1)/2 and b=(n-1)/2
33CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Spatial Filtering : Smoothing
 Smoothing/Average Filtering:
Also called lowpass filter
Weighted averageAverage
34CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Spatial Filtering: Smoothing
 Smoothing/Average
Filtering:
35CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Spatial Filtering: Smoothing
 Smoothing/Average Filtering:
36CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Spatial Filtering: Median
 Order-Statistics Filtering:
 Median (Nonlinear) filter
37CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Spatial Filtering: Sharpening
 Foundation: Image Derivative
38CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Spatial Filtering: Sharpening
 Foundation: Image Derivative
39CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Spatial Filtering: Sharpening
 Sharpening using the Laplacian filter
40CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Spatial Filtering: Sharpening
 The Laplacian Mask
41CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Spatial Filtering: Sharpening
 Sharpening Using The Laplacian Filters
42CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Spatial Filtering: Sharpening
 Sharpening Using The Laplacian Filters
43CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Spatial Filtering: Sharpening
 Unsharp Masking
 High Boost Filters
Blurred Image
44CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Spatial Filtering: Sharpening
 High-Boost Filters
45CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Spatial Filtering: Sharpening
 High-Boost Filters
46CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Spatial Filtering: Sharpening
 High-Boost Filters
47CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Spatial Filtering: Edge Detection
 Robert & Sobel Filters
48CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
Spatial Filtering: Edge Detection
 Robert & Sobel Filters
49CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.
HW2
 3.2, 3.4, 3.7, 3.8, and 3.17
50CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq.

More Related Content

PPT
Spatial filtering
PDF
digital image processing, image processing
PDF
Digital image processing - OLD
PPT
Spatial filtering using image processing
PPTX
Image Restoration (Order Statistics Filters)
PPTX
Canny Edge Detection
PDF
Image restoration
PPT
05 histogram processing DIP
Spatial filtering
digital image processing, image processing
Digital image processing - OLD
Spatial filtering using image processing
Image Restoration (Order Statistics Filters)
Canny Edge Detection
Image restoration
05 histogram processing DIP

What's hot (20)

PPT
Spatial domain and filtering
PPT
ImageProcessing10-Segmentation(Thresholding) (1).ppt
PPTX
Image transforms
PDF
Image Segmentation
PPTX
Chapter 3 image enhancement (spatial domain)
PPT
6.frequency domain image_processing
PPTX
Chapter 1 and 2 gonzalez and woods
PDF
Introduction of image processing
PPTX
Image Sampling and Quantization.pptx
PPT
Image segmentation
PPTX
Intensity Transformation
PPTX
Image denoising
PPT
Image enhancement
PDF
Image processing, Noise, Noise Removal filters
PPT
Image trnsformations
PPTX
Texture,pattern and pattern classes
PPTX
Lecture 1 for Digital Image Processing (2nd Edition)
PPTX
Image processing second unit Notes
PPTX
Unit3 dip
Spatial domain and filtering
ImageProcessing10-Segmentation(Thresholding) (1).ppt
Image transforms
Image Segmentation
Chapter 3 image enhancement (spatial domain)
6.frequency domain image_processing
Chapter 1 and 2 gonzalez and woods
Introduction of image processing
Image Sampling and Quantization.pptx
Image segmentation
Intensity Transformation
Image denoising
Image enhancement
Image processing, Noise, Noise Removal filters
Image trnsformations
Texture,pattern and pattern classes
Lecture 1 for Digital Image Processing (2nd Edition)
Image processing second unit Notes
Unit3 dip
Ad

Similar to Digital Image Processing: Image Enhancement in the Spatial Domain (20)

PDF
Digital Image Processing: Digital Image Fundamentals
PDF
SpatialEnhancement of course CE7491 of NTU
PDF
Image enhancement
PDF
Image Enhancement
PPTX
Digital image processing
PPTX
Image enhancement
PPT
3958594.ppt
PPTX
Digital image processing Tool presentation
PPTX
Introduction to Image Processing
PPT
IMAGE PROCESSING-----image enhancing.ppt
PPTX
IMAGE ENHANCEMENT IN THE SPATIAL DOMAIN.pptx
PPTX
computer vision and pattern recognition.pptx
PDF
Digital Image Processing: Image Restoration
PDF
Digital Image Processing: Image Enhancement in the Frequency Domain
PPT
Digital Image Processing UNIT-2.ppt
PPT
Digital Image through Scanner, Digital Camera. Concept of Gray Levels.
PPTX
3rd unit.pptx
PPT
3 intensity transformations and spatial filtering slides
PPTX
Image Enhancement in Spatial Domain
PPTX
Digital image processing techniques
Digital Image Processing: Digital Image Fundamentals
SpatialEnhancement of course CE7491 of NTU
Image enhancement
Image Enhancement
Digital image processing
Image enhancement
3958594.ppt
Digital image processing Tool presentation
Introduction to Image Processing
IMAGE PROCESSING-----image enhancing.ppt
IMAGE ENHANCEMENT IN THE SPATIAL DOMAIN.pptx
computer vision and pattern recognition.pptx
Digital Image Processing: Image Restoration
Digital Image Processing: Image Enhancement in the Frequency Domain
Digital Image Processing UNIT-2.ppt
Digital Image through Scanner, Digital Camera. Concept of Gray Levels.
3rd unit.pptx
3 intensity transformations and spatial filtering slides
Image Enhancement in Spatial Domain
Digital image processing techniques
Ad

More from Mostafa G. M. Mostafa (20)

PDF
Csc446: Pattern Recognition
PDF
CSC446: Pattern Recognition (LN8)
PDF
CSC446: Pattern Recognition (LN7)
PDF
CSC446: Pattern Recognition (LN6)
PDF
CSC446: Pattern Recognition (LN5)
PDF
CSC446: Pattern Recognition (LN4)
PDF
CSC446: Pattern Recognition (LN3)
PDF
Csc446: Pattren Recognition (LN2)
PDF
Csc446: Pattren Recognition
PDF
Csc446: Pattren Recognition (LN1)
PDF
Digital Image Processing: Image Segmentation
PDF
Digital Image Processing: An Introduction
PDF
Neural Networks: Introducton
PDF
Neural Networks: Least Mean Square (LSM) Algorithm
PDF
Neural Networks: Support Vector machines
PDF
Neural Networks: Rosenblatt's Perceptron
PDF
Neural Networks: Model Building Through Linear Regression
PDF
Neural Networks: Multilayer Perceptron
PDF
Neural Networks: Radial Bases Functions (RBF)
PDF
Neural Networks: Self-Organizing Maps (SOM)
Csc446: Pattern Recognition
CSC446: Pattern Recognition (LN8)
CSC446: Pattern Recognition (LN7)
CSC446: Pattern Recognition (LN6)
CSC446: Pattern Recognition (LN5)
CSC446: Pattern Recognition (LN4)
CSC446: Pattern Recognition (LN3)
Csc446: Pattren Recognition (LN2)
Csc446: Pattren Recognition
Csc446: Pattren Recognition (LN1)
Digital Image Processing: Image Segmentation
Digital Image Processing: An Introduction
Neural Networks: Introducton
Neural Networks: Least Mean Square (LSM) Algorithm
Neural Networks: Support Vector machines
Neural Networks: Rosenblatt's Perceptron
Neural Networks: Model Building Through Linear Regression
Neural Networks: Multilayer Perceptron
Neural Networks: Radial Bases Functions (RBF)
Neural Networks: Self-Organizing Maps (SOM)

Recently uploaded (20)

PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
Cell Structure & Organelles in detailed.
PDF
Classroom Observation Tools for Teachers
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Basic Mud Logging Guide for educational purpose
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
Lesson notes of climatology university.
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
master seminar digital applications in india
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
Cell Types and Its function , kingdom of life
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
Sports Quiz easy sports quiz sports quiz
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Cell Structure & Organelles in detailed.
Classroom Observation Tools for Teachers
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Basic Mud Logging Guide for educational purpose
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Lesson notes of climatology university.
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
102 student loan defaulters named and shamed – Is someone you know on the list?
O5-L3 Freight Transport Ops (International) V1.pdf
master seminar digital applications in india
Abdominal Access Techniques with Prof. Dr. R K Mishra
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Cell Types and Its function , kingdom of life
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Anesthesia in Laparoscopic Surgery in India
Sports Quiz easy sports quiz sports quiz
human mycosis Human fungal infections are called human mycosis..pptx
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Chapter 2 Heredity, Prenatal Development, and Birth.pdf

Digital Image Processing: Image Enhancement in the Spatial Domain