SlideShare ist ein Scribd-Unternehmen logo
1 von 40
Downloaden Sie, um offline zu lesen
Image Enhancement
P. Kuppusamy
Content
• Image enhancement
• Spatial domain enhancement
– Point operations, Spatial operations
– Digital Negative
– Contrast Stretching
– Thresholding
– Gray level slicing
– Bit plane slicing
– Dynamic range compression
– Histogram modeling
– Adaptive Histogram Equalization
• Frequency domain enhancement
– Fourier Transforms / Spectral (Frequency) Analysis
• Color Image
– Color Image Enhancement
Image Enhancement
• Image enhancement is improving the perception of information in images
for human viewers.
• Also, providing better input for the further image processing techniques.
• It accentuates or sharpens image features such as edges, boundaries, or
contrast to make a graphic display more helpful for display and analysis.
• The enhancement doesn't increase the inherent information content of the
data, but it increases the dynamic range of the chosen features that can be
detected easily.
Image enhancement methods:
1. Spatial domain enhancement
– operate on pixels directly
1. Point operations 2. Spatial operations (Based on Filtering)
2. Frequency domain enhancement
– operate on the Fourier transform of an image
Spatial Domain Enhancement
• Spatial domain techniques are performed to the image plane itself.
• Its working with pixel values or raw data of an image.
• The operation is g(x, y) = T[f(x, y)], g is the modified output image, f is
the input original image and T [ . ] is an transformation operation on f
defined over some neighborhood of (x, y).
• Based on the operations on the image pixels, it is divided into 3
categories:
1. Point processing
2. Neighborhood processing
3. Histogram based approach.
• The 2D convolution is performed
in Spatial domain:
g(x, y)= f(x, y) * h(x, y)
• Figure shows the image size
256 x 256 pixels from (0,0) to (255, 255)
(255, 255)
(0, 0)
1. Point Processing (Operations) / Greyscale transformation
x
• The new grey level (color) value in a spatial location (m, n) in the
resulting image depends only on the grey level (color) in the same
spatial location (m, n) in the original image/
m m
n n
U[M×N] V[M×N]
Point-wise operation
(grey scale transformation)
f(∙) => v=f(u)
u(m, n) v(m, n) = f(u(m, n))
∀m = 0, 1, .. M-1
∀n = 0, 1, .. N-1
Point Processing (Operations) / Greyscale transformation
• It works on single pixel at a time i.e. T is 1 x 1 operator.
• Transfer function is S = T(r)
• S – processed point image
• r – point to be processed
Examples of point processing are:
• Digital Negative
• Contrast Stretching
• Thresholding
• Gray level slicing
• Bit plane slicing
• Dynamic range compression
Point Processing (Operations) / Greyscale transformation
• Point operations are zero-memory operations where a given gray
level r[0, L-1] is mapped to another gray level s[0, L-1]
according to a transformation. L = 256
)
(x
f
y =
L
L
x
y
Digital Negative
• Negative image is obtained by reverse (inverse) scaling of the gray levels
of the transformation,
v = L- u and umax = 255
• Useful in the display of medical images (X-ray).
• L is total number of gray levels i.e. 255
• But, Generally L range is (0 -255).
• So, v = (L -1) - u i.e. v = (256-1) – u.
L
u
0
L
v
Input intensity
O/p
Gray
level
Contrast Stretching
• Contrast stretching increases the dynamic range of the gray levels in the image.
• Low contrast images occur due to poor or non-uniform lightning conditions,
small dynamic range of imaging sensors.







+
−


+
−


=
L
u
b
v
b
u
b
u
a
v
a
u
a
u
u
v
b
a
)
(
)
(
0



L u
0 a b
va
vb
200
,
30
,
1
,
2
,
2
.
0
,
150
,
50 =
=
=
=
=
=
= b
a y
y
b
a 


• For dark region stretch α >1, a=L/3 i.e. slope < 1
• For mid region stretch β>1 ,b=2/3L
• For bright region stretch γ>1 i.e. slope > 1
Dotted line – Identity transformation
Solid line – Contrast Stretching
Clipping and Thresholding
• Clipping is a special case of contrast stretching, where α= γ=0
• Useful for noise reduction when the input signal is known and the range is [a, b]
i.e. valley between the peaks of the histogram.
• It is used for binary or other images that have bimodal distribution of gray levels.
• Thresholding is extreme contrast stretching where a = b = t and the output comes
as binary. F
f(u)
0
nu
L
,
,
,
0 u a
a u b
b u L
=
 
 
 





V
U
a b
V
U
Clipping Thresholding
u1 = u2
v1 =0, v2 = L -1
Intensity level Slicing
• Permit segmentation of certain gray level regions from the rest of the image.


 

=
otherwise
b
u
a
L
v
,
0
,


 

=
otherwise
u
b
u
a
L
v
,
,
• Transformation highlights
range [A, B] of gray levels and
reduces all others to a constant
level.
• Transformation highlights
range [A, B], but preserves all
other level.
Bit (extraction) level Slicing
• This transformation is useful in determining the number of visually significant
bits in an Image.
• Suppose each pixel is represented by 8 bits it is desired to extract the nth most
significant bit and display it .
• Higher-order bits contain the majority of the visually significant data
Range Compression (Log Transformation)
• Sometime, dynamic range of image exceeds the capability of display device. So it
need to compressed.
• Log operator is an excellent compression function.
• Dynamic range compression is achieved using log operator.
• c – normalization constant and u – input intensity
)
1
(
log10 u
c
v +
=
L
u
0
v
L
2. Local neighborhood operations
• Operation performs on local neighborhoods of input pixels.
• Image is convolved with Finite Impulse Response (FIR) filter (Spatial mask)
Local neighborhood methods:
• Min – Set the pixel value to the minimum in the neighborhood pixel
• Max – Set the pixel value to the maximum in the neighborhood pixel
• Median – Set the pixel value to the midpoint of the neighborhood pixels.
• Mean - Set the pixel value to the mean of the neighborhood pixels.
3. Histogram modeling
• Image Histogram is a graphical representation of the
lightness/color distribution in a digital image. It plots the number
of pixels for each value.
• Histogram of a digital gray image range [0, L-1] is a discrete
function
h(rk) = nk
– rk is the kth gray level (value) pixel
– nk is the number of pixels in the image having gray level rk.
0 50 100 150 200
0
500
1000
1500
2000
2500
3000
Histogram modeling
• Normalize a histogram by dividing each of its values by the total number
of pixels in the image n.
Normalized histogram p(rk) = nk / n, for k = 0, 1, …, L -1.
• nk is number of pixels of the gray value rk
• p(rk) estimation of the probability of occurrence of gray level rk.
• The sum of all components of a normalized histogram is equal to 1.
Why Histogram modeling is need?
• Histograms are the basis for numerous spatial domain processing
techniques.
• Histogram manipulation can be used effectively for image enhancement.
• Histograms can be used to provide useful image statistics.
• Information derived from histograms are quite useful in other image
processing applications, such as image compression and segmentation.
Why Histogram modeling is need?
0 50 100 150 200 250
0
0.5
1
1.5
2
2.5
3
3.5
4
x 10
4
Histogram information reveals that image is under-exposed
Why Histogram modeling is need?
Histogram information reveals that image is over-exposed
0 50 100 150 200 250
0
1000
2000
3000
4000
5000
6000
7000
3. Histogram Equalization – Adjust the image pixel values
• Find a map f(x) such that the histogram of the modified (equalized) image is
flat (uniform).
• Cumulative Probability Function (cdf) of a random variable approximates a
uniform distribution

=
=
x
t
t
h
x
s
0
)
(
)
(
h(t) is the histogram (pdf)

=

=
x
t
t
h
L
y
0
)
(
Uniform
Quantization

=
=
L
t
t
h
0
1
)
(
Note:
L
1

=
=
x
t
t
h
s
0
)
(
x
L
y
0
cumulative probability function
Histogram Comparison
0 50 100 150 200
0
500
1000
1500
2000
2500
3000
0 50 100 150 200 250 300
0
500
1000
1500
2000
2500
3000
before equalization after equalization
Histogram Equalization
before equalization after equalization
Histogram Equalization
Histogram Equalization
Histogram Equalization
Original Histogram Transformation Function Equalized Histogram
3.1. Adaptive Histogram Equalization
• Instead of doing histogram equalization using the whole image, compute
the distribution for a moving window around the given pixel.
• Computes several histograms, each corresponding to a distinct section of
the image, and uses them to redistribute the lightness values of the image.
• It improves the local contrast and enhancing the definitions of edges in
each region of an image.
Frequency Domain Enhancement
• The image f(x,y) is transferred into frequency domain i.e. Compute the Fourier
Transform (Discrete Fourier Transform) of the image.
• Enhancement operations (brightness, contrast) performed on Fourier Transform
of image, then find Inverse Fourier Transform for the enhanced image.
• G(u, v) = F(u, v) H(u, v) - Frequency domain representation
• When applying transformation function on input image pixels modifies the pixel
values in the output image.
H(u, v)
F(u, v) H(u, v) F(u, v)
Fourier Transforms / Spectral (Frequency) Analysis
• Fourier Transform decomposes an image into its sine and cosine components.
• The output of the transformation represents the image in the Fourier or frequency
domain, while the input image is the spatial domain equivalent.
• In the Fourier domain image, each point represents a particular frequency contained
in the spatial domain image.
• For digital images, Discrete Fourier Transform (DFT) is sufficient to use spatial
domain image. i.e. the image in the spatial and Fourier domain are of the same size.
• FT produces a complex number valued output image which can be displayed with
two images, either real and imaginary part or with magnitude and phase.
• In image processing, the magnitude of the FT contains most of the information of the
geometric structure of the spatial domain image.
• However, if want to re-transform the Fourier image into the correct spatial domain
after some processing in the frequency domain, must preserve both magnitude and
phase of the Fourier image.
• The Fourier domain image has a much greater range than the image in the spatial
domain. For good accuracy, its values are calculated and stored in float values.
• DFT takes O(n2) operations, but Fast Fourier Transform (FFT) takes O(n log2n)
operations
Fourier Transforms properties
• Superposition: The FT of a sum of signals is the sum of their Fourier transforms. Thus,
the Fourier transform is a linear operator.
• Shift: The FT of a shifted signal is the transform of the original signal multiplied by a
linear phase shift (complex sinusoid).
• Reversal: The FT of a reversed signal is the complex conjugate of the signal’s transform.
• Convolution: The FT of a pair of convolved signals is the product of their transforms.
• Correlation: The FT of a correlation is the product of the first transform times the
complex conjugate of the second one.
• Multiplication: The FT of the product of two signals is the convolution of their
transforms.
• Differentiation: The FT of the derivative of a signal is that signal’s transform multiplied
by the frequency. In other words, differentiation linearly emphasizes (magnifies) higher
frequencies.
• Domain scaling: The FT of a stretched signal is the equivalently compressed (and scaled)
version of the original transform and vice versa.
• Real images: The FT of a real-valued signal is symmetric around the origin. This fact can
be used to save space and to double the speed of image FFTs by packing alternating
scanlines into the real and imaginary parts of the signal being transformed.
• Parseval’s Theorem: The energy (sum of squared values) of a signal is the same as the
energy of its Fourier transform.
Frequency Domain Enhancement
• Finite curves of image can be expressed as the integral of sines/cosines multiplied
by a weighing function.
Steps of filtering in the frequency domain
1. Calculate the DFT of the image f(u, v)
2. Generate a frequency domain filter H
– H(u, v) and F(u, v) should have the same size
» H(u, v) should NOT be centered. Centered H(u, v) is for displaying
purpose only.
» If H(u, v) is centered, F(u, v) needs to be centered too and some post-
processing is required.
» H(u, v) is located at top-left corner
3. Multiply F(u, v) with filter function H (u, v) (element by element).
G(u, v) = H(u, v) F(u, v)
4. Compute the inverse of DFT result G(u, v) .
5. Take the real part of the IDFT
v))
(G(u,
age
filteredim 
=
Construct Frequency Domain from Spatial Domain filter
Calculate the DFT of the image f(u, v)
- Given image f and spatial filter 9 x 9
1 1 1 1 1 1 1 1
1
1 1 1 1 1 1 1 1
1
1 1 1 1 1 1 1 1
1
1 1 1 1 1 1 1 1
1
1 1 1 1 1 1 1 1
1
1 1 1 1 1 1 1 1
1
1 1 1 1 1 1 1 1
1
1 1 1 1 1 1 1 1
1
1 1 1 1 1 1 1 1
1
81
1
image f Spatial filter h
9 x 9
DFT of image
Construct Frequency Domain from Spatial Domain filter
– H(u, v) and F(u, v) should have the same size
» If H(u, v) is centered, F(u, v) needs to be centered too and expand it.
» H(u, v) is located at top-left corner
300
300
9
9
300
9
9
300
DFT of filter
DFT of filter
frequency domain representation
Construct Frequency Domain from Spatial Domain filter
Multiply DFT of F(u, v) with DFT of expanded H (u, v) (element by element)
G(u, v) = H(u, v) F(u, v)
not centered
F
not centered H not centered
F∙H
Centered F Centered F∙H
Centered H
Frequency Domain Enhancement
Compute the inverse of DFT result G(u, v) and Take real part of IDFT
From Centered From Not centered
Direct Construction of Frequency Domain Filters
• Ideal LowPass Filters (ILPF)
– Cut off all high-frequency components of the Fourier transform that are
at a distance greater than a specified distance D0 (cut off frequency)
from the origin of the (centered) transform
– The transfer function (frequency domain filter) is defined by
– D(u,v) is the distance from point (u, v) to the origin (center) of the
frequency domain filter.
– Usually, the image to be filtered is even-sized, but, in this case, the
center of the filter is (M/2,N/2).
– Then the distance D(u,v) can be obtained by
)
,
(
if
0
)
,
(
if
1
)
,
(
0
0





=
D
v
u
D
D
v
u
D
v
u
H
]
)
2
/
(
)
2
/
[(
)
,
( 2
/
1
2
2
N
v
M
u
v
u
D −
+
−
=
• Determine the cutoff frequency D0
– Compute circles that enclose specified amounts of total image power PT.
 
−
=
=
−
=
=
=
1
0
1
0
2
|
)
,
(
|
M
u
u
N
v
v
T v
u
F
P



T
D
v
u
D
P
v
u
F /
)
|
)
,
(
|
(
0
)
,
(
2
ILPF transfer function plot
Filter displayed as a image
Filter radial cross section
• As the filter radius increases, very less
power is removed/filtered out, but
more details are preserved.
• Ringing effect is clear in most cases
except for the last one.
• Ringing effect is the consequence of
applying ideal lowpass filters
Image 500 x 500 Fourier spectrum
Circles radii 5, 15, 30, 80, 230
Color Image
• Color is a reflection of wavelengths back to the eyes.
• The visible spectrum shows the wavelengths of each of the component
color.
• Color Scheme is the combination of colors
1. Achromatic color - have lightness but no dominant hue or
saturation.
Ex. white, grey and black
2. Monochromatic - comprised of variations of one color.
3. Chromatic color scheme - Any color in which one particular
wavelength or hue predominates.
Ex. blue and green
Achromatic
No color
Monochromatic
Single Color
Chromatic
Having color
Color Image properties
Color Appearance Parameters
• Hue: dominant color corresponding to a dominant wavelength of mixture
light wave
• Saturation / Chroma / Colorfulness: Relative purity or amount of
white light mixed with a hue (inversely proportional to amount of white
light added)
• Brightness / lightness: Intensity of the pixel
• Opacity / Transparency: Indicates the element is fully transparent or
not.
Color Image Enhancement
• Improves the color balance or contrast of the color image
Enhancement of color image:
• The input color coordinates of each pixel are independently transformed
into another set of color coordinates.
• Apply enhancement algorithm for individual monochrome images.
• Since each image plane Tk (m, n),k=1,2,3 is enhanced independently,
care has to be taken so that the enhanced coordinates T’k are within the
color gamut (range) of R-G-B system.
References
• Richard Szeliski, Computer Vision: Algorithms and Applications,
Springer 2010

Weitere ähnliche Inhalte

Was ist angesagt?

Image enhancement techniques
Image enhancement techniquesImage enhancement techniques
Image enhancement techniques
Saideep
 
Enhancement in frequency domain
Enhancement in frequency domainEnhancement in frequency domain
Enhancement in frequency domain
Ashish Kumar
 
Image enhancement
Image enhancementImage enhancement
Image enhancement
Ayaelshiwi
 

Was ist angesagt? (20)

Image enhancement
Image enhancementImage enhancement
Image enhancement
 
Introduction to image contrast and enhancement method
Introduction to image contrast and enhancement methodIntroduction to image contrast and enhancement method
Introduction to image contrast and enhancement method
 
Image enhancement techniques
Image enhancement techniquesImage enhancement techniques
Image enhancement techniques
 
Spatial Filters (Digital Image Processing)
Spatial Filters (Digital Image Processing)Spatial Filters (Digital Image Processing)
Spatial Filters (Digital Image Processing)
 
Spatial domain and filtering
Spatial domain and filteringSpatial domain and filtering
Spatial domain and filtering
 
Histogram based enhancement
Histogram based enhancementHistogram based enhancement
Histogram based enhancement
 
Lecture 14 Properties of Fourier Transform for 2D Signal
Lecture 14 Properties of Fourier Transform for 2D SignalLecture 14 Properties of Fourier Transform for 2D Signal
Lecture 14 Properties of Fourier Transform for 2D Signal
 
Image segmentation
Image segmentation Image segmentation
Image segmentation
 
Digital Image restoration
Digital Image restorationDigital Image restoration
Digital Image restoration
 
Enhancement in frequency domain
Enhancement in frequency domainEnhancement in frequency domain
Enhancement in frequency domain
 
Image Enhancement - Point Processing
Image Enhancement - Point ProcessingImage Enhancement - Point Processing
Image Enhancement - Point Processing
 
Filtering an image is to apply a convolution
Filtering an image is to apply a convolutionFiltering an image is to apply a convolution
Filtering an image is to apply a convolution
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
Image Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain FiltersImage Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain Filters
 
Image enhancement
Image enhancementImage enhancement
Image enhancement
 
03 digital image fundamentals DIP
03 digital image fundamentals DIP03 digital image fundamentals DIP
03 digital image fundamentals DIP
 
Image enhancement techniques
Image enhancement techniques Image enhancement techniques
Image enhancement techniques
 
Image Enhancement
Image Enhancement Image Enhancement
Image Enhancement
 
Unit3 dip
Unit3 dipUnit3 dip
Unit3 dip
 
Image Restoration (Digital Image Processing)
Image Restoration (Digital Image Processing)Image Restoration (Digital Image Processing)
Image Restoration (Digital Image Processing)
 

Ähnlich wie Image enhancement

12-Image enhancement and filtering.ppt
12-Image enhancement and filtering.ppt12-Image enhancement and filtering.ppt
12-Image enhancement and filtering.ppt
AJAYMALIK97
 
Digital Image Processing_ ch2 enhancement spatial-domain
Digital Image Processing_ ch2 enhancement spatial-domainDigital Image Processing_ ch2 enhancement spatial-domain
Digital Image Processing_ ch2 enhancement spatial-domain
Malik obeisat
 

Ähnlich wie Image enhancement (20)

Image processing second unit Notes
Image processing second unit NotesImage processing second unit Notes
Image processing second unit Notes
 
Chap5 imange enhancemet
Chap5 imange enhancemetChap5 imange enhancemet
Chap5 imange enhancemet
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial Domain
 
Module 2
Module 2Module 2
Module 2
 
DIP Lecture 7-9.pdf
DIP Lecture 7-9.pdfDIP Lecture 7-9.pdf
DIP Lecture 7-9.pdf
 
DIP Notes Unit-1 PPT.pdf
DIP Notes Unit-1 PPT.pdfDIP Notes Unit-1 PPT.pdf
DIP Notes Unit-1 PPT.pdf
 
DIP Notes Unit-1 PPT , engineering, computer Science
DIP Notes Unit-1 PPT , engineering, computer ScienceDIP Notes Unit-1 PPT , engineering, computer Science
DIP Notes Unit-1 PPT , engineering, computer Science
 
Image enhancement ppt nal2
Image enhancement ppt nal2Image enhancement ppt nal2
Image enhancement ppt nal2
 
Chapter 3 image enhancement (spatial domain)
Chapter 3 image enhancement (spatial domain)Chapter 3 image enhancement (spatial domain)
Chapter 3 image enhancement (spatial domain)
 
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
 
12-Image enhancement and filtering.ppt
12-Image enhancement and filtering.ppt12-Image enhancement and filtering.ppt
12-Image enhancement and filtering.ppt
 
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
 
aip.pptx
aip.pptxaip.pptx
aip.pptx
 
Image enhancement in spatial domain.ppt
Image enhancement in spatial domain.pptImage enhancement in spatial domain.ppt
Image enhancement in spatial domain.ppt
 
Lecture-11.pdf
Lecture-11.pdfLecture-11.pdf
Lecture-11.pdf
 
Digital Image Processing_ ch2 enhancement spatial-domain
Digital Image Processing_ ch2 enhancement spatial-domainDigital Image Processing_ ch2 enhancement spatial-domain
Digital Image Processing_ ch2 enhancement spatial-domain
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
 
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 lecture
Image enhancement lectureImage enhancement lecture
Image enhancement lecture
 
Digital image processing - Image Enhancement (MATERIAL)
Digital image processing  - Image Enhancement (MATERIAL)Digital image processing  - Image Enhancement (MATERIAL)
Digital image processing - Image Enhancement (MATERIAL)
 

Mehr von Kuppusamy P

Mehr von Kuppusamy P (20)

Recurrent neural networks rnn
Recurrent neural networks   rnnRecurrent neural networks   rnn
Recurrent neural networks rnn
 
Deep learning
Deep learningDeep learning
Deep learning
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
Feature detection and matching
Feature detection and matchingFeature detection and matching
Feature detection and matching
 
Flowchart design for algorithms
Flowchart design for algorithmsFlowchart design for algorithms
Flowchart design for algorithms
 
Algorithm basics
Algorithm basicsAlgorithm basics
Algorithm basics
 
Problem solving using Programming
Problem solving using ProgrammingProblem solving using Programming
Problem solving using Programming
 
Parts of Computer, Hardware and Software
Parts of Computer, Hardware and Software Parts of Computer, Hardware and Software
Parts of Computer, Hardware and Software
 
Strings in java
Strings in javaStrings in java
Strings in java
 
Java methods or Subroutines or Functions
Java methods or Subroutines or FunctionsJava methods or Subroutines or Functions
Java methods or Subroutines or Functions
 
Java arrays
Java arraysJava arrays
Java arrays
 
Java iterative statements
Java iterative statementsJava iterative statements
Java iterative statements
 
Java conditional statements
Java conditional statementsJava conditional statements
Java conditional statements
 
Java data types
Java data typesJava data types
Java data types
 
Java introduction
Java introductionJava introduction
Java introduction
 
Logistic regression in Machine Learning
Logistic regression in Machine LearningLogistic regression in Machine Learning
Logistic regression in Machine Learning
 
Anomaly detection (Unsupervised Learning) in Machine Learning
Anomaly detection (Unsupervised Learning) in Machine LearningAnomaly detection (Unsupervised Learning) in Machine Learning
Anomaly detection (Unsupervised Learning) in Machine Learning
 
Machine Learning Performance metrics for classification
Machine Learning Performance metrics for classificationMachine Learning Performance metrics for classification
Machine Learning Performance metrics for classification
 
Machine learning Introduction
Machine learning IntroductionMachine learning Introduction
Machine learning Introduction
 
Reinforcement learning, Q-Learning
Reinforcement learning, Q-LearningReinforcement learning, Q-Learning
Reinforcement learning, Q-Learning
 

Kürzlich hochgeladen

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Kürzlich hochgeladen (20)

80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 

Image enhancement

  • 2. Content • Image enhancement • Spatial domain enhancement – Point operations, Spatial operations – Digital Negative – Contrast Stretching – Thresholding – Gray level slicing – Bit plane slicing – Dynamic range compression – Histogram modeling – Adaptive Histogram Equalization • Frequency domain enhancement – Fourier Transforms / Spectral (Frequency) Analysis • Color Image – Color Image Enhancement
  • 3. Image Enhancement • Image enhancement is improving the perception of information in images for human viewers. • Also, providing better input for the further image processing techniques. • It accentuates or sharpens image features such as edges, boundaries, or contrast to make a graphic display more helpful for display and analysis. • The enhancement doesn't increase the inherent information content of the data, but it increases the dynamic range of the chosen features that can be detected easily. Image enhancement methods: 1. Spatial domain enhancement – operate on pixels directly 1. Point operations 2. Spatial operations (Based on Filtering) 2. Frequency domain enhancement – operate on the Fourier transform of an image
  • 4. Spatial Domain Enhancement • Spatial domain techniques are performed to the image plane itself. • Its working with pixel values or raw data of an image. • The operation is g(x, y) = T[f(x, y)], g is the modified output image, f is the input original image and T [ . ] is an transformation operation on f defined over some neighborhood of (x, y). • Based on the operations on the image pixels, it is divided into 3 categories: 1. Point processing 2. Neighborhood processing 3. Histogram based approach. • The 2D convolution is performed in Spatial domain: g(x, y)= f(x, y) * h(x, y) • Figure shows the image size 256 x 256 pixels from (0,0) to (255, 255) (255, 255) (0, 0)
  • 5. 1. Point Processing (Operations) / Greyscale transformation x • The new grey level (color) value in a spatial location (m, n) in the resulting image depends only on the grey level (color) in the same spatial location (m, n) in the original image/ m m n n U[M×N] V[M×N] Point-wise operation (grey scale transformation) f(∙) => v=f(u) u(m, n) v(m, n) = f(u(m, n)) ∀m = 0, 1, .. M-1 ∀n = 0, 1, .. N-1
  • 6. Point Processing (Operations) / Greyscale transformation • It works on single pixel at a time i.e. T is 1 x 1 operator. • Transfer function is S = T(r) • S – processed point image • r – point to be processed Examples of point processing are: • Digital Negative • Contrast Stretching • Thresholding • Gray level slicing • Bit plane slicing • Dynamic range compression
  • 7. Point Processing (Operations) / Greyscale transformation • Point operations are zero-memory operations where a given gray level r[0, L-1] is mapped to another gray level s[0, L-1] according to a transformation. L = 256 ) (x f y = L L x y
  • 8. Digital Negative • Negative image is obtained by reverse (inverse) scaling of the gray levels of the transformation, v = L- u and umax = 255 • Useful in the display of medical images (X-ray). • L is total number of gray levels i.e. 255 • But, Generally L range is (0 -255). • So, v = (L -1) - u i.e. v = (256-1) – u. L u 0 L v Input intensity O/p Gray level
  • 9. Contrast Stretching • Contrast stretching increases the dynamic range of the gray levels in the image. • Low contrast images occur due to poor or non-uniform lightning conditions, small dynamic range of imaging sensors.        + −   + −   = L u b v b u b u a v a u a u u v b a ) ( ) ( 0    L u 0 a b va vb 200 , 30 , 1 , 2 , 2 . 0 , 150 , 50 = = = = = = = b a y y b a    • For dark region stretch α >1, a=L/3 i.e. slope < 1 • For mid region stretch β>1 ,b=2/3L • For bright region stretch γ>1 i.e. slope > 1 Dotted line – Identity transformation Solid line – Contrast Stretching
  • 10. Clipping and Thresholding • Clipping is a special case of contrast stretching, where α= γ=0 • Useful for noise reduction when the input signal is known and the range is [a, b] i.e. valley between the peaks of the histogram. • It is used for binary or other images that have bimodal distribution of gray levels. • Thresholding is extreme contrast stretching where a = b = t and the output comes as binary. F f(u) 0 nu L , , , 0 u a a u b b u L =            V U a b V U Clipping Thresholding u1 = u2 v1 =0, v2 = L -1
  • 11. Intensity level Slicing • Permit segmentation of certain gray level regions from the rest of the image.      = otherwise b u a L v , 0 ,      = otherwise u b u a L v , , • Transformation highlights range [A, B] of gray levels and reduces all others to a constant level. • Transformation highlights range [A, B], but preserves all other level.
  • 12. Bit (extraction) level Slicing • This transformation is useful in determining the number of visually significant bits in an Image. • Suppose each pixel is represented by 8 bits it is desired to extract the nth most significant bit and display it . • Higher-order bits contain the majority of the visually significant data
  • 13. Range Compression (Log Transformation) • Sometime, dynamic range of image exceeds the capability of display device. So it need to compressed. • Log operator is an excellent compression function. • Dynamic range compression is achieved using log operator. • c – normalization constant and u – input intensity ) 1 ( log10 u c v + = L u 0 v L
  • 14. 2. Local neighborhood operations • Operation performs on local neighborhoods of input pixels. • Image is convolved with Finite Impulse Response (FIR) filter (Spatial mask) Local neighborhood methods: • Min – Set the pixel value to the minimum in the neighborhood pixel • Max – Set the pixel value to the maximum in the neighborhood pixel • Median – Set the pixel value to the midpoint of the neighborhood pixels. • Mean - Set the pixel value to the mean of the neighborhood pixels.
  • 15. 3. Histogram modeling • Image Histogram is a graphical representation of the lightness/color distribution in a digital image. It plots the number of pixels for each value. • Histogram of a digital gray image range [0, L-1] is a discrete function h(rk) = nk – rk is the kth gray level (value) pixel – nk is the number of pixels in the image having gray level rk. 0 50 100 150 200 0 500 1000 1500 2000 2500 3000
  • 16. Histogram modeling • Normalize a histogram by dividing each of its values by the total number of pixels in the image n. Normalized histogram p(rk) = nk / n, for k = 0, 1, …, L -1. • nk is number of pixels of the gray value rk • p(rk) estimation of the probability of occurrence of gray level rk. • The sum of all components of a normalized histogram is equal to 1. Why Histogram modeling is need? • Histograms are the basis for numerous spatial domain processing techniques. • Histogram manipulation can be used effectively for image enhancement. • Histograms can be used to provide useful image statistics. • Information derived from histograms are quite useful in other image processing applications, such as image compression and segmentation.
  • 17. Why Histogram modeling is need? 0 50 100 150 200 250 0 0.5 1 1.5 2 2.5 3 3.5 4 x 10 4 Histogram information reveals that image is under-exposed
  • 18. Why Histogram modeling is need? Histogram information reveals that image is over-exposed 0 50 100 150 200 250 0 1000 2000 3000 4000 5000 6000 7000
  • 19. 3. Histogram Equalization – Adjust the image pixel values • Find a map f(x) such that the histogram of the modified (equalized) image is flat (uniform). • Cumulative Probability Function (cdf) of a random variable approximates a uniform distribution  = = x t t h x s 0 ) ( ) ( h(t) is the histogram (pdf)  =  = x t t h L y 0 ) ( Uniform Quantization  = = L t t h 0 1 ) ( Note: L 1  = = x t t h s 0 ) ( x L y 0 cumulative probability function
  • 20. Histogram Comparison 0 50 100 150 200 0 500 1000 1500 2000 2500 3000 0 50 100 150 200 250 300 0 500 1000 1500 2000 2500 3000 before equalization after equalization
  • 24. Histogram Equalization Original Histogram Transformation Function Equalized Histogram
  • 25. 3.1. Adaptive Histogram Equalization • Instead of doing histogram equalization using the whole image, compute the distribution for a moving window around the given pixel. • Computes several histograms, each corresponding to a distinct section of the image, and uses them to redistribute the lightness values of the image. • It improves the local contrast and enhancing the definitions of edges in each region of an image.
  • 26. Frequency Domain Enhancement • The image f(x,y) is transferred into frequency domain i.e. Compute the Fourier Transform (Discrete Fourier Transform) of the image. • Enhancement operations (brightness, contrast) performed on Fourier Transform of image, then find Inverse Fourier Transform for the enhanced image. • G(u, v) = F(u, v) H(u, v) - Frequency domain representation • When applying transformation function on input image pixels modifies the pixel values in the output image. H(u, v) F(u, v) H(u, v) F(u, v)
  • 27. Fourier Transforms / Spectral (Frequency) Analysis • Fourier Transform decomposes an image into its sine and cosine components. • The output of the transformation represents the image in the Fourier or frequency domain, while the input image is the spatial domain equivalent. • In the Fourier domain image, each point represents a particular frequency contained in the spatial domain image. • For digital images, Discrete Fourier Transform (DFT) is sufficient to use spatial domain image. i.e. the image in the spatial and Fourier domain are of the same size. • FT produces a complex number valued output image which can be displayed with two images, either real and imaginary part or with magnitude and phase. • In image processing, the magnitude of the FT contains most of the information of the geometric structure of the spatial domain image. • However, if want to re-transform the Fourier image into the correct spatial domain after some processing in the frequency domain, must preserve both magnitude and phase of the Fourier image. • The Fourier domain image has a much greater range than the image in the spatial domain. For good accuracy, its values are calculated and stored in float values. • DFT takes O(n2) operations, but Fast Fourier Transform (FFT) takes O(n log2n) operations
  • 28. Fourier Transforms properties • Superposition: The FT of a sum of signals is the sum of their Fourier transforms. Thus, the Fourier transform is a linear operator. • Shift: The FT of a shifted signal is the transform of the original signal multiplied by a linear phase shift (complex sinusoid). • Reversal: The FT of a reversed signal is the complex conjugate of the signal’s transform. • Convolution: The FT of a pair of convolved signals is the product of their transforms. • Correlation: The FT of a correlation is the product of the first transform times the complex conjugate of the second one. • Multiplication: The FT of the product of two signals is the convolution of their transforms. • Differentiation: The FT of the derivative of a signal is that signal’s transform multiplied by the frequency. In other words, differentiation linearly emphasizes (magnifies) higher frequencies. • Domain scaling: The FT of a stretched signal is the equivalently compressed (and scaled) version of the original transform and vice versa. • Real images: The FT of a real-valued signal is symmetric around the origin. This fact can be used to save space and to double the speed of image FFTs by packing alternating scanlines into the real and imaginary parts of the signal being transformed. • Parseval’s Theorem: The energy (sum of squared values) of a signal is the same as the energy of its Fourier transform.
  • 29. Frequency Domain Enhancement • Finite curves of image can be expressed as the integral of sines/cosines multiplied by a weighing function. Steps of filtering in the frequency domain 1. Calculate the DFT of the image f(u, v) 2. Generate a frequency domain filter H – H(u, v) and F(u, v) should have the same size » H(u, v) should NOT be centered. Centered H(u, v) is for displaying purpose only. » If H(u, v) is centered, F(u, v) needs to be centered too and some post- processing is required. » H(u, v) is located at top-left corner 3. Multiply F(u, v) with filter function H (u, v) (element by element). G(u, v) = H(u, v) F(u, v) 4. Compute the inverse of DFT result G(u, v) . 5. Take the real part of the IDFT v)) (G(u, age filteredim  =
  • 30. Construct Frequency Domain from Spatial Domain filter Calculate the DFT of the image f(u, v) - Given image f and spatial filter 9 x 9 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 81 1 image f Spatial filter h 9 x 9 DFT of image
  • 31. Construct Frequency Domain from Spatial Domain filter – H(u, v) and F(u, v) should have the same size » If H(u, v) is centered, F(u, v) needs to be centered too and expand it. » H(u, v) is located at top-left corner 300 300 9 9 300 9 9 300 DFT of filter DFT of filter frequency domain representation
  • 32. Construct Frequency Domain from Spatial Domain filter Multiply DFT of F(u, v) with DFT of expanded H (u, v) (element by element) G(u, v) = H(u, v) F(u, v) not centered F not centered H not centered F∙H Centered F Centered F∙H Centered H
  • 33. Frequency Domain Enhancement Compute the inverse of DFT result G(u, v) and Take real part of IDFT From Centered From Not centered
  • 34. Direct Construction of Frequency Domain Filters • Ideal LowPass Filters (ILPF) – Cut off all high-frequency components of the Fourier transform that are at a distance greater than a specified distance D0 (cut off frequency) from the origin of the (centered) transform – The transfer function (frequency domain filter) is defined by – D(u,v) is the distance from point (u, v) to the origin (center) of the frequency domain filter. – Usually, the image to be filtered is even-sized, but, in this case, the center of the filter is (M/2,N/2). – Then the distance D(u,v) can be obtained by ) , ( if 0 ) , ( if 1 ) , ( 0 0      = D v u D D v u D v u H ] ) 2 / ( ) 2 / [( ) , ( 2 / 1 2 2 N v M u v u D − + − =
  • 35. • Determine the cutoff frequency D0 – Compute circles that enclose specified amounts of total image power PT.   − = = − = = = 1 0 1 0 2 | ) , ( | M u u N v v T v u F P    T D v u D P v u F / ) | ) , ( | ( 0 ) , ( 2 ILPF transfer function plot Filter displayed as a image Filter radial cross section
  • 36. • As the filter radius increases, very less power is removed/filtered out, but more details are preserved. • Ringing effect is clear in most cases except for the last one. • Ringing effect is the consequence of applying ideal lowpass filters Image 500 x 500 Fourier spectrum Circles radii 5, 15, 30, 80, 230
  • 37. Color Image • Color is a reflection of wavelengths back to the eyes. • The visible spectrum shows the wavelengths of each of the component color. • Color Scheme is the combination of colors 1. Achromatic color - have lightness but no dominant hue or saturation. Ex. white, grey and black 2. Monochromatic - comprised of variations of one color. 3. Chromatic color scheme - Any color in which one particular wavelength or hue predominates. Ex. blue and green Achromatic No color Monochromatic Single Color Chromatic Having color
  • 38. Color Image properties Color Appearance Parameters • Hue: dominant color corresponding to a dominant wavelength of mixture light wave • Saturation / Chroma / Colorfulness: Relative purity or amount of white light mixed with a hue (inversely proportional to amount of white light added) • Brightness / lightness: Intensity of the pixel • Opacity / Transparency: Indicates the element is fully transparent or not.
  • 39. Color Image Enhancement • Improves the color balance or contrast of the color image Enhancement of color image: • The input color coordinates of each pixel are independently transformed into another set of color coordinates. • Apply enhancement algorithm for individual monochrome images. • Since each image plane Tk (m, n),k=1,2,3 is enhanced independently, care has to be taken so that the enhanced coordinates T’k are within the color gamut (range) of R-G-B system.
  • 40. References • Richard Szeliski, Computer Vision: Algorithms and Applications, Springer 2010