1 / 25

Histogram Specification

Histogram Specification. desired. -1. G. G. equalize. equalize. Histogram Specification (cont.). Equalize the levels of the original image. Specify the desired density function (histogram) and obtain the transformation function G(z).

Download Presentation

Histogram Specification

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Histogram Specification desired -1 G G equalize equalize

  2. Histogram Specification (cont.) • Equalize the levels of the original image. • Specify the desired density function (histogram) and obtain the transformation function G(z). • Apply the inverse transformation function z = G (s) to the levels obtained in first step. -1

  3. Histogram Specification (cont.)-from text- • Saw what we want the histogram to look like and come up with a transform function that will give it to us. • Continuous random variables r & z. Pr(r) and Pz(z) denote their probability density functions. (Continuous equivalent of a histogram). • Pr(r) input image • Pz(z) desired output image (processed) This is what we'd like the processed image to have.

  4. Histogram Specification (cont.)-from text- • Continuous version of histogram equalization. • Cumulative Distribution Function

  5. Histogram Specification (cont.)-from text- • Continuous version of histogram equalization. • Cumulative distribution function.

  6. Histogram Specification (cont.)-from text- • If you have Pr(r) estimated from input image, you can obtain T(r) from Transformation G(z) can be obtained by using since you specified Pz(z)!

  7. Histogram Specification (cont.)-from text- -1 • Assume G exists and that is satisfys: • Single-Valued, monotonically increasing • 0 <= G (z) <= 1 for 0 <= z <= 1 -1

  8. Histogram Specification (cont.)-from text- • You can obtain an image with the specified probability density function from an input function using the following: • obtain T(r) using equilization • obtain G(z) by equalizing specified histogram • obtain G (z) • obtain the output image by applying G to all pixels in input image. -1 -1

  9. Histogram Specification (cont.)-from text- • So far so good (continuously speaking) • In practice it is difficult to obtain analytical expressions for T(r) and G • With discrete values it becomes possible to make a close approximation to the histogram. -1

  10. discrete Formulas L is the number of discrete gray levels n = total # pixels n = # of pixels with gray level j j

  11. Implementation • Each set of gray levels is a 1D array • All mappings from r to s and s to z are simple table lookups • Each element (e.g. s ) contains 2 important pieces of information: • subscript k denotes the location of the element in the array • s denotes the value at that location • We need to only look at integer values k

  12. Refer to Figure 3.19 GW • (a) a hypothetical transform function given an image that was equalized. • (b) Equalize specified histogram. G is just running the transform backwards. • But wait a minute! Where did we get the z's??? • We have to use an iterative scheme. -1

  13. Iterative Scheme • Obtain histogram of the given image. • Equalize the image to precompute a mapped level s for each r . T • Obtain G from the specified histogram by equalization. • Precompute z for each s using iterative scheme (3.3-17) • Map r -> s and back to z . • Moon example 3.4, page 100, 101, 102 GW k k k k k k k

  14. desired 0.3 0.3 0.2 0.2 0.1 0.1 0 1 4 6 7 0 1 4 6 7 2 3 5 2 3 5 0 – 0.0 1 – 0.0 2 – 0.0 3 – 0.15 4 – 0.20 5 – 0.30 6 – 0.20 7 – 0.15 0 – 0.19 1 – 0.25 2 – 0.21 3 – 0.16 4 – 0.08 5 – 0.06 6 – 0.03 7 – 0.02 1.0 1.0 0.8 0.8 0.6 0.6 0.4 0.4 0.2 0.2 0.0 0.0 0 1 4 6 7 2 3 5 0 1 4 6 7 2 3 5

  15. equalized histogram 0.3 0.3 0.2 0.2 0.1 0.1 r s 1 0 0 1 4 6 7 2 3 5 7 1.0 6 0.8 5 0.6 4 3 0.4 2 0.2 1 0.0 0 0 1 4 6 7 2 3 5

  16. equalized histogram 0.3 0.3 0.3 0.2 0.2 0.2 0.1 0.1 0.1 r s 1 0 0 1 4 6 7 2 3 5 1 3 7 1.0 6 0.8 5 0.6 4 3 0.4 2 0.2 1 0.0 0 0 1 4 6 7 2 3 5

  17. equalized histogram 0.3 0.3 0.3 0.2 0.2 0.2 0.1 0.1 0.1 r s 1 0 0 1 4 6 7 2 3 5 1 3 5 2 7 1.0 6 0.8 5 0.6 4 3 0.4 2 0.2 1 0.0 0 0 1 4 6 7 2 3 5

  18. equalized histogram 0.3 0.3 0.3 0.2 0.2 0.2 0.1 0.1 0.1 r s 1 0 0 1 4 6 7 2 3 5 1 3 5 2 7 1.0 6 3 6 0.8 5 0.6 4 3 0.4 2 0.2 1 0.0 0 0 1 4 6 7 2 3 5

  19. equalized histogram 0.3 0.3 0.3 0.2 0.2 0.2 0.1 0.1 0.1 r s 1 0 0 1 4 6 7 2 3 5 1 3 5 2 7 1.0 6 3 6 0.8 5 0.6 4 6 4 3 0.4 2 0.2 1 0.0 0 0 1 4 6 7 2 3 5

  20. equalized histogram 0.3 0.3 0.3 0.2 0.2 0.2 0.1 0.1 0.1 r s 1 0 0 1 4 6 7 2 3 5 1 3 5 2 7 1.0 6 3 6 0.8 5 0.6 4 6 4 3 0.4 5 7 2 0.2 1 0.0 0 0 1 4 6 7 2 3 5

  21. equalized histogram 0.3 0.3 0.3 0.2 0.2 0.2 0.1 0.1 0.1 r s 1 0 0 1 4 6 7 2 3 5 1 3 5 2 7 1.0 6 3 6 0.8 5 0.6 4 6 4 3 0.4 5 7 2 0.2 1 7 6 0.0 0 0 1 4 6 7 2 3 5

  22. equalized histogram 0.3 0.3 0.3 0.2 0.2 0.2 0.1 0.1 0.1 r s 1 0 0 1 4 6 7 2 3 5 0 1 4 6 7 2 3 5 1 3 5 2 7 1.0 6 3 6 0.8 5 0.6 4 6 4 3 0.4 5 7 2 0.2 1 7 6 0.0 0 7 7 0 1 4 6 7 2 3 5

  23. equalized histogram 0.3 0.3 0.3 0.2 0.2 0.2 0.1 0.1 0.1 r s 1 0 0 1 4 6 7 2 3 5 0 1 4 6 7 2 3 5 1 3 1 = 0.19 3 = 0.25 5 = 0.21 6 = .16+.08=.24 7 = .06+.03+.02 = 0.11 5 2 7 1.0 6 3 6 0.8 5 0.6 4 6 4 3 0.4 5 7 2 0.2 1 7 6 0.0 0 7 7 0 1 4 6 7 2 3 5

  24. desired equalized histogram 0.3 0.3 0.2 0.2 0.1 0.1 r s 0 0 0 1 4 6 7 0 2 3 5 1 0 1 4 6 7 2 3 5 2 0 7 1.0 3 1 6 0.8 2 4 5 0.6 4 4 5 3 0.4 2 0.2 6 6 1 0.0 7 7 0 0 1 4 6 7 2 3 5

  25. equalized orig resultant histogram 1 0 3 0.3 1 0.3 3 4 5 2 0.2 5 0.2 3 6 6 0.1 0.1 6 4 6 5 7 7 0 1 4 6 7 2 3 5 7 7 6 0 1 4 6 7 2 3 5 7 7 7 7 1.0 0.3 6 0.8 0.2 5 0.6 4 3 0.4 0.1 2 0.2 1 0.0 0 desired 0 1 4 6 7 2 3 5 0 1 4 6 7 2 3 5

More Related