SlideShare a Scribd company logo
1 of 84
Download to read offline
Image Enhancement in the Spatial Domain
 The principal objective of enhancement is to
process an image so that the result is more
suitable than the original image for a specific
application.
Image enhancement approaches fall into two
broad categories:
- Spatial domain methods
- Frequency domain methods
The term spatial domain refers to the image
plane itself, and approaches in this category are
based on direct manipulation of pixel in an image.
Image Enhancement in the Spatial Domain
Frequency domain processing techniques are
based on modifying the Fourier transformation of
an image.
Background
• A mathematical representation of spatial
domain enhancement:
where f(x, y): the input image
g(x, y): the processed image
T: an operator on f, defined over some neighborhood of
(x, y)
In addition, T can operate on a set of input images, such as
performing the pixel-by-pixel sum of K image for noise
reduction, discussed later
)]
,
(
[
)
,
( y
x
f
T
y
x
g 
The principal approach in defining a neighborhood about a point
(x, y) is to use a square or rectangular subimage area centered at
(x, y)
)]
,
(
[
)
,
( y
x
f
T
y
x
g 
The operator T is applied at each location (x, y) to produce
The output g, at that location.
Background
Where, r and s are variables denoting the gray-level of f(x, y)
and g(x, y) at any point (x, y)
Gray-level Transformation
Image Enhancement in the Spatial Domain
Some Basic Gray Level Transformation
As an introduction to gray level transformations,
consider the following figure, which shows three
types of functions used for image enhancement:
 Linear ( negative and identity transformations)
Logarithmic (log and inverse-log
transformations)
 Power-law (nth root transformations)
Some Basic Gray Level Transformations
Image Enhancement in the Spatial Domain
Image Negatives
 Reversing the intensity levels of an image in
this manner produces the equivalent of a
photographic negative.
 An example is shown in the following figure.
Image Negatives
r
L
s 

 1
• Let the range of gray level be [0, L-1], then
Image Enhancement in the Spatial Domain
Image Negatives
 The original image is a digital mammogram
showing a small lesion.
 In spite of the fact that the visual content is the
same in both images, note how much easier it is to
analyze the breast tissue in this particular case.
Lab Problem: You are given an image make it a negative image.
Save the output image in BMP file.
Image Enhancement in the Spatial Domain
Log Transformations
 The shape of the log curve shows that this
transformation maps a narrow range of low gray-
level values in the input image into a wider range
of output levels.
 The opposite is true of higher values of input
levels.
 We would use a transformation of this type to
expand the values of dark pixels in an image while
compressing the higher-level values.
The opposite is true of the inverse log
transformation.
Log Transformations
)
1
log( r
c
s 

where c : constant
0

r
Lab Problem: You are given an image perform log transformation.
Save the output image in BMP file.
Image Enhancement in the Spatial Domain
Power-Law Transformation
 Plots of s versus r for various values of γ are
shown in the following figure -
Power-Law Transformation

cr
s 
where c, : positive constants

Image Enhancement in the Spatial Domain
Power-Law Transformation
 As in the case of the log transformation, power-
law curves with fractional values of γ map a
narrow range of dark input values into a wider
range of output values, with the opposite being
true for higher values of input levels.
Image Enhancement in the Spatial Domain
Power-Law Transformation
 A variety of devices used for capture, printing,
and display respond according to a power law.
 By convention, the exponent in the power-law
equation is referred to as gamma.
 The process used to correct this power-law
response phenomena is called gamma correction.
Image Enhancement in the Spatial Domain
Power-Law Transformation
 For example, CRT devices have an intensity-to-
voltage response that is a power function, with
exponents varying from approximately 1.8 to 2.5.
 with reference to the curve for γ = 2.5 in figure,
we see that such display systems would tend to
produce images that are darker than intended.
Power-Law Transformation
Example 1: Gamma Correction
4
.
0


Image Enhancement in the Spatial Domain
Power-Law Transformation
 In addition to gamma correction, power law
transformations are useful for general purpose
contrast manipulation.
 The following figure shows a magnetic
resonance (MR) image of an upper thoracic human
spine with a fracture dislocation and spinal
impingement.
Power-Law Transformation
Example 2: Gamma Correction
4
.
0

 3
.
0


6
.
0


1


Image Enhancement in the Spatial Domain
Power-Law Transformation
 An aerial image is a projected image which is
"floating in air", and cannot be viewed normally. It
can only be seen from one position in space.
Power-Law Transformation
Example 3: Gamma Correction
0
.
3


0
.
5


0
.
4


1


Lab Problem: You are given an image
perform power-law transformation. Save
the output image in BMP file.
Image Enhancement in the Spatial Domain
Piecewise-Linear Transformation Functions
Contrast Stretching
 One of the simplest piecewise linear functions
is a contrast-stretching transformation.
 The idea behind contrast stretching is to
increase the dynamic range of the gray levels in
the image being processed.
 The following figure shows a typical
transformation used for contrast stretching.
Piecewise-Linear Transformation Functions
Case 1: Contrast Stretching
Image Enhancement in the Spatial Domain
Piecewise-Linear Transformation Functions
Contrast Stretching
Image Enhancement in the Spatial Domain
Piecewise-Linear Transformation Functions
Contrast Stretching
Image Enhancement in the Spatial Domain
Piecewise-Linear Transformation Functions
Contrast Stretching
Image Enhancement in the Spatial Domain
Piecewise-Linear Transformation Functions
Contrast Stretching
Image Enhancement in the Spatial Domain
Piecewise-Linear Transformation Functions
Gray-level slicing
 Highlighting a specific range of gray levels in
an image often is desired.
 Applications include enhancing features such as
masses of water in satellite imagery and enhancing
flaws in X-ray images.
The following figure shows-
Piecewise-Linear Transformation Functions
Case 2:Gray-level Slicing
An image Result of using the transformation in (a)
Image Enhancement in the Spatial Domain
Piecewise-Linear Transformation Functions
Bit-plane slicing
 Instead of highlighting gray-level ranges,
highlighting the contribution made to total image
appearance by specific bits might be desired.

Piecewise-Linear Transformation Functions
Case 3:Bit-plane Slicing
• Bit-plane slicing:
– It can highlight the contribution made to total image appearance by
specific bits.
– Each pixel in an image represented by 8 bits.
– Image is composed of eight 1-bit planes, ranging from bit-plane 0 for
the least significant bit to bit plane 7 for the most significant bit.
Image Enhancement in the Spatial Domain
Piecewise-Linear Transformation Functions
Bit-plane slicing
 In terms of 8-bit bytes, plane 0 contains all the
lowest order bits in the bytes comprising the pixels
in the image and plane 7 contains all the higher-
order bits.
 The higher-order bits (especially the top four)
contain the majority of the visually significant
data. The other bit planes contribute to more subtle
details.
 The figure 3.14 shows the various bit planes for
the image shown in figure 3.13.
Piecewise-Linear Transformation Functions
Bit-plane Slicing: A Fractal Image
Piecewise-Linear Transformation Functions
Bit-plane Slicing: A Fractal Image
2
7 6
4
5 3
1 0
Image Enhancement in the Spatial Domain
Histogram Processing
Image Enhancement in the Spatial Domain
Histogram Processing
Image Enhancement in the Spatial Domain
Histogram Processing
 Histogram processing in image enhancement,
shown in figure 3.15.
 Four basic gray level characteristics: dark, light,
low contrast, and high contrast.
 The right side of the figure shows the
histograms corresponding to these images.
Histogram Processing
Histogram Processing
Histogram Processing
Lab Problem: Draw histogram for any given image.
Histogram Equalization
• Histogram equalization:
– To improve the contrast of an image
– To transform an image in such a way that the transformed image has a
nearly uniform distribution of pixel values
• Transformation:
– Assume r has been normalized to the interval [0,1], with r = 0
representing black and r = 1 representing white
– The transformation function satisfies the following conditions:
1
0
)
( 

 r
r
T
s
Histogram Equalization
• For example:
Histogram Equalization
Histogram Equalization
• Histogram equalization is based on a transformation of the
probability density function of a random variable.
• Let pr(r) and ps(s) denote the probability density function of
random variable r and s, respectively.
• If pr(r) and T(r) are known and , then
the probability density function ps(s) of the transformed
variable s can be obtained
ds
dr
r
p
s
p r
s )
(
)
( 
Histogram Equalization
• Define a transformation function where w is a dummy variable
of integration and the right side of this equation is the
cumulative distribution function of random variable r.



r
r dw
w
p
r
T
s
0
)
(
)
(
Histogram Equalization
• Given transformation function T(r),
ps(s) now is a uniform probability density function.
• T(r) depends on pr(r), but the resulting ps(s) always is uniform.
1
0
1
)
(
1
)
(
)
(
)
( 



 s
r
p
r
p
ds
dr
r
p
s
p
r
r
r
s


r
r dw
w
p
r
T
0
)
(
)
(
Histogram Equalization
• In discrete version:
– The probability of occurrence of gray level rk in an image is
n : the total number of pixels in the image
nk : the number of pixels that have gray level rk
L : the total number of possible gray levels in the image
1
,...,
2
,
1
,
0
)
( 

 L
k
n
n
r
p k
r
Histogram Equalization
– The discrete version the transformation function is
– Thus, an output image is obtained by mapping each pixel with level rk
in the input image into a corresponding pixel with level sk.
– The transformation given in the above equation is called histogram
equalization or histogram linearization.
1
,...,
2
,
1
,
0
)
(
)
(
0 0




  
 
L
k
n
n
r
p
r
T
s
k
j
k
j
j
j
r
k
k
Histogram Equalization: Example
Histogram Equalization: Example
Lab Problem: Draw histogram for any image,
equalize the histogram and show the equalized image.
Histogram Equalization
• Transformation functions (1) through (4) were obtained form the
histograms of the images in Fig 3.17(a), using Eq. (3.3-8).
Enhancement Using Arithmetic/Logic Operations
• Two images of the same size can be combined using
operations of addition, subtraction, multiplication, division,
logical AND, OR, XOR and NOT. Such operations are done on
pairs of their corresponding pixels.
• Often only one of the images is a real picture while the other
is a machine generated mask. The mask often is a binary
image consisting only of pixel values 0 and 1.
• Example: Figure 3.27
Enhancement Using Arithmetic/Logic Operations
 The AND and OR operations are used for masking; that is, for
selecting subimages in an image, as illustrated in following
figure.
 In the AND and OR image masks, light represents a binary 1
and dark represents a binary 0.
Enhancement Using Arithmetic/Logic Operations
AND
OR
Image Subtraction
Image Subtraction
Example 1
Lab Problem: Perform subtraction of two given images.
Show the histogram equalized image.
Lab Problem: Add any two given images. Show and write the
result into a file in BMP format.
Image Averaging
• When taking pictures in reduced lighting (i.e., low
illumination), image noise becomes apparent.
• A noisy image g(x,y) can be defined by
where f (x, y): an original image
: the addition of noise
• One simple way to reduce this granular noise is to
take several identical pictures and average them, thus
smoothing out the randomness.
)
,
(
)
,
(
)
,
( y
x
y
x
f
y
x
g 


)
,
( y
x

Image Averaging
)
,
(
)
,
(
)
,
( y
x
y
x
f
y
x
g 


Image Averaging
Image Averaging
Image Averaging
Image Averaging
Basics of Spatial Filtering
 Some neighborhood operations work with the values of
the image pixels in the neighborhood and the
corresponding values of a subimage that has the same
dimensions as the neighborhood.
 The subimage is called a filter, mask, kernel, template,
or window.
 We are interested in filtering operations that are
performed directly on the pixels of an image.
 The mechanics of spatial filtering are illustrated in the
following figure-
Basics of Spatial Filtering
Basics of Spatial Filtering
Basics of Spatial Filtering
 The process consists simply of moving the filter mask
from point to point in an image.
 At each point (x,y), the response of the filter at that
point is calculated using a predefined relationship.
 For linear spatial filtering the response is given by a sum
of products of the filter coefficients and the
corresponding image pixels in the area spanned by the
filter mask.
Basics of Spatial Filtering
Basics of Spatial Filtering
Basics of Spatial Filtering
Basics of Spatial Filtering
Basics of Spatial Filtering
What happens when the center of the filter approaches
the border of the image?
Smoothing Spatial Filters
 Smoothing filters are used for blurring and for noise
reduction.
 Blurring is used in preprocessing steps, such as removal of
small details from an image prior to object extraction.
Smoothing Linear Filters
 The output of a smoothing, linear spatial filter is simply the
average of the pixels contained in the neighborhood of the
filter mask.
 These filters sometimes are called averaging filter.
Smoothing Spatial Filters
Smoothing Linear Filters
 The idea behind smoothing filters is straightforward. By
replacing the value of every pixel in an image by the average
of the gray levels in the neighborhood defined by the filter
mask, this process results in an image with reduced “sharp”
transitions in gray levels.
Smoothing Spatial Filters
• Smoothing linear filters
– Averaging filters (Lowpass filters in Chapter 4))
• Box filter ( all coefficients are equal)
• Weighted average filter
Box filter Weighted average
Smoothing Spatial Filters
• The general implementation for filtering an MXN image with
a weighted averaging filter of size mxn is given by
where a=(m-1)/2 and b=(n-1)/2



 


 



 a
a
s
b
b
t
a
a
s
b
b
t
t
s
w
t
y
s
x
f
t
s
w
y
x
g
)
,
(
)
,
(
)
,
(
)
,
(
Smoothing Spatial Filters
Image smoothing with masks of various sizes
Lab Problem: You are given an image. Make it smooth using
smoothing filter (filter size may be varied).
Sharpening Spatial Filters
• Sharpening filters are based on computing spatial
derivatives of an image.
• The first-order derivative of a one-dimensional
function f(x) is
• The second-order derivative of a one-dimensional
function f(x) is
)
(
)
1
( x
f
x
f
x
f





)
(
2
)
1
(
)
1
(
2
2
x
f
x
f
x
f
x
f







**Home Work

More Related Content

Similar to Image Enhancement in the Spatial Domain.pdf

Image enhancement in spatial domain.ppt
Image enhancement in spatial domain.pptImage enhancement in spatial domain.ppt
Image enhancement in spatial domain.pptpravin patil
 
Image enhancement ppt nal2
Image enhancement ppt nal2Image enhancement ppt nal2
Image enhancement ppt nal2Surabhi Ks
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial DomainDEEPASHRI HK
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial DomainA B Shinde
 
Chapter 3 image enhancement (spatial domain)
Chapter 3 image enhancement (spatial domain)Chapter 3 image enhancement (spatial domain)
Chapter 3 image enhancement (spatial domain)asodariyabhavesh
 
Digital image processing - Image Enhancement (MATERIAL)
Digital image processing  - Image Enhancement (MATERIAL)Digital image processing  - Image Enhancement (MATERIAL)
Digital image processing - Image Enhancement (MATERIAL)Mathankumar S
 
Digital Image Processing - Image Enhancement
Digital Image Processing  - Image EnhancementDigital Image Processing  - Image Enhancement
Digital Image Processing - Image EnhancementMathankumar S
 
Image enhancement lecture
Image enhancement lectureImage enhancement lecture
Image enhancement lectureISRAR HUSSAIN
 
Image_processing_unit2_SPPU_Syllabus.pptx
Image_processing_unit2_SPPU_Syllabus.pptxImage_processing_unit2_SPPU_Syllabus.pptx
Image_processing_unit2_SPPU_Syllabus.pptxMayuri Narkhede
 
IMAGE ENHANCEMENT IN CASE OF UNEVEN ILLUMINATION USING VARIABLE THRESHOLDING ...
IMAGE ENHANCEMENT IN CASE OF UNEVEN ILLUMINATION USING VARIABLE THRESHOLDING ...IMAGE ENHANCEMENT IN CASE OF UNEVEN ILLUMINATION USING VARIABLE THRESHOLDING ...
IMAGE ENHANCEMENT IN CASE OF UNEVEN ILLUMINATION USING VARIABLE THRESHOLDING ...ijsrd.com
 
Image enhancement in the spatial domain1
Image enhancement in the spatial domain1Image enhancement in the spatial domain1
Image enhancement in the spatial domain1shabanam tamboli
 
Image Enhancement in the Spatial Domain1.ppt
Image Enhancement in the Spatial Domain1.pptImage Enhancement in the Spatial Domain1.ppt
Image Enhancement in the Spatial Domain1.pptShabanamTamboli1
 
project presentation-90-MCS-200003.pptx
project presentation-90-MCS-200003.pptxproject presentation-90-MCS-200003.pptx
project presentation-90-MCS-200003.pptxNiladriBhattacharjee10
 
image processing intensity transformation
image processing intensity transformationimage processing intensity transformation
image processing intensity transformationalobaidimki
 
chapter 4 computervision.pdf IT IS ABOUT COMUTER VISION
chapter 4 computervision.pdf IT IS ABOUT COMUTER VISIONchapter 4 computervision.pdf IT IS ABOUT COMUTER VISION
chapter 4 computervision.pdf IT IS ABOUT COMUTER VISIONshesnasuneer
 

Similar to Image Enhancement in the Spatial Domain.pdf (20)

Module 2
Module 2Module 2
Module 2
 
3rd unit.pptx
3rd unit.pptx3rd unit.pptx
3rd unit.pptx
 
Chap5 imange enhancemet
Chap5 imange enhancemetChap5 imange enhancemet
Chap5 imange enhancemet
 
Image enhancement in spatial domain.ppt
Image enhancement in spatial domain.pptImage enhancement in spatial domain.ppt
Image enhancement in spatial domain.ppt
 
Image enhancement ppt nal2
Image enhancement ppt nal2Image enhancement ppt nal2
Image enhancement ppt nal2
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial Domain
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial Domain
 
Chapter 3 image enhancement (spatial domain)
Chapter 3 image enhancement (spatial domain)Chapter 3 image enhancement (spatial domain)
Chapter 3 image enhancement (spatial domain)
 
Digital image processing - Image Enhancement (MATERIAL)
Digital image processing  - Image Enhancement (MATERIAL)Digital image processing  - Image Enhancement (MATERIAL)
Digital image processing - Image Enhancement (MATERIAL)
 
Digital Image Processing - Image Enhancement
Digital Image Processing  - Image EnhancementDigital Image Processing  - Image Enhancement
Digital Image Processing - Image Enhancement
 
Image enhancement lecture
Image enhancement lectureImage enhancement lecture
Image enhancement lecture
 
h.pdf
h.pdfh.pdf
h.pdf
 
Image_processing_unit2_SPPU_Syllabus.pptx
Image_processing_unit2_SPPU_Syllabus.pptxImage_processing_unit2_SPPU_Syllabus.pptx
Image_processing_unit2_SPPU_Syllabus.pptx
 
IMAGE ENHANCEMENT IN CASE OF UNEVEN ILLUMINATION USING VARIABLE THRESHOLDING ...
IMAGE ENHANCEMENT IN CASE OF UNEVEN ILLUMINATION USING VARIABLE THRESHOLDING ...IMAGE ENHANCEMENT IN CASE OF UNEVEN ILLUMINATION USING VARIABLE THRESHOLDING ...
IMAGE ENHANCEMENT IN CASE OF UNEVEN ILLUMINATION USING VARIABLE THRESHOLDING ...
 
Image enhancement in the spatial domain1
Image enhancement in the spatial domain1Image enhancement in the spatial domain1
Image enhancement in the spatial domain1
 
Image Enhancement in the Spatial Domain1.ppt
Image Enhancement in the Spatial Domain1.pptImage Enhancement in the Spatial Domain1.ppt
Image Enhancement in the Spatial Domain1.ppt
 
4 image enhancement in spatial domain
4 image enhancement in spatial domain4 image enhancement in spatial domain
4 image enhancement in spatial domain
 
project presentation-90-MCS-200003.pptx
project presentation-90-MCS-200003.pptxproject presentation-90-MCS-200003.pptx
project presentation-90-MCS-200003.pptx
 
image processing intensity transformation
image processing intensity transformationimage processing intensity transformation
image processing intensity transformation
 
chapter 4 computervision.pdf IT IS ABOUT COMUTER VISION
chapter 4 computervision.pdf IT IS ABOUT COMUTER VISIONchapter 4 computervision.pdf IT IS ABOUT COMUTER VISION
chapter 4 computervision.pdf IT IS ABOUT COMUTER VISION
 

Recently uploaded

Biopesticide (2).pptx .This slides helps to know the different types of biop...
Biopesticide (2).pptx  .This slides helps to know the different types of biop...Biopesticide (2).pptx  .This slides helps to know the different types of biop...
Biopesticide (2).pptx .This slides helps to know the different types of biop...RohitNehra6
 
Is RISC-V ready for HPC workload? Maybe?
Is RISC-V ready for HPC workload? Maybe?Is RISC-V ready for HPC workload? Maybe?
Is RISC-V ready for HPC workload? Maybe?Patrick Diehl
 
Raman spectroscopy.pptx M Pharm, M Sc, Advanced Spectral Analysis
Raman spectroscopy.pptx M Pharm, M Sc, Advanced Spectral AnalysisRaman spectroscopy.pptx M Pharm, M Sc, Advanced Spectral Analysis
Raman spectroscopy.pptx M Pharm, M Sc, Advanced Spectral AnalysisDiwakar Mishra
 
Animal Communication- Auditory and Visual.pptx
Animal Communication- Auditory and Visual.pptxAnimal Communication- Auditory and Visual.pptx
Animal Communication- Auditory and Visual.pptxUmerFayaz5
 
Recombination DNA Technology (Nucleic Acid Hybridization )
Recombination DNA Technology (Nucleic Acid Hybridization )Recombination DNA Technology (Nucleic Acid Hybridization )
Recombination DNA Technology (Nucleic Acid Hybridization )aarthirajkumar25
 
Boyles law module in the grade 10 science
Boyles law module in the grade 10 scienceBoyles law module in the grade 10 science
Boyles law module in the grade 10 sciencefloriejanemacaya1
 
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...Sérgio Sacani
 
Botany 4th semester file By Sumit Kumar yadav.pdf
Botany 4th semester file By Sumit Kumar yadav.pdfBotany 4th semester file By Sumit Kumar yadav.pdf
Botany 4th semester file By Sumit Kumar yadav.pdfSumit Kumar yadav
 
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.aasikanpl
 
Unlocking the Potential: Deep dive into ocean of Ceramic Magnets.pptx
Unlocking  the Potential: Deep dive into ocean of Ceramic Magnets.pptxUnlocking  the Potential: Deep dive into ocean of Ceramic Magnets.pptx
Unlocking the Potential: Deep dive into ocean of Ceramic Magnets.pptxanandsmhk
 
Analytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptxAnalytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptxSwapnil Therkar
 
Grafana in space: Monitoring Japan's SLIM moon lander in real time
Grafana in space: Monitoring Japan's SLIM moon lander  in real timeGrafana in space: Monitoring Japan's SLIM moon lander  in real time
Grafana in space: Monitoring Japan's SLIM moon lander in real timeSatoshi NAKAHIRA
 
Physiochemical properties of nanomaterials and its nanotoxicity.pptx
Physiochemical properties of nanomaterials and its nanotoxicity.pptxPhysiochemical properties of nanomaterials and its nanotoxicity.pptx
Physiochemical properties of nanomaterials and its nanotoxicity.pptxAArockiyaNisha
 
GFP in rDNA Technology (Biotechnology).pptx
GFP in rDNA Technology (Biotechnology).pptxGFP in rDNA Technology (Biotechnology).pptx
GFP in rDNA Technology (Biotechnology).pptxAleenaTreesaSaji
 
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...Sérgio Sacani
 
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.aasikanpl
 
A relative description on Sonoporation.pdf
A relative description on Sonoporation.pdfA relative description on Sonoporation.pdf
A relative description on Sonoporation.pdfnehabiju2046
 
SOLUBLE PATTERN RECOGNITION RECEPTORS.pptx
SOLUBLE PATTERN RECOGNITION RECEPTORS.pptxSOLUBLE PATTERN RECOGNITION RECEPTORS.pptx
SOLUBLE PATTERN RECOGNITION RECEPTORS.pptxkessiyaTpeter
 
Recombinant DNA technology (Immunological screening)
Recombinant DNA technology (Immunological screening)Recombinant DNA technology (Immunological screening)
Recombinant DNA technology (Immunological screening)PraveenaKalaiselvan1
 

Recently uploaded (20)

Biopesticide (2).pptx .This slides helps to know the different types of biop...
Biopesticide (2).pptx  .This slides helps to know the different types of biop...Biopesticide (2).pptx  .This slides helps to know the different types of biop...
Biopesticide (2).pptx .This slides helps to know the different types of biop...
 
Is RISC-V ready for HPC workload? Maybe?
Is RISC-V ready for HPC workload? Maybe?Is RISC-V ready for HPC workload? Maybe?
Is RISC-V ready for HPC workload? Maybe?
 
Raman spectroscopy.pptx M Pharm, M Sc, Advanced Spectral Analysis
Raman spectroscopy.pptx M Pharm, M Sc, Advanced Spectral AnalysisRaman spectroscopy.pptx M Pharm, M Sc, Advanced Spectral Analysis
Raman spectroscopy.pptx M Pharm, M Sc, Advanced Spectral Analysis
 
Animal Communication- Auditory and Visual.pptx
Animal Communication- Auditory and Visual.pptxAnimal Communication- Auditory and Visual.pptx
Animal Communication- Auditory and Visual.pptx
 
Recombination DNA Technology (Nucleic Acid Hybridization )
Recombination DNA Technology (Nucleic Acid Hybridization )Recombination DNA Technology (Nucleic Acid Hybridization )
Recombination DNA Technology (Nucleic Acid Hybridization )
 
Boyles law module in the grade 10 science
Boyles law module in the grade 10 scienceBoyles law module in the grade 10 science
Boyles law module in the grade 10 science
 
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
 
Botany 4th semester file By Sumit Kumar yadav.pdf
Botany 4th semester file By Sumit Kumar yadav.pdfBotany 4th semester file By Sumit Kumar yadav.pdf
Botany 4th semester file By Sumit Kumar yadav.pdf
 
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
 
Unlocking the Potential: Deep dive into ocean of Ceramic Magnets.pptx
Unlocking  the Potential: Deep dive into ocean of Ceramic Magnets.pptxUnlocking  the Potential: Deep dive into ocean of Ceramic Magnets.pptx
Unlocking the Potential: Deep dive into ocean of Ceramic Magnets.pptx
 
Analytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptxAnalytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptx
 
Grafana in space: Monitoring Japan's SLIM moon lander in real time
Grafana in space: Monitoring Japan's SLIM moon lander  in real timeGrafana in space: Monitoring Japan's SLIM moon lander  in real time
Grafana in space: Monitoring Japan's SLIM moon lander in real time
 
Physiochemical properties of nanomaterials and its nanotoxicity.pptx
Physiochemical properties of nanomaterials and its nanotoxicity.pptxPhysiochemical properties of nanomaterials and its nanotoxicity.pptx
Physiochemical properties of nanomaterials and its nanotoxicity.pptx
 
GFP in rDNA Technology (Biotechnology).pptx
GFP in rDNA Technology (Biotechnology).pptxGFP in rDNA Technology (Biotechnology).pptx
GFP in rDNA Technology (Biotechnology).pptx
 
9953056974 Young Call Girls In Mahavir enclave Indian Quality Escort service
9953056974 Young Call Girls In Mahavir enclave Indian Quality Escort service9953056974 Young Call Girls In Mahavir enclave Indian Quality Escort service
9953056974 Young Call Girls In Mahavir enclave Indian Quality Escort service
 
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
PossibleEoarcheanRecordsoftheGeomagneticFieldPreservedintheIsuaSupracrustalBe...
 
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
 
A relative description on Sonoporation.pdf
A relative description on Sonoporation.pdfA relative description on Sonoporation.pdf
A relative description on Sonoporation.pdf
 
SOLUBLE PATTERN RECOGNITION RECEPTORS.pptx
SOLUBLE PATTERN RECOGNITION RECEPTORS.pptxSOLUBLE PATTERN RECOGNITION RECEPTORS.pptx
SOLUBLE PATTERN RECOGNITION RECEPTORS.pptx
 
Recombinant DNA technology (Immunological screening)
Recombinant DNA technology (Immunological screening)Recombinant DNA technology (Immunological screening)
Recombinant DNA technology (Immunological screening)
 

Image Enhancement in the Spatial Domain.pdf

  • 1. Image Enhancement in the Spatial Domain  The principal objective of enhancement is to process an image so that the result is more suitable than the original image for a specific application. Image enhancement approaches fall into two broad categories: - Spatial domain methods - Frequency domain methods The term spatial domain refers to the image plane itself, and approaches in this category are based on direct manipulation of pixel in an image.
  • 2. Image Enhancement in the Spatial Domain Frequency domain processing techniques are based on modifying the Fourier transformation of an image.
  • 3. Background • A mathematical representation of spatial domain enhancement: where f(x, y): the input image g(x, y): the processed image T: an operator on f, defined over some neighborhood of (x, y) In addition, T can operate on a set of input images, such as performing the pixel-by-pixel sum of K image for noise reduction, discussed later )] , ( [ ) , ( y x f T y x g 
  • 4. The principal approach in defining a neighborhood about a point (x, y) is to use a square or rectangular subimage area centered at (x, y) )] , ( [ ) , ( y x f T y x g  The operator T is applied at each location (x, y) to produce The output g, at that location.
  • 5. Background Where, r and s are variables denoting the gray-level of f(x, y) and g(x, y) at any point (x, y)
  • 7. Image Enhancement in the Spatial Domain Some Basic Gray Level Transformation As an introduction to gray level transformations, consider the following figure, which shows three types of functions used for image enhancement:  Linear ( negative and identity transformations) Logarithmic (log and inverse-log transformations)  Power-law (nth root transformations)
  • 8. Some Basic Gray Level Transformations
  • 9. Image Enhancement in the Spatial Domain Image Negatives  Reversing the intensity levels of an image in this manner produces the equivalent of a photographic negative.  An example is shown in the following figure.
  • 10. Image Negatives r L s    1 • Let the range of gray level be [0, L-1], then
  • 11. Image Enhancement in the Spatial Domain Image Negatives  The original image is a digital mammogram showing a small lesion.  In spite of the fact that the visual content is the same in both images, note how much easier it is to analyze the breast tissue in this particular case. Lab Problem: You are given an image make it a negative image. Save the output image in BMP file.
  • 12. Image Enhancement in the Spatial Domain Log Transformations  The shape of the log curve shows that this transformation maps a narrow range of low gray- level values in the input image into a wider range of output levels.  The opposite is true of higher values of input levels.  We would use a transformation of this type to expand the values of dark pixels in an image while compressing the higher-level values. The opposite is true of the inverse log transformation.
  • 13. Log Transformations ) 1 log( r c s   where c : constant 0  r
  • 14. Lab Problem: You are given an image perform log transformation. Save the output image in BMP file.
  • 15. Image Enhancement in the Spatial Domain Power-Law Transformation  Plots of s versus r for various values of γ are shown in the following figure -
  • 16. Power-Law Transformation  cr s  where c, : positive constants 
  • 17. Image Enhancement in the Spatial Domain Power-Law Transformation  As in the case of the log transformation, power- law curves with fractional values of γ map a narrow range of dark input values into a wider range of output values, with the opposite being true for higher values of input levels.
  • 18. Image Enhancement in the Spatial Domain Power-Law Transformation  A variety of devices used for capture, printing, and display respond according to a power law.  By convention, the exponent in the power-law equation is referred to as gamma.  The process used to correct this power-law response phenomena is called gamma correction.
  • 19. Image Enhancement in the Spatial Domain Power-Law Transformation  For example, CRT devices have an intensity-to- voltage response that is a power function, with exponents varying from approximately 1.8 to 2.5.  with reference to the curve for γ = 2.5 in figure, we see that such display systems would tend to produce images that are darker than intended.
  • 20. Power-Law Transformation Example 1: Gamma Correction 4 . 0  
  • 21. Image Enhancement in the Spatial Domain Power-Law Transformation  In addition to gamma correction, power law transformations are useful for general purpose contrast manipulation.  The following figure shows a magnetic resonance (MR) image of an upper thoracic human spine with a fracture dislocation and spinal impingement.
  • 22. Power-Law Transformation Example 2: Gamma Correction 4 . 0   3 . 0   6 . 0   1  
  • 23. Image Enhancement in the Spatial Domain Power-Law Transformation  An aerial image is a projected image which is "floating in air", and cannot be viewed normally. It can only be seen from one position in space.
  • 24. Power-Law Transformation Example 3: Gamma Correction 0 . 3   0 . 5   0 . 4   1  
  • 25. Lab Problem: You are given an image perform power-law transformation. Save the output image in BMP file.
  • 26. Image Enhancement in the Spatial Domain Piecewise-Linear Transformation Functions Contrast Stretching  One of the simplest piecewise linear functions is a contrast-stretching transformation.  The idea behind contrast stretching is to increase the dynamic range of the gray levels in the image being processed.  The following figure shows a typical transformation used for contrast stretching.
  • 28. Image Enhancement in the Spatial Domain Piecewise-Linear Transformation Functions Contrast Stretching
  • 29. Image Enhancement in the Spatial Domain Piecewise-Linear Transformation Functions Contrast Stretching
  • 30. Image Enhancement in the Spatial Domain Piecewise-Linear Transformation Functions Contrast Stretching
  • 31. Image Enhancement in the Spatial Domain Piecewise-Linear Transformation Functions Contrast Stretching
  • 32. Image Enhancement in the Spatial Domain Piecewise-Linear Transformation Functions Gray-level slicing  Highlighting a specific range of gray levels in an image often is desired.  Applications include enhancing features such as masses of water in satellite imagery and enhancing flaws in X-ray images. The following figure shows-
  • 33. Piecewise-Linear Transformation Functions Case 2:Gray-level Slicing An image Result of using the transformation in (a)
  • 34. Image Enhancement in the Spatial Domain Piecewise-Linear Transformation Functions Bit-plane slicing  Instead of highlighting gray-level ranges, highlighting the contribution made to total image appearance by specific bits might be desired. 
  • 35. Piecewise-Linear Transformation Functions Case 3:Bit-plane Slicing • Bit-plane slicing: – It can highlight the contribution made to total image appearance by specific bits. – Each pixel in an image represented by 8 bits. – Image is composed of eight 1-bit planes, ranging from bit-plane 0 for the least significant bit to bit plane 7 for the most significant bit.
  • 36. Image Enhancement in the Spatial Domain Piecewise-Linear Transformation Functions Bit-plane slicing  In terms of 8-bit bytes, plane 0 contains all the lowest order bits in the bytes comprising the pixels in the image and plane 7 contains all the higher- order bits.  The higher-order bits (especially the top four) contain the majority of the visually significant data. The other bit planes contribute to more subtle details.  The figure 3.14 shows the various bit planes for the image shown in figure 3.13.
  • 38. Piecewise-Linear Transformation Functions Bit-plane Slicing: A Fractal Image 2 7 6 4 5 3 1 0
  • 39. Image Enhancement in the Spatial Domain Histogram Processing
  • 40. Image Enhancement in the Spatial Domain Histogram Processing
  • 41. Image Enhancement in the Spatial Domain Histogram Processing  Histogram processing in image enhancement, shown in figure 3.15.  Four basic gray level characteristics: dark, light, low contrast, and high contrast.  The right side of the figure shows the histograms corresponding to these images.
  • 44. Histogram Processing Lab Problem: Draw histogram for any given image.
  • 45. Histogram Equalization • Histogram equalization: – To improve the contrast of an image – To transform an image in such a way that the transformed image has a nearly uniform distribution of pixel values • Transformation: – Assume r has been normalized to the interval [0,1], with r = 0 representing black and r = 1 representing white – The transformation function satisfies the following conditions: 1 0 ) (    r r T s
  • 48. Histogram Equalization • Histogram equalization is based on a transformation of the probability density function of a random variable. • Let pr(r) and ps(s) denote the probability density function of random variable r and s, respectively. • If pr(r) and T(r) are known and , then the probability density function ps(s) of the transformed variable s can be obtained ds dr r p s p r s ) ( ) ( 
  • 49. Histogram Equalization • Define a transformation function where w is a dummy variable of integration and the right side of this equation is the cumulative distribution function of random variable r.    r r dw w p r T s 0 ) ( ) (
  • 50. Histogram Equalization • Given transformation function T(r), ps(s) now is a uniform probability density function. • T(r) depends on pr(r), but the resulting ps(s) always is uniform. 1 0 1 ) ( 1 ) ( ) ( ) (      s r p r p ds dr r p s p r r r s   r r dw w p r T 0 ) ( ) (
  • 51. Histogram Equalization • In discrete version: – The probability of occurrence of gray level rk in an image is n : the total number of pixels in the image nk : the number of pixels that have gray level rk L : the total number of possible gray levels in the image 1 ,..., 2 , 1 , 0 ) (    L k n n r p k r
  • 52. Histogram Equalization – The discrete version the transformation function is – Thus, an output image is obtained by mapping each pixel with level rk in the input image into a corresponding pixel with level sk. – The transformation given in the above equation is called histogram equalization or histogram linearization. 1 ,..., 2 , 1 , 0 ) ( ) ( 0 0          L k n n r p r T s k j k j j j r k k
  • 55. Lab Problem: Draw histogram for any image, equalize the histogram and show the equalized image.
  • 56. Histogram Equalization • Transformation functions (1) through (4) were obtained form the histograms of the images in Fig 3.17(a), using Eq. (3.3-8).
  • 57. Enhancement Using Arithmetic/Logic Operations • Two images of the same size can be combined using operations of addition, subtraction, multiplication, division, logical AND, OR, XOR and NOT. Such operations are done on pairs of their corresponding pixels. • Often only one of the images is a real picture while the other is a machine generated mask. The mask often is a binary image consisting only of pixel values 0 and 1. • Example: Figure 3.27
  • 58. Enhancement Using Arithmetic/Logic Operations  The AND and OR operations are used for masking; that is, for selecting subimages in an image, as illustrated in following figure.  In the AND and OR image masks, light represents a binary 1 and dark represents a binary 0.
  • 62. Lab Problem: Perform subtraction of two given images. Show the histogram equalized image. Lab Problem: Add any two given images. Show and write the result into a file in BMP format.
  • 63. Image Averaging • When taking pictures in reduced lighting (i.e., low illumination), image noise becomes apparent. • A noisy image g(x,y) can be defined by where f (x, y): an original image : the addition of noise • One simple way to reduce this granular noise is to take several identical pictures and average them, thus smoothing out the randomness. ) , ( ) , ( ) , ( y x y x f y x g    ) , ( y x 
  • 69. Basics of Spatial Filtering  Some neighborhood operations work with the values of the image pixels in the neighborhood and the corresponding values of a subimage that has the same dimensions as the neighborhood.  The subimage is called a filter, mask, kernel, template, or window.  We are interested in filtering operations that are performed directly on the pixels of an image.  The mechanics of spatial filtering are illustrated in the following figure-
  • 70. Basics of Spatial Filtering
  • 71. Basics of Spatial Filtering
  • 72. Basics of Spatial Filtering  The process consists simply of moving the filter mask from point to point in an image.  At each point (x,y), the response of the filter at that point is calculated using a predefined relationship.  For linear spatial filtering the response is given by a sum of products of the filter coefficients and the corresponding image pixels in the area spanned by the filter mask.
  • 73. Basics of Spatial Filtering
  • 74. Basics of Spatial Filtering
  • 75. Basics of Spatial Filtering
  • 76. Basics of Spatial Filtering
  • 77. Basics of Spatial Filtering What happens when the center of the filter approaches the border of the image?
  • 78. Smoothing Spatial Filters  Smoothing filters are used for blurring and for noise reduction.  Blurring is used in preprocessing steps, such as removal of small details from an image prior to object extraction. Smoothing Linear Filters  The output of a smoothing, linear spatial filter is simply the average of the pixels contained in the neighborhood of the filter mask.  These filters sometimes are called averaging filter.
  • 79. Smoothing Spatial Filters Smoothing Linear Filters  The idea behind smoothing filters is straightforward. By replacing the value of every pixel in an image by the average of the gray levels in the neighborhood defined by the filter mask, this process results in an image with reduced “sharp” transitions in gray levels.
  • 80. Smoothing Spatial Filters • Smoothing linear filters – Averaging filters (Lowpass filters in Chapter 4)) • Box filter ( all coefficients are equal) • Weighted average filter Box filter Weighted average
  • 81. Smoothing Spatial Filters • The general implementation for filtering an MXN image with a weighted averaging filter of size mxn is given by where a=(m-1)/2 and b=(n-1)/2              a a s b b t a a s b b t t s w t y s x f t s w y x g ) , ( ) , ( ) , ( ) , (
  • 82. Smoothing Spatial Filters Image smoothing with masks of various sizes
  • 83. Lab Problem: You are given an image. Make it smooth using smoothing filter (filter size may be varied).
  • 84. Sharpening Spatial Filters • Sharpening filters are based on computing spatial derivatives of an image. • The first-order derivative of a one-dimensional function f(x) is • The second-order derivative of a one-dimensional function f(x) is ) ( ) 1 ( x f x f x f      ) ( 2 ) 1 ( ) 1 ( 2 2 x f x f x f x f        **Home Work