Beruflich Dokumente
Kultur Dokumente
DI&SP - 405017
1 / 91
Outline
1 Introduction
2 Histogram
3 Some Basic Intensity Transformation Functions
4 Histogram Processing
DI&SP - 405017
2 / 91
Learning Outcomes
After learning this chapter, you will be able to:
Illustrate the effect of power-law & logarithmic histogram transforms
Describe the basis of the histogram as a Probability Density
Function (PDF)
Distinguish between the brightness and the contrast of an image
Explain the relationship between dynamic range and contrast
Explain the effects of histogram stretch, histogram equalization,
histogram matching, histogram modification & distinguish between
them
DI&SP - 405017
3 / 91
DI&SP - 405017
4 / 91
Outline
1 Introduction
- Motivation
- Type of operations
- Spatial domain
DI&SP - 405017
5 / 91
DI&SP - 405017
6 / 91
Introduction
Motivation
Introduction
Motivation
DI&SP - 405017
7 / 91
DI&SP - 405017
8 / 91
Introduction
Motivation
Introduction
Motivation
9 / 91
DI&SP - 405017
Introduction
Motivation
DI&SP - 405017
10 / 91
Introduction
Type of operations
DI&SP - 405017
11 / 91
Introduction
Type of operations
Operation
Point
Local
Global
Characterization
The output value at a specific coordinate is dependent only on the
input value at that same coordinate
The output value at a specific coordinate is dependent on the input
values in the neighborhood of that
same coordinate.
The output value at a specific coordinate is dependent on all the values
in the input image.
Generic Complexity/Pixel
Constant
DI&SP - 405017
12 / 91
Introduction
Type of operations
Domains
DI&SP - 405017
13 / 91
Introduction
Type of operations
DI&SP - 405017
14 / 91
Introduction
Type of operations
Point processing
Spatial processing
Contrast stretching:
Neighborhood
cessing:
pro-
Frequency
domain
processing
Linear filtering:
Low pass
Clipping
Averaging
Directional
High-pass
nonlinear
filtering
smoothing
Median filtering
Homomorphic
filtering
Unsharp
masking
Histogram techniques:
Equalization
Histogram specification
(matching)
15 / 91
DI&SP - 405017
Introduction
Spatial domain
image.
Spatial domain methods are procedures that operate directly on
these pixels. Spatial domain processes will be denoted by the
expression:
,
{ , }
(1.1)
linear or nonlinear.
(0,0)
(0,0)
DI&SP - 405017
16 / 91
Histogram
Histogram of a monochrome image with gray levels in the range
, :
A discrete function, ,
, , . . . , .
: the th gray level.
the number of pixels in the image having gray level .
, , , . . . , .
DI&SP - 405017
17 / 91
Example
Sketch the histogram of the following image:
0
5
6
0
6
2
0
6
2
7
1
6
1
0
6
0
7
2
5
1
5
1
5
6
0
4
6
1
4
2
3
3
0
4
1
5
3
6
7
7
2
5
4
3
2
1
0
0 1 2 3 4 5 6 7
DI&SP - 405017
18 / 91
Example
Sketch the normalized histogram of the following image:
6
0
6
2
0
0
0.2
1
0.16
6
2
7
1
6
2
0.12
1
0
6
0
7
3
0
2
5
1
5
1
4
0.04
5
6
0
4
6
0.28
5
0.12
6
0.28
7
0.08
0.2
0.16
0.12
0.08
0.04
0
0 1 2 3 4 5 6 7
DI&SP - 405017
19 / 91
Histogram
The following two images have the same histograms:
The histogram shows the number of pixels that have each pixel
value, but it does not record where those pixels are located in the
image. Thus, spatial information is discarded.
The histogram is unique for a particular image, but different images
DI&SP - 405017
20 / 91
Histogram
The information inherent in histograms also is quite useful in other
Dark image
Light image
Low contrast
High contrast
DI&SP - 405017
21 / 91
Histogram
Dark image
DI&SP - 405017
22 / 91
Histogram
Light image
DI&SP - 405017
23 / 91
Histogram
Low contrast
DI&SP - 405017
24 / 91
Histogram
High contrast
DI&SP - 405017
25 / 91
Histogram
Dynamic range:
The range of pixel values, defined as the difference between the
maximum ( ) the minimum (
) pixel values found in the
image, ignoring any obvious outliers.
It can be expressed either as the difference in pixel values or dB:
DI&SP - 405017
(2.1)
26 / 91
Outline
3 Some Basic Intensity Transformation Functions
- Point operations
- Identity
- Image Negatives
- Gamma Transformations
- Log Transformations
- Piecewise-Linear Transformations
- Bit Plane Slicing
27 / 91
DI&SP - 405017
(0,0)
DI&SP - 405017
28 / 91
DI&SP - 405017
29 / 91
DI&SP - 405017
30 / 91
DI&SP - 405017
31 / 91
Power-Law transformations:
or
, , > 0.
Values of such that < < map a narrow range of dark input
pixels vales into a wider range of output values, with opposite being
true for higher values of input levels (brighten the intensity).
Values > 1 have the opposite behavior to above (darken the
intensity).
DI&SP - 405017
32 / 91
DI&SP - 405017
33 / 91
DI&SP - 405017
34 / 91
DI&SP - 405017
35 / 91
DI&SP - 405017
36 / 91
DI&SP - 405017
37 / 91
DI&SP - 405017
38 / 91
output range.
The opposite is true for high intensity input values.
Compresses the dynamic range of images with large variations in
pixel values. (The dynamic range of the image data may be very
large -> Dynamic range can be compresses via the logarithmic
transformation).
DI&SP - 405017
39 / 91
DI&SP - 405017
40 / 91
DI&SP - 405017
41 / 91
DI&SP - 405017
42 / 91
<
<
DI&SP - 405017
(3.2)
43 / 91
DI&SP - 405017
44 / 91
DI&SP - 405017
45 / 91
DI&SP - 405017
46 / 91
This transformation
This transformation
DI&SP - 405017
47 / 91
DI&SP - 405017
48 / 91
. Imagine that the image is composed of eight 1-bit
planes, ranging from bit-plane 0, the Least Significant Bit
(Lowest-order bit, ) to bit-plane 7, the Most Significant Bit
(Highest-order bit, .
Each bit plane is a binary image
49 / 91
DI&SP - 405017
specific bits
Higher-order bits usually contain most of the significant visual
information.
Lower-order bits contain subtle details.
Useful for compression.
We have to use bit get and bit set to extract 8 images:
136
24
33
11
67
17
1
7
3
0
0
1
1
1
1
1
1
1
0
0
0
1
1
0
0
1
1
0
0
0
0
0
0
0
1
0
1
1
0
1
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
1
0
0
0
0
0
0
0
0
DI&SP - 405017
50 / 91
DI&SP - 405017
51 / 91
DI&SP - 405017
52 / 91
Outline
4 Histogram Processing
- Histogram Equalization
- Histogram matching or Histogram specification
- Local Histogram Processing
- Using Histogram Statistics for Image Enhancement
DI&SP - 405017
53 / 91
Histogram Processing
Histogram Equalization
6 6
(4.1)
Dr. Che Viet Nhat Anh
DI&SP - 405017
54 / 91
Histogram Processing
Histogram Equalization
histogram.
The transformation function satisfies the following conditions:
is a monotonically increasing function in the interval
6 6 .
6 6 for 6 6 .
is continuous and differentiable.
DI&SP - 405017
55 / 91
Histogram Processing
Histogram Equalization
DI&SP - 405017
56 / 91
Histogram Processing
Histogram Equalization
Continuous case:
(4.2)
be low to keep .
is low, has a shallow slope, will be narrow, causing
to be high to keep .
DI&SP - 405017
57 / 91
Example
Suppose that the (continuous) intensity values in an image have the
Probability Density Function (PDF)
for 6 6
otherwise
Find the transformation function for equalizing the image histogram.
DI&SP - 405017
58 / 91
Example
The histograms of two images are illustrated below. Sketch a
transformation function for each image that will make the image has a
better contrast. Use the axis provided below to sketch your
transformation functions.
20
128
100
200
100
200
20
128
DI&SP - 405017
59 / 91
Histogram Processing
Histogram Equalization
, , . . . ,
(4.3)
(4.4)
DI&SP - 405017
60 / 91
Example
Suppose that a 3-bit image ( = 8 intensity levels) of size 64 64 pixels
( = 4096) has the intensity distribution shown in following table.
0
790
1
1023
2
850
3
656
4
329
5
245
6
122
7
81
DI&SP - 405017
61 / 91
Example
1
0
0.193
1
0.25
2
0.208
3
0.16
4
0.08
5
0.06
6
0.03
7
0.02
0.25
0.2
0.15
0.1
0.05
0 1 2 3 4 5 6 7
DI&SP - 405017
62 / 91
Example
2
790
1813
2663
3319
3648
3893
4015
4096
1.33
3.08
4.55
5.67
6.03
6.65
6.86
7
5.67
4.55
7
6
5
3.08
1.33
1 2 3 4 5 6 7
Dr. Che Viet Nhat Anh
1 2 3 4 5 6 7
DI&SP - 405017
63 / 91
Example
3
0
0
0
1
790
0.19
2
0
0
3
1023
0.25
4
0
0
5
850
0.20
6
985
0.24
7
448
0.12
0.25
0.2
0.15
0.1
0.05
0 1 2 3 4 5 6 7
DI&SP - 405017
64 / 91
DI&SP - 405017
65 / 91
DI&SP - 405017
66 / 91
Dr. Che Viet Nhat Anh
DI&SP
- 405017
67 / 91
Dr. Che Viet Nhat Anh
DI&SP
- 405017
68 / 91
Histogram
Transformation function for histogram equalization:
DI&SP - 405017
69 / 91
Histogram Processing
Histogram Equalization
DI&SP - 405017
70 / 91
Histogram Processing
Histogram equalization
equalization?
If it can, why histogram equalization then?
Histogram equalization (HE) results are similar to contrast stretching
DI&SP - 405017
71 / 91
Histogram Processing
Histogram matching or Histogram specification
Histogram
Matching
DI&SP - 405017
72 / 91
Histogram Processing
Histogram matching or Histogram specification
(4.5)
(4.6)
Histogram
Equalization
(4.7)
Histogram
Equalization
DI&SP - 405017
73 / 91
Example
Assuming continuous intensity values, suppose that an image has the
intensity PDF:
for 6 6
otherwise
Find the transformation function that will produce an image whose
intensity PDF is:
for 6 6
otherwise
DI&SP - 405017
74 / 91
Example
1
DI&SP - 405017
75 / 91
Histogram Processing
Histogram matching or Histogram specification
Discrete Cases:
Obtain from the input image then obtain the values of ,
round the value to the integer range , :
(4.8)
(4.9)
(4.10)
DI&SP - 405017
76 / 91
Example
Suppose that a 3-bit image ( = 8) of size 64 64 pixels ( = 4096)
has the intensity distribution shown in the following table (on the left).
Get the histogram transformation function and make the output image
with the specified histogram, listed in the table at the bottom.
0
790
1
1023
0
0
2
850
1
0
2
0
3
656
3
0.15
4
329
4
0.2
5
245
5
0.3
6
122
6
0.2
7
81
7
0.15
77 / 91
DI&SP - 405017
Example
1
790
1813
2663
3319
3648
3893
4015
4096
1.33
1
3.08
3
4.55
5
5.67
6
6.03
6
6.65
7
6.86
7
7
7
0.15
0.35
0.65
0.85
0
0
0
0
0
0
1.05
1
2.45
2
3.55
5
5.95
6
7
7
DI&SP - 405017
78 / 91
Example
3
Relate the two mapping above to build a lookup table for the over
all mapping. Specifically, for each input level , find an output level
so that best matches .
0
0
0
1
0
0
0
1
0
1
3
0
2
5
0
2
0
0
3
790
0.19
3
6
1
4
6
2
4
1023
0.25
0.3
0.2
0.15
5
7
5
6
7
6
5
850
0.21
7
7
7
6
985
0.24
7
448
0.11
0.25
0.19
0.11
0 1 2 3 4 5 6 7 Digital
0 1 2 3 DI&SP
4 5 6- 405017
7
Image & Speech Processing
DI&SP - 405017
79 / 91
80 / 91
DI&SP - 405017
81 / 91
DI&SP - 405017
82 / 91
Histogram Processing
Histogram matching or Histogram specification
DI&SP - 405017
83 / 91
Histogram Processing
Local Histogram Processing
transformation where:
Function is designed according to the gray-level distribution over an
entire image
Global transformation methods may not be suitable for enhancing
details over small areas
Where number of pixels in these small areas may have negligible
influence on designing the global transformation function
To enhance details over small areas in an image
Procedure:
Define a neighborhood (e.g. )
Move it from pixel to pixel.
For every pixel:
Histogram computed for the neighborhood.
Transfer function computed for Histogram sHistogram specification
or Histogram specification.
Applied on Centre Pixel.
Dr. Che Viet Nhat Anh
DI&SP - 405017
84 / 91
Histogram Processing
Local Histogram Processing
DI&SP - 405017
85 / 91
Histogram Processing
Using Histogram Statistics for Image Enhancement
Global statistics:
The mean (average) intensity is given by
,
(4.11)
,
(4.12)
The th moment of the intensity variable is
(4.13)
DI&SP - 405017
86 / 91
Histogram Processing
Using Histogram Statistics for Image Enhancement
.
.
DI&SP - 405017
87 / 91
Histogram Processing
Using Histogram Statistics for Image Enhancement
centered at , :
Local average intensity:
(4.14)
(4.15)
Local variance:
DI&SP - 405017
88 / 91
Histogram Processing
Using Histogram Statistics for Image Enhancement
filament.
Enhance details in dark areas
DI&SP - 405017
89 / 91
Histogram Processing
Using Histogram Statistics for Image Enhancement
DI&SP - 405017
90 / 91
Histogram Processing
Using Histogram Statistics for Image Enhancement
DI&SP - 405017
91 / 91