Presentation is loading. Please wait.

Presentation is loading. Please wait.

Image Processing – Contrast Enhancement

Similar presentations


Presentation on theme: "Image Processing – Contrast Enhancement"— Presentation transcript:

1 Image Processing – Contrast Enhancement
Jack Tompkins Department of Computer Science

2 What is Contrast Enhancement
Original Image with low contrast Enhanced Image

3 Luminance While contrast enhancement can be accomplished across r, g, and b bands, often the image is first converted to gray scale. When translating a color image to black and white (mode “L”), use the ITU-R luma transform: L = R * 299/ G * 587/ B * 114/1000

4 Contrast Low contrast images with neighbors clustered on the low end of the intensity scale, closer to 0, are called low-key. Low contrast images that reside on the high end of the intensity scale, closer to 255, are called high-key. Normal contrast images are equalized. High contrast images will exhibit a full range of tones from black to white, with dark shadows and bright highlights.

5 How to Enhance Contrast
Neighboring pixels with similar intensity are hard to distinguish. Low Contrast -> image values concentrated in a narrow range. Contrast enhancement -> distribute the pixel intensities across a broader range while maintaining relative brightness

6 Visualizing Pixel Counts Histograms
A histogram is a display of statistical information representing the frequency of data items in successive numerical intervals of equal size. Histogram of a monochrome image with 256 possible gray levels or intensities ranging from 0 through 255. Each bin in the histogram represents a probability. P(i) = ni / n, where ni is the number of pixels with intensity i, n is the total number of pixels.

7 Pixel Counts - Histograms

8 Visualizing Pixel Counts Histograms
histograms.xslx Bw1.jpg Luther Bell Lena Oira.jpg

9 By What Technique? Use a function, g, to generate a new image B from image A: B(x, y) = g(A(x, y)), x = 0,…, n-1, y = 0,…, m-1 The function, g, maps pixel intensities for each pixel in image A to a new intensity for that pixel in image B. Monotonically non-decreasing, (relative intensity relations remain) A short chapter excerpt with examples: TT92

10 Linear Transform Uniform linear transformation
Say intensities are concentrated from 0 to 64, and we wish to map these to 0 to 255 g(f) = m f + b, where m = (t1 – t0)/(s1 - s0), b = t1 – m s1 g(f) = 255/64 * f – 255/64 * 64 = 255/64 f see histograms.xslx Easily adapted to piecewise transformations using multiple slope segments over sequential groups Can be fully automated

11 Histogram Equalization
Digital Image Processing – Gonzalez & Woods, p 93 The probability of occurrence of gray level rk in an image is approximated by p(rk) = nk / n k = 0, 1, 2, …, L-1, where nk is the number of pixels with gray level rk, n is the number of pixels, and L is the total number of possible gray levels in the image (typically 256) A plot of pr(rk) is called a histogram, efficiently stored in an array with indices

12 Histogram Equalization
Digital Image Processing – Gonzalez & Woods, p 93 A processed output image is obtained by mapping each pixel with level rk in the input image into a corresponding pixel with level sk in the output image sk = (L-1) 𝑗=0 𝑘 𝑝 (rj) = (L-1) 𝑗=0 𝑘 𝑛 𝑗 𝑛 = ((L-1)/n) 𝑗=0 𝑘 𝑛𝑗 Efficiently stored in an array with indices a look up table Histogram Equalization

13 Additional Techniques
Image Contrast Enhancement Methods Log transform: g(f) = c log(1 + f) Power transform: g(f) = c f r, 0 < r < 1

14 Saving multiple image histograms to a single CSV file

15 Data gathering

16 Scanning in the Image Files


Download ppt "Image Processing – Contrast Enhancement"

Similar presentations


Ads by Google