Sie sind auf Seite 1von 46

4border code=

Image Enhancement in the Spatial Domain


Lec 03: Intensity Transformations

Dr. Ch Vit Nht Anh


nhat-anh.che@{hcmut.edu.vn,hotmail.com}
Department of Telecommunications Engineering
Faculty of Electrical and Electronic Engineerings
Ho Chi Minh City, University of Technology
HK I, 2015 - 2016
Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

1 / 91

Outline
1 Introduction
2 Histogram
3 Some Basic Intensity Transformation Functions
4 Histogram Processing

Dr. Che Viet Nhat Anh

Digital Image & Speech 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

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

3 / 91

"It makes all the difference whether one sees


darkness through the light or brightness through the
shadows
David Lindsay (Scottish Novelist)

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

4 / 91

Outline
1 Introduction
- Motivation
- Type of operations
- Spatial domain

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

5 / 91

DI&SP - 405017

6 / 91

Introduction
Motivation

Which one looks better?

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

Introduction
Motivation

Which one looks better?

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

7 / 91

DI&SP - 405017

8 / 91

Introduction
Motivation

Which one looks better?

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

Introduction
Motivation

Which one looks better?

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

9 / 91

DI&SP - 405017

Introduction
Motivation

Close-by pixel values are difficult to distinguish.


Far apart pixel values are easy to distinguish.
Low contrast: image values concentrated near a narrow range

(mostly dark, or mostly bright, or mostly medium values).


Contrast enhancement change the image value distribution to

cover a wide range.


Contrast of an image can be revealed by its histogram.
Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

10 / 91

Introduction
Type of operations

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

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

 
 

Image size = ; Neighborhood size =


 
 .
The complexity is specified in operations per pixel.
Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

12 / 91

Introduction
Type of operations

Domains

Spatial Domain Processing

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

13 / 91

Introduction
Type of operations

Spatial domain: Image plane itself, directly process the intensity

values of the image plane.


Point Operation (Intensity Transformations Function)
Gamma correction, window-center correction, histogram
equalization,...
Spatial filters (Neighborhood Operation)
Correlation
Convolution (Filtering): mean, Gaussian, median, etc.
Image gradients,...

Transform domain (Frequency domain, Wavelet domain) Process

the transform coefficients, not directly process the intensity values


of the image plane.

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

14 / 91

Introduction
Type of operations

Point processing

Spatial processing

Contrast stretching:

Neighborhood
cessing:

Gray level transform

pro-

Frequency
domain
processing
Linear filtering:
Low pass

Clipping

Averaging

Intensity Level slicing

Directional

High-pass

nonlinear
filtering

smoothing
Median filtering

Homomorphic

filtering

Unsharp

masking
Histogram techniques:
Equalization
Histogram specification

(matching)

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

15 / 91

DI&SP - 405017

Introduction
Spatial domain

Spatial domain refers to the aggregated of pixels composing an

image.
Spatial domain methods are procedures that operate directly on
these pixels. Spatial domain processes will be denoted by the
expression:

 ,  

{  ,  }

(1.1)

: an operator defined over some neighborhood of ( ,  ), maybe

linear or nonlinear.
(0,0)

Dr. Che Viet Nhat Anh

(0,0)

Digital Image & Speech Processing

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 .

Normalized histogram: An estimate of the probability of

occurrence of gray level

, , , . . . , .

The sum of all components of a normalized histogram is equal to 1.

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

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

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

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

Dr. Che Viet Nhat Anh

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

Digital Image & Speech Processing

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

could have the same histogram.


Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

20 / 91

Histogram
The information inherent in histograms also is quite useful in other

image processing applications:


Image compression
Segmentation

Histograms are simple to calculate in software & also lend

themselves to economic hardware implementations, thus making


them a popular tool for real-time image processing.
The shape of the histogram of an image does provide useful

information about the possibility for contrast enhancement.


The role of histogram processing in image enhancement:

Dark image
Light image
Low contrast
High contrast

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

21 / 91

Histogram
Dark image


Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

22 / 91

Histogram
Light image


Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

23 / 91

Histogram
Low contrast


Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

24 / 91

Histogram
High contrast


Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

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:

Dynamic range of image

Dr. Che Viet Nhat Anh

  

Digital Image & Speech Processing

 

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

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

27 / 91

DI&SP - 405017

Some Basic Intensity Transformation Functions


Point operations

depends only on the value of at  ,  . becomes a gray-level

(also called an intensity or mapping) transformation function of the


form:
 ,    {  ,  }
(3.1)
Point operations are zero memory operations.
(0,0)

Dr. Che Viet Nhat Anh

(0,0)

Digital Image & Speech Processing

DI&SP - 405017

28 / 91

Some Basic Intensity Transformation Functions


Point operations

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

29 / 91

Some Basic Intensity Transformation Functions


Identity

No change on pixel values,

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

30 / 91

Some Basic Intensity Transformation Functions


Image Negatives

Contrast reversal: negative,

It produces the equivalent of a photographic negatives.

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

31 / 91

Some Basic Intensity Transformation Functions


Gamma Transformations

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).

gives the identity transformation.

Gamma correction is an application.

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

32 / 91

Some Basic Intensity Transformation Functions


Gamma Transformations

for various values of . All curves were


scaled to fit in the range shown.

Plots of the equation

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

33 / 91

Some Basic Intensity Transformation Functions


Gamma Transformations

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

34 / 91

Some Basic Intensity Transformation Functions


Gamma Transformations

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

35 / 91

Some Basic Intensity Transformation Functions


Gamma Transformations

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

36 / 91

Some Basic Intensity Transformation Functions


Gamma Transformations

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

37 / 91

Some Basic Intensity Transformation Functions


Gamma Transformations

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

38 / 91

Some Basic Intensity Transformation Functions


Log Transformations

Maps a narrow range of low intensity values in input to a wider

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).

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

39 / 91

Some Basic Intensity Transformation Functions


Log Transformations

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

40 / 91

Some Basic Intensity Transformation Functions


Log Transformations

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

41 / 91

Some Basic Intensity Transformation Functions


Piecewise-Linear Transformations: Contrast Stretching

Expands the range of intensity levels in an image so that it spans

the full intensity range of the recording medium or display device.

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

42 / 91

Some Basic Intensity Transformation Functions


Piecewise-Linear Transformations: Contrast Stretching

Low contrast images can result from poor illumination.


Reduce intensity: (, )( , ), (
,
)( , ).
Increase intensity: The slope of the transformation is chosen greater

than unity in the region of stretch.





 
<


 

<

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

(3.2)

43 / 91

Some Basic Intensity Transformation Functions


Piecewise-Linear Transformations: Contrast Stretching

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

44 / 91

Some Basic Intensity Transformation Functions


Piecewise-Linear Transformations: Contrast Compressing

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

45 / 91

Some Basic Intensity Transformation Functions


Piecewise-Linear Transformations: Intensity-level Slicing

Highlighting a specific range of intensities in an image.


Two main approaches:
Display in one value (e.g. white) all the values in the range of interest
and all others in another value (e.g black all other intensities)
binary image.
Brighten or darkens the desired range of intensity levels in the image
unchanged.

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

46 / 91

Some Basic Intensity Transformation Functions


Piecewise-Linear Transformations: Intensity-level Slicing

This transformation

highlights intensity range


, and reduces all others
intensities to a lower level.
Dr. Che Viet Nhat Anh

This transformation

highlights intensity range


, and preserves all others
intensities to a lower level.

Digital Image & Speech Processing

DI&SP - 405017

47 / 91

Some Basic Intensity Transformation Functions


Piecewise-Linear Transformations: Intensity-level Slicing

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

48 / 91

Some Basic Intensity Transformation Functions


Bit Plane Slicing

Pixels are digital numbers composed of bits.


Suppose that each pixel in an image is represented by 8 bits

 
 . 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

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

49 / 91

DI&SP - 405017

Some Basic Intensity Transformation Functions


Bit Plane Slicing

Highlight the contribution made to total image appearance by

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

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

50 / 91

Some Basic Intensity Transformation Functions


Bit Plane Slicing

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

51 / 91

Some Basic Intensity Transformation Functions


Bit Plane Slicing

Reconstruction is obtained by:

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

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

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

53 / 91

Histogram Processing
Histogram Equalization

Consider for a moment continuous intensity values, & let the

variable represent the gray levels of the image to be enhanced,


that is , , with = 0 representing black, &
representing white.
For any satisfying the aforementioned conditions, we focus

attention on transformations of the form:

  6 6

(4.1)

Let ,  denote the Probability Density Function (PDF) of

random variables and .





Dr. Che Viet Nhat Anh

Digital Image & Speech Processing


DI&SP - 405017

54 / 91

Histogram Processing
Histogram Equalization

Transforms an image with an arbitrary histogram to one with a flat

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.

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

55 / 91

Histogram Processing
Histogram Equalization




Dr. Che Viet Nhat Anh





Digital Image & Speech Processing

 
DI&SP - 405017

56 / 91

Histogram Processing
Histogram Equalization

Continuous case:

(4.2)

: a dummy variable of integration.


 is high,  has a steep slope, will be wide, causing  to

be low to keep  .
 is low,  has a shallow slope, will be narrow, causing
 to be high to keep  .

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

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.









Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

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

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

59 / 91

Histogram Processing
Histogram Equalization

Discrete values: For

, , . . . ,

(4.3)

(4.4)

The histogram equalization process consists of four steps:


1 Find the running sum of the histogram values.
2 Normalize the values from step 1 by dividing by the total number of
pixels.
3 Multiply the values from step 2 by the maximum gray level value and
round.
4 Map the gray-level values to the result from step 3 using one-to-one
correspondence.
Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

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

Sketch the original histogram.

Get & sketch the histogram equalization transformation function.

Give the  for each . Sketch the equalized histogram.

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

61 / 91

Example
1

Sketch the original histogram.

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

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

62 / 91

Example
2

Get & sketch the histogram equalization transformation function.

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

Digital Image & Speech Processing

DI&SP - 405017

63 / 91

Example
3

Give the  for each . Sketch the equalized histogram.

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

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

64 / 91

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

65 / 91

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

66 / 91


Dr. Che Viet Nhat Anh

Digital Image & Speech Processing






DI&SP
- 405017

67 / 91


Dr. Che Viet Nhat Anh

Digital Image & Speech Processing






DI&SP
- 405017

68 / 91

Histogram
Transformation function for histogram equalization:

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

69 / 91

Histogram Processing
Histogram Equalization

The above procedure is for grayscale images


For color images:
Apply separately the procedure to each of the three channels
will yield in a dramatic change in the color balance
NOT RECOMMENDED unless you have a good reason for doing
that.
Recommended method
Convert the image into another color space such as the Lab color
space OR HSL/HSV color space.
Apply the histogram equalization on the Luminance channel
Convert back into the RGB color space.

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

70 / 91

Histogram Processing
Histogram equalization

Can contrast stretching achieve similar result as histogram

equalization?
If it can, why histogram equalization then?
Histogram equalization (HE) results are similar to contrast stretching

but offer the advantage of full automation, since HE automatically


determines a transformation function to produce a new image with a
uniform histogram.
Histogram equalization method:
Only generates one result: an image with approximately uniform
histogram (without any flexibility).
Enhancement may not be achieved as desired.

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

71 / 91

Histogram Processing
Histogram matching or Histogram specification

What if the desired histogram is not flat?


Histogram specification: Transform an image according to a

specified gray-level histogram


Let  and  denote the continuous probability density

functions of the variables and .


 is the specified probability density function or specify
particular histogram shapes  capable of highlighting certain
gray-level ranges.
Obtain the transformation function for transformation of to .

Histogram

Matching

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

72 / 91

Histogram Processing
Histogram matching or Histogram specification

Let be the random variable with the probability:

(4.5)

Define a random variable with the probability

(4.6)

The inverse of the above transform is

Histogram

Equalization

Dr. Che Viet Nhat Anh



(4.7)

Histogram

Equalization

Digital Image & Speech Processing

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

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

74 / 91

Example
1

Find the histogram equalization transformation for the input image











Find the histogram equalization transformation for the specified


histogram











The transformation function


] /
[
] / [





Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

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)

Use the specified PDF and obtain the transformation function ,

round the value to the integer range , :




(4.9)

Find the smallest value of so that  is closest to :

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

(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

Dr. Che Viet Nhat Anh

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

Digital Image & Speech Processing

7
81

7
0.15

77 / 91

DI&SP - 405017

Example
1

Obtain the scaled histogram-equalized values:

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

Compute all the values of the transformation function


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


 

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

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

Dr. Che Viet Nhat Anh

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

79 / 91

80 / 91

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

81 / 91

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

82 / 91

Histogram Processing
Histogram matching or Histogram specification

Issues with Histogram specification/matching:


No rule for specifying an optimal histogram.
Each given enhancement task needs to be analyzed on a case-by-case
basis.
Histogram specification is somehow a trial-and-error process.

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

83 / 91

Histogram Processing
Local Histogram Processing

The histogram processing methods mentioned up to now are global

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

Digital Image & Speech Processing

DI&SP - 405017

84 / 91

Histogram Processing
Local Histogram Processing

Dr. Che Viet Nhat Anh

Digital Image & Speech 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)

The variance of the intensities is given by

 

 , 
 

(4.12)
The th moment of the intensity variable is

 

(4.13)

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

86 / 91

Histogram Processing
Using Histogram Statistics for Image Enhancement

Mean gives the average brightness of the image.


Variance
and its square root the standard deviation gives the

deviation of intensities on average from the mean value (average


contrast).

Dr. Che Viet Nhat Anh

.

Digital Image & Speech Processing

.

DI&SP - 405017

87 / 91

Histogram Processing
Using Histogram Statistics for Image Enhancement

Local Statistics: : a neighborhood (subimage) of specific size

centered at , :
Local average intensity:

(4.14)




(4.15)

Local variance:

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

88 / 91

Histogram Processing
Using Histogram Statistics for Image Enhancement

The statistical parameters can

be used in various ways.


Enhance the background

filament.
Enhance details in dark areas

while leaving light area


unchanged.
Define rules to chose the

candidate pixels that need to


be enhanced.

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

89 / 91

Histogram Processing
Using Histogram Statistics for Image Enhancement

A pixel at point ,  is considered if:


6  , where  is a positive constant less than 1.0, and
is global mean.
6
, where is the global standard deviation and
is a
positive constant.
Also need to put a lower limit on standard deviation to avoid
distorting areas which dont have details, i.e., 6 , with
<
.
A pixel that meets all above conditions is processed simply by

multiplying it by a specified constant, , to increase or decrease the


value of its gray level relative to the rest of the image.
The values of pixels that do not meet the enhancement conditions
are left unchanged.
{
,  if <  and < <

, 
, 
otherwise
(4.16)
Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

90 / 91

Histogram Processing
Using Histogram Statistics for Image Enhancement

Dr. Che Viet Nhat Anh

Digital Image & Speech Processing

DI&SP - 405017

91 / 91

Das könnte Ihnen auch gefallen