syde 575: digital image processing point operations - histograms textbook 3.1-3.3 - histograms...
TRANSCRIPT
![Page 1: SYDE 575: Digital Image Processing Point Operations - Histograms Textbook 3.1-3.3 - Histograms Blackboard Notes](https://reader035.vdocuments.net/reader035/viewer/2022062422/56649f265503460f94c3d2ab/html5/thumbnails/1.jpg)
SYDE 575: Digital Image Processing
Point Operations - Histograms
Textbook 3.1-3.3 - HistogramsBlackboard Notes
![Page 2: SYDE 575: Digital Image Processing Point Operations - Histograms Textbook 3.1-3.3 - Histograms Blackboard Notes](https://reader035.vdocuments.net/reader035/viewer/2022062422/56649f265503460f94c3d2ab/html5/thumbnails/2.jpg)
Enhancement vs. Restoration
• Enhancement: qualitative approach to improving the perceived appearance of an image
• Restoration: model-based approach to improve the statistics of an image and, hopefully, improve perceived appearance
• Point processing involves enhancement
![Page 3: SYDE 575: Digital Image Processing Point Operations - Histograms Textbook 3.1-3.3 - Histograms Blackboard Notes](https://reader035.vdocuments.net/reader035/viewer/2022062422/56649f265503460f94c3d2ab/html5/thumbnails/3.jpg)
Point Processing
Simplest of image enhancement techniques
Processing based only on intensity of individual pixels
Given g(x,y) as the output pixel, f(x,y) as the input pixel, and T as some transformation
g(x,y) = T[f(x,y)]
![Page 4: SYDE 575: Digital Image Processing Point Operations - Histograms Textbook 3.1-3.3 - Histograms Blackboard Notes](https://reader035.vdocuments.net/reader035/viewer/2022062422/56649f265503460f94c3d2ab/html5/thumbnails/4.jpg)
Histogram n
k represents the number of occurrences for the kth
gray level zk
Histograms
Normalized Histogram Probability of occurrence of gray level z
k (probability
distribution function or pdf) by normalizing the occurrence of each grey level by the total number of pixels (N)
L is the total number of grey levels
• See blackboard sketches
![Page 5: SYDE 575: Digital Image Processing Point Operations - Histograms Textbook 3.1-3.3 - Histograms Blackboard Notes](https://reader035.vdocuments.net/reader035/viewer/2022062422/56649f265503460f94c3d2ab/html5/thumbnails/5.jpg)
Continuous Representation
• For a continuous distribution bounded between 0 and L-1:
p(r) dr = 1
• What term is used for the integral of a pdf?
• Recall:
m = Mean = r p(r) dr
s2 = Variance = (r - m)2 p(r) dr
![Page 6: SYDE 575: Digital Image Processing Point Operations - Histograms Textbook 3.1-3.3 - Histograms Blackboard Notes](https://reader035.vdocuments.net/reader035/viewer/2022062422/56649f265503460f94c3d2ab/html5/thumbnails/6.jpg)
Contrast
• What is meant by contrast?– Distribution of grey levels in an image– Represented by the histogram– Types of contrast:
Low High Best??
![Page 7: SYDE 575: Digital Image Processing Point Operations - Histograms Textbook 3.1-3.3 - Histograms Blackboard Notes](https://reader035.vdocuments.net/reader035/viewer/2022062422/56649f265503460f94c3d2ab/html5/thumbnails/7.jpg)
Levels of Contrast
Source: Gonzalez and Woods
![Page 8: SYDE 575: Digital Image Processing Point Operations - Histograms Textbook 3.1-3.3 - Histograms Blackboard Notes](https://reader035.vdocuments.net/reader035/viewer/2022062422/56649f265503460f94c3d2ab/html5/thumbnails/8.jpg)
Histograms: Example
Source: Gonzalez and Woods
![Page 9: SYDE 575: Digital Image Processing Point Operations - Histograms Textbook 3.1-3.3 - Histograms Blackboard Notes](https://reader035.vdocuments.net/reader035/viewer/2022062422/56649f265503460f94c3d2ab/html5/thumbnails/9.jpg)
Conditions
a) Transformation should be monotonically increasing or monotonically decreasing
• Ensures no artifacts based on reversals of intensityb) Range of output should be the same as range of
input.
![Page 10: SYDE 575: Digital Image Processing Point Operations - Histograms Textbook 3.1-3.3 - Histograms Blackboard Notes](https://reader035.vdocuments.net/reader035/viewer/2022062422/56649f265503460f94c3d2ab/html5/thumbnails/10.jpg)
Point Transformations
• See blackboard:– Linear, quadratic, square root transformations
![Page 11: SYDE 575: Digital Image Processing Point Operations - Histograms Textbook 3.1-3.3 - Histograms Blackboard Notes](https://reader035.vdocuments.net/reader035/viewer/2022062422/56649f265503460f94c3d2ab/html5/thumbnails/11.jpg)
Intensity Transformation Function
Source: Gonzalez and Woods
![Page 12: SYDE 575: Digital Image Processing Point Operations - Histograms Textbook 3.1-3.3 - Histograms Blackboard Notes](https://reader035.vdocuments.net/reader035/viewer/2022062422/56649f265503460f94c3d2ab/html5/thumbnails/12.jpg)
Example: Negative
![Page 13: SYDE 575: Digital Image Processing Point Operations - Histograms Textbook 3.1-3.3 - Histograms Blackboard Notes](https://reader035.vdocuments.net/reader035/viewer/2022062422/56649f265503460f94c3d2ab/html5/thumbnails/13.jpg)
Gamma Correction
Various devices used for image acquisition and display respond based on power law
Process used to correct power law response phenomena is called gamma correction
s = r g
![Page 14: SYDE 575: Digital Image Processing Point Operations - Histograms Textbook 3.1-3.3 - Histograms Blackboard Notes](https://reader035.vdocuments.net/reader035/viewer/2022062422/56649f265503460f94c3d2ab/html5/thumbnails/14.jpg)
Gamma Curves
Source: Gonzalez and Woods
![Page 15: SYDE 575: Digital Image Processing Point Operations - Histograms Textbook 3.1-3.3 - Histograms Blackboard Notes](https://reader035.vdocuments.net/reader035/viewer/2022062422/56649f265503460f94c3d2ab/html5/thumbnails/15.jpg)
Gamma Correction: Example
Source: Gonzalez and Woods
![Page 16: SYDE 575: Digital Image Processing Point Operations - Histograms Textbook 3.1-3.3 - Histograms Blackboard Notes](https://reader035.vdocuments.net/reader035/viewer/2022062422/56649f265503460f94c3d2ab/html5/thumbnails/16.jpg)
Gamma Transformation: stretch low range and compress high range
Source: Gonzalez and Woods
![Page 17: SYDE 575: Digital Image Processing Point Operations - Histograms Textbook 3.1-3.3 - Histograms Blackboard Notes](https://reader035.vdocuments.net/reader035/viewer/2022062422/56649f265503460f94c3d2ab/html5/thumbnails/17.jpg)
Gamma Transformation: compress low range and stretch high range
Source: Gonzalez and Woods
![Page 18: SYDE 575: Digital Image Processing Point Operations - Histograms Textbook 3.1-3.3 - Histograms Blackboard Notes](https://reader035.vdocuments.net/reader035/viewer/2022062422/56649f265503460f94c3d2ab/html5/thumbnails/18.jpg)
Other Point Transformations
• Can also use an exponential transformation
s = exp(br) -1
• Or a log (base e) transformation
s = a ln (r+1)
How will you set b and a in order to have the input range = output range?
![Page 19: SYDE 575: Digital Image Processing Point Operations - Histograms Textbook 3.1-3.3 - Histograms Blackboard Notes](https://reader035.vdocuments.net/reader035/viewer/2022062422/56649f265503460f94c3d2ab/html5/thumbnails/19.jpg)
Log and Inverse Log Transforms
![Page 20: SYDE 575: Digital Image Processing Point Operations - Histograms Textbook 3.1-3.3 - Histograms Blackboard Notes](https://reader035.vdocuments.net/reader035/viewer/2022062422/56649f265503460f94c3d2ab/html5/thumbnails/20.jpg)
Enhancing the 2D Fourier Spectrum
![Page 21: SYDE 575: Digital Image Processing Point Operations - Histograms Textbook 3.1-3.3 - Histograms Blackboard Notes](https://reader035.vdocuments.net/reader035/viewer/2022062422/56649f265503460f94c3d2ab/html5/thumbnails/21.jpg)
High-contrast images are often desirable from a visual perspective
High-contrast images have histograms where the components cover a wide dynamic range
Distribution of pixels are close to a uniform distribution
Intuitively, low-contrast images can be enhanced by transforming its pixel distribution into a uniform distribution to achieve high contrast
Histogram Equalization
![Page 22: SYDE 575: Digital Image Processing Point Operations - Histograms Textbook 3.1-3.3 - Histograms Blackboard Notes](https://reader035.vdocuments.net/reader035/viewer/2022062422/56649f265503460f94c3d2ab/html5/thumbnails/22.jpg)
Histogram Equalization
Let p(r) and p(s) denote the probability density functions of r and s
For s=T(r), p(s) can be expressed as:
p(s) ds = p(r) dr
Since we want to transform the input image such that the pixel distribution is uniform,
p(s) = 1/(L-1), 0 ≤ s ≤ L-1
![Page 23: SYDE 575: Digital Image Processing Point Operations - Histograms Textbook 3.1-3.3 - Histograms Blackboard Notes](https://reader035.vdocuments.net/reader035/viewer/2022062422/56649f265503460f94c3d2ab/html5/thumbnails/23.jpg)
Histogram Equalization
What transformation will give you a uniform distribution for s? cumulative distribution function (CDF)
s = T(r) = (L – 1) p(x) dx (integrate from 0 to r)
![Page 24: SYDE 575: Digital Image Processing Point Operations - Histograms Textbook 3.1-3.3 - Histograms Blackboard Notes](https://reader035.vdocuments.net/reader035/viewer/2022062422/56649f265503460f94c3d2ab/html5/thumbnails/24.jpg)
Histogram Equalization
Source: Gonzalez and Woods
![Page 25: SYDE 575: Digital Image Processing Point Operations - Histograms Textbook 3.1-3.3 - Histograms Blackboard Notes](https://reader035.vdocuments.net/reader035/viewer/2022062422/56649f265503460f94c3d2ab/html5/thumbnails/25.jpg)
Histogram Equalization
For discrete case, also use the cdf
sk = T(rk) = ( L – 1 ) S p(rj) (sum j = 0 to k)
![Page 26: SYDE 575: Digital Image Processing Point Operations - Histograms Textbook 3.1-3.3 - Histograms Blackboard Notes](https://reader035.vdocuments.net/reader035/viewer/2022062422/56649f265503460f94c3d2ab/html5/thumbnails/26.jpg)
Histogram Equalization: Example
Source: Gonzalez and Woods
![Page 27: SYDE 575: Digital Image Processing Point Operations - Histograms Textbook 3.1-3.3 - Histograms Blackboard Notes](https://reader035.vdocuments.net/reader035/viewer/2022062422/56649f265503460f94c3d2ab/html5/thumbnails/27.jpg)
Histogram Equalization: Example
Source: Gonzalez and Woods
![Page 28: SYDE 575: Digital Image Processing Point Operations - Histograms Textbook 3.1-3.3 - Histograms Blackboard Notes](https://reader035.vdocuments.net/reader035/viewer/2022062422/56649f265503460f94c3d2ab/html5/thumbnails/28.jpg)
Histogram Equalization: Example
Source: Gonzalez and Woods
![Page 29: SYDE 575: Digital Image Processing Point Operations - Histograms Textbook 3.1-3.3 - Histograms Blackboard Notes](https://reader035.vdocuments.net/reader035/viewer/2022062422/56649f265503460f94c3d2ab/html5/thumbnails/29.jpg)
Local Histogram Equalization
Global approach good for overall contrast enhancement
However, there may be cases where it is necessary to enhance details over small areas in image
Solution: perform histogram equalization over a small neighborhood
![Page 30: SYDE 575: Digital Image Processing Point Operations - Histograms Textbook 3.1-3.3 - Histograms Blackboard Notes](https://reader035.vdocuments.net/reader035/viewer/2022062422/56649f265503460f94c3d2ab/html5/thumbnails/30.jpg)
Local Histogram Equalization: Example
http://scikit-image.org/docs/dev/auto_examples/plot_local_equalize.html