Top Banner
Histogram Processing The histogram of a digital image with gray levels from 0 to L-1 is a discrete function h(r k )=n k , where: r k is the kth gray level n k is the # pixels in the image with that gray level n is the total number of pixels in the image k = 0, 1, 2, …, L-1 Normalized histogram: p(r k )=n k /n sum of all components = 1
15

Histogram Processing The histogram of a digital image with gray levels from 0 to L-1 is a discrete function h(r k )=n k, where: –r k is the kth gray level.

Dec 17, 2015

Download

Documents

Esther May
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Histogram Processing The histogram of a digital image with gray levels from 0 to L-1 is a discrete function h(r k )=n k, where: –r k is the kth gray level.

Histogram Processing

• The histogram of a digital image with gray levels from 0 to L-1 is a discrete function h(rk)=nk, where:

– rk is the kth gray level

– nk is the # pixels in the image with that gray level

– n is the total number of pixels in the image– k = 0, 1, 2, …, L-1

• Normalized histogram: p(rk)=nk/n– sum of all components = 1

Page 2: Histogram Processing The histogram of a digital image with gray levels from 0 to L-1 is a discrete function h(r k )=n k, where: –r k is the kth gray level.

Image Enhancement in theSpatial Domain

Image Enhancement in theSpatial Domain

Page 3: Histogram Processing The histogram of a digital image with gray levels from 0 to L-1 is a discrete function h(r k )=n k, where: –r k is the kth gray level.

Histogram Processing

• The shape of the histogram of an image does provide useful info about the possibility for contrast enhancement.

• Types of processing:

Histogram equalizationHistogram matching

(specification)Local enhancement

Page 4: Histogram Processing The histogram of a digital image with gray levels from 0 to L-1 is a discrete function h(r k )=n k, where: –r k is the kth gray level.

Histogram Equalization

• As mentioned above, for gray levels that take on discrete values, we deal with probabilities:

pr(rk)=nk/n, k=0,1,.., L-1

– The plot of pr(rk) versus rk is called a histogram and the technique used for obtaining a uniform histogram is known as histogram equalization (or histogram linearization).

Page 5: Histogram Processing The histogram of a digital image with gray levels from 0 to L-1 is a discrete function h(r k )=n k, where: –r k is the kth gray level.

Histogram Equalization

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

)()(0 0

j

k

j

k

jr

jkk rp

n

nrTs ∑ ∑

= =

===

Page 6: Histogram Processing The histogram of a digital image with gray levels from 0 to L-1 is a discrete function h(r k )=n k, where: –r k is the kth gray level.
Page 7: Histogram Processing The histogram of a digital image with gray levels from 0 to L-1 is a discrete function h(r k )=n k, where: –r k is the kth gray level.

Histogram Matching (or Specification)

• Histogram equalization does not allow interactive image enhancement and generates only one result: an approximation to a uniform histogram.

• Sometimes though, we need to be able to specify particular histogram shapes capable of highlighting certain gray-level ranges.

Page 8: Histogram Processing The histogram of a digital image with gray levels from 0 to L-1 is a discrete function h(r k )=n k, where: –r k is the kth gray level.

Histogram Specification

• The procedure for histogram-specification based enhancement is:

– Equalize the levels of the original image using:

∑=

==k

j

jk n

nrTs

0

)(

n: total number of pixels,

nj: number of pixels with gray level rj,

L: number of discrete gray levels

Page 9: Histogram Processing The histogram of a digital image with gray levels from 0 to L-1 is a discrete function h(r k )=n k, where: –r k is the kth gray level.

Histogram Specification

– Specify the desired density function and obtain the transformation function G(z):

∑∑=

≈==z

i

iz

z n

nwpzGv

00

)()(

– Apply the inverse transformation function z=G-1(s) to the levels obtained in step 1.

pz: specified desirable PDF for output

Page 10: Histogram Processing The histogram of a digital image with gray levels from 0 to L-1 is a discrete function h(r k )=n k, where: –r k is the kth gray level.

Histogram Specification

• The new, processed version of the original image consists of gray levels characterized by the specified density pz(z).

)]([ )( 11 rTGzsGz −− =→=In essence:

Page 11: Histogram Processing The histogram of a digital image with gray levels from 0 to L-1 is a discrete function h(r k )=n k, where: –r k is the kth gray level.

Histogram Specification

• The principal difficulty in applying the histogram specification method to image enhancement lies in being able to construct a meaningful histogram. So…

Page 12: Histogram Processing The histogram of a digital image with gray levels from 0 to L-1 is a discrete function h(r k )=n k, where: –r k is the kth gray level.

Histogram Specification

– Either a particular probability density function (such as a Gaussian density) is specified and then a histogram is formed by digitizing the given function,

– Or a histogram shape is specified on a graphic device and then is fed into the processor executing the histogram specification algorithm.

Page 13: Histogram Processing The histogram of a digital image with gray levels from 0 to L-1 is a discrete function h(r k )=n k, where: –r k is the kth gray level.

Image Enhancement in theSpatial Domain

Image Enhancement in theSpatial Domain

Page 14: Histogram Processing The histogram of a digital image with gray levels from 0 to L-1 is a discrete function h(r k )=n k, where: –r k is the kth gray level.

Chapter 3Image Enhancement in the

Spatial Domain

Chapter 3Image Enhancement in the

Spatial Domain

Page 15: Histogram Processing The histogram of a digital image with gray levels from 0 to L-1 is a discrete function h(r k )=n k, where: –r k is the kth gray level.