SlideShare a Scribd company logo
Intensity Transformation and Spatial
Filtering
Subject: FIP (181102)
Prof. Asodariya Bhavesh
ECD,SSASIT, Surat
Digital Image Processing, 3rd edition by
Gonzalez and Woods
Spatial Operations
– Single-pixel operation (Intensity Transformation)
• Negative Image, contrast stretching etc.
– Neighborhood operations
• Averaging filter, median filtering etc.
– Geometric spatial transformations
• Scaling, Rotation, Translations etc
Single Pixel Operations
Neighborhood Operations
Geometric Spatial Operations
Digital Communication Abdullah Al-
Meshal
Image Enhancement
 The objective of image enhancement is to process
an image so that the result is more suitable than
the original image for a specific application.
 There are two main approaches:
 Image enhancement in spatial domain: Direct
manipulation of pixels in an image
 Point processing: Change pixel intensities
 Spatial filtering
 Image enhancement in frequency domain:
Modifying the Fourier transform of an image
Some Basic Intensity
Transformation Functions
• Image Negatives
s = L – 1 – r
• S is the output intensity value
• L is the highest intensity levels
• r is the input intensity value
• Particularly suited for enhancing white or gray
detail embedded in dark regions of an image,
especially when the black areas are dominant in
size
Some Basic Intensity
Transformation Functions
• Image Negatives
Some Basic Intensity
Transformation Functions
Some Basic Intensity
Transformation Functions
• Log Transformations
• s = c log(1 + r)
• c is constant
• It maps a narrow range of low intensity values in the
input into a wide range of output levels
• The opposite is true of higher values of input levels
• It expands the values of dark pixels in an image while
compressing the higher level values
• It compresses the dynamic range of images with large
variations in pixel values
Some Basic Intensity
Transformation Functions
• Log Transformations
Log Transform
( ) log(1 )T r c r 
Some Basic Intensity
Transformation Functions
• Power Law (Gamma) Transformations
• s = c rγ
• c and γ are both positive constants
• With fractional values(0<γ<1) of gamma map a narrow
range of dark input values into a wider range of
output values, with the opposite being true for higher
values (γ >1)of input levels.
• C=gamma=1 means it is an identity transformations.
• Variety of devices used for image capture , printing,
and display respond according to a power law.
• Process used to correct these power law response
phenomena is called gamma correction.
Some Basic Intensity
Transformation Functions
• Power Law (Gamma) Transformations
Some Basic Intensity
Transformation Functions
Some Basic Intensity
Transformation Functions
• Power Law (Gamma) Transformations
• Images that are not corrected properly look either
bleached out or too dark.
• Varying gamma changes not only intensity, but also
the ratio of red to green to blue in a color images.
• Gamma correction has become increasingly
important, as the use of the digital images over
internet.
• Useful for general purpose contrast manipulation.
• Apply gamma correction on CRT (Television, monitor),
printers, scanners etc.
• Gamma value depends on device.
Some Basic Intensity
Transformation Functions
Some Basic Intensity
Transformation Functions
Piecewise-Linear Transformation
Functions
• Contrast Stretching
• Low contrast images can result from poor
illuminations.
• Lack of dynamic range in the imaging sensor, or even
the wrong setting of a lens aperture during image
acquisition.
• It expands the range of intensity levels in an image so
that it spans the full intensity range of display devices.
• Contrast stretching is obtained by setting
(r1,s1) = (rmin , 0) and (r2,s2) = (rmax , L-1)
Piecewise-Linear Transformation
Functions
Piecewise-Linear Transformation
Functions
• Intensity Level Slicing
• Highlighting specific range of intensities in an image.
• Enhances features such as masses of water in satellite
imagery and enhancing flaws in X-ray images.
• It can be Implemented two ways:
• 1) To display only one value (say, white) in the range of
interest and rests are black which produces binary
image.
• 2) brightens (or darkens) the desired range of
intensities but leaves all other intensity levels in the
image unchanged.
Piecewise-Linear Transformation
Functions
• Intensity Level Slicing
Piecewise-Linear Transformation
Functions
• Intensity Level Slicing
Piecewise-Linear Transformation
Functions
• Intensity Level Slicing
Piecewise-Linear Transformation
Functions
• Bit Plane Slicing
• Pixels are digital numbers composed of bits.
• 256 gray scale image is composed of 8 bits.
• Instead of highlighting intensity level ranges, we could
highlight the contribution made to total image
appearance by specific bits.
• 8-bit image may be considered as being composed of
eight 1-bit planes, with plane 1 containing the lowest-
order bit of all pixels in the image and plane 8 all the
highest-order bits.
Piecewise-Linear Transformation
Functions
• Bit Plane Slicing
Piecewise-Linear Transformation
Functions
• Bit Plane Slicing
Piecewise-Linear Transformation
Functions
• Bit Plane Slicing
Histogram Processing
• Histogram of a digital image with intensity levels in
the range [0,L-1] is a discrete function h(rk) = nk,
where rk is the kth intensity value and nk is the
number of pixels in the image with intensity rk
• Normalized histogram p(rk)=nk/MN, for k = 0,1,2..…..
L-1.
• Histogram manipulation can be used for image
enhancement.
• Information inherent in histogram also is quite useful
in other image processing applications, such as
image compression and segmentation.
Histogram Equalization
• Intensity mapping form
Conditions:
a) T(r) is a monotonically increasing function in the
interval [0, L-1] and
b)
In some formulations, we use the inverse in which case
(a) change to
a’) T(r) is a strictly monotonically increasing function in the
interval [0, L-1]
10),(  LrrTs
10),(1
 
ssTr
101)(0  LrforLrT
Histogram Processing
Histogram Processing
Histogram Equalization
• Intensity levels in an image may be viewed as
random variables in the interval [0,L-1]
• Fundamental descriptor of a random variable is its
probability density function (PDF)
• Let pr(r) and ps(s) denote the PDFs of r and s
respectively
ds
dr
rpsp rs )()( 

r
r dwwpLrTs
0
)()1()(
)()1()()1(
)(
0
rpLdwwp
dr
d
L
dr
rdT
dr
ds
r
r
r 



 
Histogram Equalization
1
1
)(


L
sps
1,...,2,1,0,)1()()1()(
00
  
Lk
MN
n
LrpLrTs
k
j
j
k
j
jrkk
Histogram Processing
Histogram Equalization
Histogram Equalization
Histogram Equalization
• Transformation functions
Histogram Equalization
Histogram Matching (Specification)
• Histogram equalization automatically determines a
transformation function produce uniform histogram
• When automatic enhancement is desired, equalization is a
good approach
• There are some applications in which attempting to base
enhancement on a uniform histogram is not the best
approach
• In particular, it is useful sometimes to be able to specify the
shape of the histogram that we wish the processed image
to have.
• The method used to generate a processed image that has a
specified histogram is called histogram matching or
specification
Histogram Matching (Specification)
• Histogram Specification Procedure:
1) Compute the histogram pr (r) of the given image, and use
it to find the histogram equalization transformation in
equation
and round the resulting values to the integer range [0, L-1]
2) Compute all values of the transformation function G using
same equation
and round values of G
3) For every value of sk, k = 0,1,…,L-1, use the stored values
of G to find the corresponding value of zq so that G(zq) is
closet to sk and store these mappings from s to z.
1,...,2,1,0,)1()(
0
 
Lk
MN
n
LrTs
k
j
j
kk
1,...,2,1,0,)()1()(
0
 
LqrpLzG
q
i
izq
Histogram Matching (Specification)
• Histogram Specification Procedure:
4) Form the histogram-specified image by first histogram-
equalizing the input image and then mapping every
equalized pixel value, sk , of this image to the corresponding
value zq in the histogram-specified image using the
mappings found in step 3.
Histogram Matching
Histogram Matching
Histogram Matching
rk Sk G(Zq)
0 1 0
1 3 0
2 5 0
3 6 1
4 6 2
5 7 5
6 7 6
7 7 7
Histogram Matching
Histogram Matching
Histogram Matching
Local Histogram Processing
• Histogram Processing methods discussed in the previous two
sections are Global, in the sense that pixels are modified by a
transformation function based on the intensity distribution of
an entire image.
• There are some cases in which it is necessary to enhance detail
over small areas in an image.
• This procedure is to define a neighborhood and move its center
pixel to pixel.
• At each location, the histogram of the points in the
neighborhood is computed and either a histogram equalization
or histogram specification transformation function is obtained.
• Map the intensity of the pixel centered in the neighborhood.
• Center of the neighborhood region is then moved to an
adjacent pixel location and the procedure is repeated.
Local Histogram Processing
• This approach has obvious advantages over repeatedly
computing the histogram of all pixels in the neighborhood
region each time the region is moved one pixel location.
• Another approach used sometimes to reduce computation
is to utilize non overlapping regions, but this method
usually produces an undesirable “blocky” effect.
Local Histogram Processing
Spatial Filtering
• Also called spatial masks, kernels, templates, and windows.
• It consists of (1) a neighborhood (typically a small window),
and (2) a predefined operation that is performed on the
image pixels encompassed by the neighborhood.
• Filtering creates a new pixel with coordinates equal to the
center of the neighborhood.
• If operation is linear, then filter is called a linear spatial
filter otherwise nonlinear.
Mechanics of Spatial Filtering
Spatial Correlation & Convolution
• Correlation is the process of moving a filter mask over the
image and computing the sum of the products at each
location.
• Convolution process is same except that the filter is first
rotated by 180 degree.
Chapter 3 image enhancement (spatial domain)
Chapter 3 image enhancement (spatial domain)
Smoothing Spatial Linear Filters
• Also called averaging filters or Lowpass filter.
• By replacing the value of every pixel in an image by
the average of the intensity levels in the
neighborhood defined by the filter mask.
• Reduced “sharp” transition in intensities.
• Random noise typically consists of sharp transition.
• Edges also characterized by sharp intensity
transitions, so averaging filters have the undesirable
side effect that they blur edges.
• If all coefficients are equal in filter than it is also
called a box filter.
Smoothing Spatial Linear Filters
• The other mask is called weighted average,
terminology used to indicate that pixels are
multiplied by different coefficient.
• Center point is more weighted than any other
points.
• Strategy behind weighing the center point the
highest and then reducing value of the coefficients
as a function of increasing distance from the origin
is simply an attempt to reduce blurring in the
smoothing process.
• Intensity of smaller object blends with background.
Smoothing Linear Filter
Chapter 3 image enhancement (spatial domain)
Chapter 3 image enhancement (spatial domain)
Chapter 3 image enhancement (spatial domain)
Order-Statistic (Nonlinear) Filters
• Response is based on ordering (ranking) the pixels
contained in the image area encompassed by the filter, and
then replacing the value of the center pixel with the value
determined by the ranking result.
• Best-known filter is median filter.
• Replaces the value of a center pixel by the median of the
intensity values in the neighborhood of that pixel.
• Used to remove impulse or salt-pepper noise.
• Larger clusters are affected considerably less. ?
• Median represents the 50th percentile of a ranked set of
numbers while 100th or 0th percentile results in the so-
called max filter or min filter respectively.
Median Filter (Nonlinear)
Median Filter (Nonlinear)
Sharpening Spatial Filters
• Objective of sharpening is to highlight transitions in
intensity.
• Uses in printing and medical imaging to industrial
inspection and autonomous guidance in military systems.
• Averaging is analogous to integration, so sharpening is
analogous to spatial differentiation.
• Thus, image differentiation enhances edges and other
discontinuities (such as noise) and deemphasizes areas
with slowly varying intensities.
Foundation
• Definition for a first order derivative (1) must be zero in
areas of constant intensity (2) must be nonzero at the onset
of an intensity step or ramp and (3) must be nonzero along
ramps.
• For a second order derivatives (1) must be zero in constant
areas (2) must be nonzero at the onset and (3) must be
zero along ramps of constant slope.
• First order derivative of a one dimensional function f(x) is
the difference of f(x+1) – f(x).
• Second order = f(x+1) + f(x-1) -2f(x)
Chapter 3 image enhancement (spatial domain)
Second Derivatives-The Laplacian
Second Derivatives - The Laplacian
Second Derivatives-The Laplacian
Chapter 3 image enhancement (spatial domain)
Unsharp Masking and High boost
Filtering
Unsharp Masking and High boost
Filtering
• Unsharp Masking
– Read Original Image f(x,y)
– Blurred original image f’(x,y)
– Mask = f(x,y) – f’(x,y)
– g(x,y) = f(x,y) + Mask
• High Boost Filtering
– Read Original Image f(x,y)
– Blurred original image f’(x,y)
– Mask = f(x,y) – f’(x,y)
– g(x,y) = f(x,y) + k*Mask, where k>1
Unsharp Masking and High boost
Filtering
First Derivative – The Gradient
Chapter 3 image enhancement (spatial domain)
Chapter 3 image enhancement (spatial domain)
Combining Spatial Enhancement
Methods
Combining Spatial Enhancement
Methods

More Related Content

What's hot (20)

PDF
4.intensity transformations
Yahya Alkhaldi
 
PDF
Morphological operations
National Institute of Technology Durgapur
 
PPTX
Image filtering in Digital image processing
Abinaya B
 
PPTX
Digital Image restoration
Md Shabir Alam
 
PPTX
Chapter 6 color image processing
asodariyabhavesh
 
PPSX
Image Processing: Spatial filters
Dr. A. B. Shinde
 
PPTX
Digital image processing
kavitha muneeshwaran
 
PPTX
Image processing second unit Notes
AAKANKSHA JAIN
 
PPTX
Image enhancement
Ayaelshiwi
 
PPTX
Image Enhancement - Point Processing
Gayathri31093
 
PPTX
Image Filtering in the Frequency Domain
Amnaakhaan
 
PPT
08 frequency domain filtering DIP
babak danyal
 
PPT
Spatial domain and filtering
University of Potsdam
 
PPTX
Chap6 image restoration
ShardaSalunkhe1
 
PPT
Segmentation
guest49d49
 
PPTX
Image Smoothing using Frequency Domain Filters
Suhaila Afzana
 
PPTX
Chapter 9 morphological image processing
Ahmed Daoud
 
PPTX
Chapter 9 morphological image processing
asodariyabhavesh
 
PPT
Image degradation and noise by Md.Naseem Ashraf
MD Naseem Ashraf
 
PPT
Image segmentation ppt
Gichelle Amon
 
4.intensity transformations
Yahya Alkhaldi
 
Image filtering in Digital image processing
Abinaya B
 
Digital Image restoration
Md Shabir Alam
 
Chapter 6 color image processing
asodariyabhavesh
 
Image Processing: Spatial filters
Dr. A. B. Shinde
 
Digital image processing
kavitha muneeshwaran
 
Image processing second unit Notes
AAKANKSHA JAIN
 
Image enhancement
Ayaelshiwi
 
Image Enhancement - Point Processing
Gayathri31093
 
Image Filtering in the Frequency Domain
Amnaakhaan
 
08 frequency domain filtering DIP
babak danyal
 
Spatial domain and filtering
University of Potsdam
 
Chap6 image restoration
ShardaSalunkhe1
 
Segmentation
guest49d49
 
Image Smoothing using Frequency Domain Filters
Suhaila Afzana
 
Chapter 9 morphological image processing
Ahmed Daoud
 
Chapter 9 morphological image processing
asodariyabhavesh
 
Image degradation and noise by Md.Naseem Ashraf
MD Naseem Ashraf
 
Image segmentation ppt
Gichelle Amon
 

Similar to Chapter 3 image enhancement (spatial domain) (20)

PPT
Chap5 imange enhancemet
ShardaSalunkhe1
 
PPT
Digital Image through Scanner, Digital Camera. Concept of Gray Levels.
projectsall
 
PPTX
Digital Image Processing Unit -2 Notes complete
shubhamsaraswat8740
 
PPTX
Unit 2. Image Enhancement in Spatial Domain.pptx
swagatkarve
 
PPT
IMAGE PROCESSING--image-------enhancement-----2.ppt
SIVA NAGI REDY KALLI
 
PPT
Image Enhancement in the Spatial Domain U2.ppt
ssuser7ec6af
 
PPSX
Image Enhancement in Spatial Domain
Dr. A. B. Shinde
 
PPT
Image enhancement in spatial domain.ppt
pravin patil
 
PPTX
Module 2
UllasSS1
 
PDF
Image enhancement
Kuppusamy P
 
PPT
Image Enhancement in the Spatial Domain1.ppt
Shabanam Shikalgar
 
PPT
Image enhancement in the spatial domain1
shabanam tamboli
 
PDF
DIP Lecture 7-9.pdf
SAhsanShahBukhari
 
PPTX
Basic Spatial domain image enhancements.pptx
RahulkumarTivarekar1
 
PPTX
Frequency and Spatial Domain, Contrast Stretching.pptx
muthulakshmi cse
 
PPTX
IMAGE ENHANCEMENT IN THE SPATIAL DOMAIN.pptx
Gowthami476224
 
PDF
Image Enhancement in the Spatial Domain.pdf
kamaluddinnstu
 
PPTX
image enhancement-POINT AND HISTOGRAM PROCESSING.pptx
mythilybme
 
PPTX
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
Hemantha Kulathilake
 
PPT
Digital Image Processing_ ch2 enhancement spatial-domain
Malik obeisat
 
Chap5 imange enhancemet
ShardaSalunkhe1
 
Digital Image through Scanner, Digital Camera. Concept of Gray Levels.
projectsall
 
Digital Image Processing Unit -2 Notes complete
shubhamsaraswat8740
 
Unit 2. Image Enhancement in Spatial Domain.pptx
swagatkarve
 
IMAGE PROCESSING--image-------enhancement-----2.ppt
SIVA NAGI REDY KALLI
 
Image Enhancement in the Spatial Domain U2.ppt
ssuser7ec6af
 
Image Enhancement in Spatial Domain
Dr. A. B. Shinde
 
Image enhancement in spatial domain.ppt
pravin patil
 
Module 2
UllasSS1
 
Image enhancement
Kuppusamy P
 
Image Enhancement in the Spatial Domain1.ppt
Shabanam Shikalgar
 
Image enhancement in the spatial domain1
shabanam tamboli
 
DIP Lecture 7-9.pdf
SAhsanShahBukhari
 
Basic Spatial domain image enhancements.pptx
RahulkumarTivarekar1
 
Frequency and Spatial Domain, Contrast Stretching.pptx
muthulakshmi cse
 
IMAGE ENHANCEMENT IN THE SPATIAL DOMAIN.pptx
Gowthami476224
 
Image Enhancement in the Spatial Domain.pdf
kamaluddinnstu
 
image enhancement-POINT AND HISTOGRAM PROCESSING.pptx
mythilybme
 
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
Hemantha Kulathilake
 
Digital Image Processing_ ch2 enhancement spatial-domain
Malik obeisat
 
Ad

Recently uploaded (20)

PDF
Unified_Cloud_Comm_Presentation anil singh ppt
anilsingh298751
 
PDF
MAD Unit - 2 Activity and Fragment Management in Android (Diploma IT)
JappanMavani
 
PDF
IoT - Unit 2 (Internet of Things-Concepts) - PPT.pdf
dipakraut82
 
PDF
Introduction to Productivity and Quality
মোঃ ফুরকান উদ্দিন জুয়েল
 
PPTX
Thermal runway and thermal stability.pptx
godow93766
 
PDF
POWER PLANT ENGINEERING (R17A0326).pdf..
haneefachosa123
 
PDF
GTU Civil Engineering All Semester Syllabus.pdf
Vimal Bhojani
 
PPTX
Green Building & Energy Conservation ppt
Sagar Sarangi
 
PPTX
265587293-NFPA 101 Life safety code-PPT-1.pptx
chandermwason
 
PPTX
MPMC_Module-2 xxxxxxxxxxxxxxxxxxxxx.pptx
ShivanshVaidya5
 
PDF
Set Relation Function Practice session 24.05.2025.pdf
DrStephenStrange4
 
DOC
MRRS Strength and Durability of Concrete
CivilMythili
 
PDF
International Journal of Information Technology Convergence and services (IJI...
ijitcsjournal4
 
PPTX
Destructive Tests corrosion engineer (1).pptx
zeidali3
 
PPT
Oxygen Co2 Transport in the Lungs(Exchange og gases)
SUNDERLINSHIBUD
 
DOCX
8th International Conference on Electrical Engineering (ELEN 2025)
elelijjournal653
 
PPTX
The Role of Information Technology in Environmental Protectio....pptx
nallamillisriram
 
PPTX
Day2 B2 Best.pptx
helenjenefa1
 
PDF
monopile foundation seminar topic for civil engineering students
Ahina5
 
PPTX
site survey architecture student B.arch.
sri02032006
 
Unified_Cloud_Comm_Presentation anil singh ppt
anilsingh298751
 
MAD Unit - 2 Activity and Fragment Management in Android (Diploma IT)
JappanMavani
 
IoT - Unit 2 (Internet of Things-Concepts) - PPT.pdf
dipakraut82
 
Introduction to Productivity and Quality
মোঃ ফুরকান উদ্দিন জুয়েল
 
Thermal runway and thermal stability.pptx
godow93766
 
POWER PLANT ENGINEERING (R17A0326).pdf..
haneefachosa123
 
GTU Civil Engineering All Semester Syllabus.pdf
Vimal Bhojani
 
Green Building & Energy Conservation ppt
Sagar Sarangi
 
265587293-NFPA 101 Life safety code-PPT-1.pptx
chandermwason
 
MPMC_Module-2 xxxxxxxxxxxxxxxxxxxxx.pptx
ShivanshVaidya5
 
Set Relation Function Practice session 24.05.2025.pdf
DrStephenStrange4
 
MRRS Strength and Durability of Concrete
CivilMythili
 
International Journal of Information Technology Convergence and services (IJI...
ijitcsjournal4
 
Destructive Tests corrosion engineer (1).pptx
zeidali3
 
Oxygen Co2 Transport in the Lungs(Exchange og gases)
SUNDERLINSHIBUD
 
8th International Conference on Electrical Engineering (ELEN 2025)
elelijjournal653
 
The Role of Information Technology in Environmental Protectio....pptx
nallamillisriram
 
Day2 B2 Best.pptx
helenjenefa1
 
monopile foundation seminar topic for civil engineering students
Ahina5
 
site survey architecture student B.arch.
sri02032006
 
Ad

Chapter 3 image enhancement (spatial domain)

  • 1. Intensity Transformation and Spatial Filtering Subject: FIP (181102) Prof. Asodariya Bhavesh ECD,SSASIT, Surat
  • 2. Digital Image Processing, 3rd edition by Gonzalez and Woods
  • 3. Spatial Operations – Single-pixel operation (Intensity Transformation) • Negative Image, contrast stretching etc. – Neighborhood operations • Averaging filter, median filtering etc. – Geometric spatial transformations • Scaling, Rotation, Translations etc
  • 6. Geometric Spatial Operations Digital Communication Abdullah Al- Meshal
  • 7. Image Enhancement  The objective of image enhancement is to process an image so that the result is more suitable than the original image for a specific application.  There are two main approaches:  Image enhancement in spatial domain: Direct manipulation of pixels in an image  Point processing: Change pixel intensities  Spatial filtering  Image enhancement in frequency domain: Modifying the Fourier transform of an image
  • 8. Some Basic Intensity Transformation Functions • Image Negatives s = L – 1 – r • S is the output intensity value • L is the highest intensity levels • r is the input intensity value • Particularly suited for enhancing white or gray detail embedded in dark regions of an image, especially when the black areas are dominant in size
  • 9. Some Basic Intensity Transformation Functions • Image Negatives
  • 11. Some Basic Intensity Transformation Functions • Log Transformations • s = c log(1 + r) • c is constant • It maps a narrow range of low intensity values in the input into a wide range of output levels • The opposite is true of higher values of input levels • It expands the values of dark pixels in an image while compressing the higher level values • It compresses the dynamic range of images with large variations in pixel values
  • 12. Some Basic Intensity Transformation Functions • Log Transformations
  • 13. Log Transform ( ) log(1 )T r c r 
  • 14. Some Basic Intensity Transformation Functions • Power Law (Gamma) Transformations • s = c rγ • c and γ are both positive constants • With fractional values(0<γ<1) of gamma map a narrow range of dark input values into a wider range of output values, with the opposite being true for higher values (γ >1)of input levels. • C=gamma=1 means it is an identity transformations. • Variety of devices used for image capture , printing, and display respond according to a power law. • Process used to correct these power law response phenomena is called gamma correction.
  • 15. Some Basic Intensity Transformation Functions • Power Law (Gamma) Transformations
  • 17. Some Basic Intensity Transformation Functions • Power Law (Gamma) Transformations • Images that are not corrected properly look either bleached out or too dark. • Varying gamma changes not only intensity, but also the ratio of red to green to blue in a color images. • Gamma correction has become increasingly important, as the use of the digital images over internet. • Useful for general purpose contrast manipulation. • Apply gamma correction on CRT (Television, monitor), printers, scanners etc. • Gamma value depends on device.
  • 20. Piecewise-Linear Transformation Functions • Contrast Stretching • Low contrast images can result from poor illuminations. • Lack of dynamic range in the imaging sensor, or even the wrong setting of a lens aperture during image acquisition. • It expands the range of intensity levels in an image so that it spans the full intensity range of display devices. • Contrast stretching is obtained by setting (r1,s1) = (rmin , 0) and (r2,s2) = (rmax , L-1)
  • 22. Piecewise-Linear Transformation Functions • Intensity Level Slicing • Highlighting specific range of intensities in an image. • Enhances features such as masses of water in satellite imagery and enhancing flaws in X-ray images. • It can be Implemented two ways: • 1) To display only one value (say, white) in the range of interest and rests are black which produces binary image. • 2) brightens (or darkens) the desired range of intensities but leaves all other intensity levels in the image unchanged.
  • 26. Piecewise-Linear Transformation Functions • Bit Plane Slicing • Pixels are digital numbers composed of bits. • 256 gray scale image is composed of 8 bits. • Instead of highlighting intensity level ranges, we could highlight the contribution made to total image appearance by specific bits. • 8-bit image may be considered as being composed of eight 1-bit planes, with plane 1 containing the lowest- order bit of all pixels in the image and plane 8 all the highest-order bits.
  • 30. Histogram Processing • Histogram of a digital image with intensity levels in the range [0,L-1] is a discrete function h(rk) = nk, where rk is the kth intensity value and nk is the number of pixels in the image with intensity rk • Normalized histogram p(rk)=nk/MN, for k = 0,1,2..….. L-1. • Histogram manipulation can be used for image enhancement. • Information inherent in histogram also is quite useful in other image processing applications, such as image compression and segmentation.
  • 31. Histogram Equalization • Intensity mapping form Conditions: a) T(r) is a monotonically increasing function in the interval [0, L-1] and b) In some formulations, we use the inverse in which case (a) change to a’) T(r) is a strictly monotonically increasing function in the interval [0, L-1] 10),(  LrrTs 10),(1   ssTr 101)(0  LrforLrT
  • 34. Histogram Equalization • Intensity levels in an image may be viewed as random variables in the interval [0,L-1] • Fundamental descriptor of a random variable is its probability density function (PDF) • Let pr(r) and ps(s) denote the PDFs of r and s respectively ds dr rpsp rs )()(   r r dwwpLrTs 0 )()1()( )()1()()1( )( 0 rpLdwwp dr d L dr rdT dr ds r r r      
  • 41. Histogram Matching (Specification) • Histogram equalization automatically determines a transformation function produce uniform histogram • When automatic enhancement is desired, equalization is a good approach • There are some applications in which attempting to base enhancement on a uniform histogram is not the best approach • In particular, it is useful sometimes to be able to specify the shape of the histogram that we wish the processed image to have. • The method used to generate a processed image that has a specified histogram is called histogram matching or specification
  • 42. Histogram Matching (Specification) • Histogram Specification Procedure: 1) Compute the histogram pr (r) of the given image, and use it to find the histogram equalization transformation in equation and round the resulting values to the integer range [0, L-1] 2) Compute all values of the transformation function G using same equation and round values of G 3) For every value of sk, k = 0,1,…,L-1, use the stored values of G to find the corresponding value of zq so that G(zq) is closet to sk and store these mappings from s to z. 1,...,2,1,0,)1()( 0   Lk MN n LrTs k j j kk 1,...,2,1,0,)()1()( 0   LqrpLzG q i izq
  • 43. Histogram Matching (Specification) • Histogram Specification Procedure: 4) Form the histogram-specified image by first histogram- equalizing the input image and then mapping every equalized pixel value, sk , of this image to the corresponding value zq in the histogram-specified image using the mappings found in step 3.
  • 46. Histogram Matching rk Sk G(Zq) 0 1 0 1 3 0 2 5 0 3 6 1 4 6 2 5 7 5 6 7 6 7 7 7
  • 50. Local Histogram Processing • Histogram Processing methods discussed in the previous two sections are Global, in the sense that pixels are modified by a transformation function based on the intensity distribution of an entire image. • There are some cases in which it is necessary to enhance detail over small areas in an image. • This procedure is to define a neighborhood and move its center pixel to pixel. • At each location, the histogram of the points in the neighborhood is computed and either a histogram equalization or histogram specification transformation function is obtained. • Map the intensity of the pixel centered in the neighborhood. • Center of the neighborhood region is then moved to an adjacent pixel location and the procedure is repeated.
  • 51. Local Histogram Processing • This approach has obvious advantages over repeatedly computing the histogram of all pixels in the neighborhood region each time the region is moved one pixel location. • Another approach used sometimes to reduce computation is to utilize non overlapping regions, but this method usually produces an undesirable “blocky” effect.
  • 53. Spatial Filtering • Also called spatial masks, kernels, templates, and windows. • It consists of (1) a neighborhood (typically a small window), and (2) a predefined operation that is performed on the image pixels encompassed by the neighborhood. • Filtering creates a new pixel with coordinates equal to the center of the neighborhood. • If operation is linear, then filter is called a linear spatial filter otherwise nonlinear.
  • 54. Mechanics of Spatial Filtering
  • 55. Spatial Correlation & Convolution • Correlation is the process of moving a filter mask over the image and computing the sum of the products at each location. • Convolution process is same except that the filter is first rotated by 180 degree.
  • 58. Smoothing Spatial Linear Filters • Also called averaging filters or Lowpass filter. • By replacing the value of every pixel in an image by the average of the intensity levels in the neighborhood defined by the filter mask. • Reduced “sharp” transition in intensities. • Random noise typically consists of sharp transition. • Edges also characterized by sharp intensity transitions, so averaging filters have the undesirable side effect that they blur edges. • If all coefficients are equal in filter than it is also called a box filter.
  • 59. Smoothing Spatial Linear Filters • The other mask is called weighted average, terminology used to indicate that pixels are multiplied by different coefficient. • Center point is more weighted than any other points. • Strategy behind weighing the center point the highest and then reducing value of the coefficients as a function of increasing distance from the origin is simply an attempt to reduce blurring in the smoothing process. • Intensity of smaller object blends with background.
  • 64. Order-Statistic (Nonlinear) Filters • Response is based on ordering (ranking) the pixels contained in the image area encompassed by the filter, and then replacing the value of the center pixel with the value determined by the ranking result. • Best-known filter is median filter. • Replaces the value of a center pixel by the median of the intensity values in the neighborhood of that pixel. • Used to remove impulse or salt-pepper noise. • Larger clusters are affected considerably less. ? • Median represents the 50th percentile of a ranked set of numbers while 100th or 0th percentile results in the so- called max filter or min filter respectively.
  • 67. Sharpening Spatial Filters • Objective of sharpening is to highlight transitions in intensity. • Uses in printing and medical imaging to industrial inspection and autonomous guidance in military systems. • Averaging is analogous to integration, so sharpening is analogous to spatial differentiation. • Thus, image differentiation enhances edges and other discontinuities (such as noise) and deemphasizes areas with slowly varying intensities.
  • 68. Foundation • Definition for a first order derivative (1) must be zero in areas of constant intensity (2) must be nonzero at the onset of an intensity step or ramp and (3) must be nonzero along ramps. • For a second order derivatives (1) must be zero in constant areas (2) must be nonzero at the onset and (3) must be zero along ramps of constant slope. • First order derivative of a one dimensional function f(x) is the difference of f(x+1) – f(x). • Second order = f(x+1) + f(x-1) -2f(x)
  • 71. Second Derivatives - The Laplacian
  • 74. Unsharp Masking and High boost Filtering
  • 75. Unsharp Masking and High boost Filtering • Unsharp Masking – Read Original Image f(x,y) – Blurred original image f’(x,y) – Mask = f(x,y) – f’(x,y) – g(x,y) = f(x,y) + Mask • High Boost Filtering – Read Original Image f(x,y) – Blurred original image f’(x,y) – Mask = f(x,y) – f’(x,y) – g(x,y) = f(x,y) + k*Mask, where k>1
  • 76. Unsharp Masking and High boost Filtering
  • 77. First Derivative – The Gradient