IT 523 Digital Image Processing Prof Asim Banerjee
IT 523 Digital Image Processing Prof. Asim Banerjee Lecture 13 31 st August 2007 IT 523 - Digital Image Processing
Piece-wise Linear Transformation • These use piecewise linear functions that offers the advantage that the form of the piecewise functions can be arbitrarily complex. • The disadvantage of piecewise functions is that their specification requires considerably more user inputs. • Examples: – Contrast stretching – Gray level slicing – Bit plane slicing IT 523 - Digital Image Processing 2
Contrast Stretching (1/2) • The idea behind contrast stretching is to increase the dynamic range of the gray levels of interest in the image being processed. NOTE: The low-contrast image can be caused due to poor illumination, lack of dynamic range of the sensor, wrong setting of the aperture, etc. • This general transformation can be modified to become thresholding function. IT 523 - Digital Image Processing 3
Contrast Stretching (2/2) IT 523 - Digital Image Processing 4
Gray Level Slicing (1/2) • Is used for highlighting a specific area of gray levels in an image. • This is achieved by: 1. Display a high value for all gray levels in the range of interest and a low value for all other gray levels. 2. Brighten the desired range of gray levels but preserve the background and gray level tonalities in the image. NOTE: Variations of the above two transformations are also possible. IT 523 - Digital Image Processing 5
Gray Level Slicing (2/2) IT 523 - Digital Image Processing 6
Bit Plane Slicing (1/3) • Highlighting the contribution made to the total image appearance by specific bits. • For an 8 -bit image, eight 1 -bit planes images, ranging from bit plane 0 (LSB) to bit plane 7 (MSB) are constructed. NOTE: Higher bits contain the majority of the visually significant data and lower bit planes contribute to more subtle details in the image. IT 523 - Digital Image Processing 7
Bit Plane Slicing (2/3) IT 523 - Digital Image Processing 8
Bit Plane Slicing (3/3) IT 523 - Digital Image Processing 9
Histogram Processing (1/3) • Histogram of an image ‘h’ is a function that gives the number of occurrences of the gray levels in an image ‘f’ i. e. h(k) is the number of occurrence of the gray ‘k’ in the image ‘f’ • A normalized histogram is obtained by dividing h(k) by the total number of pixels in the image. NOTE: The normalized histogram can be looked upon as the probability of occurrence of the various gray levels in an image. IT 523 - Digital Image Processing 10
Histogram Processing (2/3) • Histogram processing includes: – Histogram equalization – Histogram specification IT 523 - Digital Image Processing 11
Histogram Processing (3/3) Four basic images types viz. dark, light, low contrast and high contrast images and their corresponding histograms IT 523 - Digital Image Processing 12
Histogram Equalization (1/4) • It is reasonable to expect that an image whose pixels tend to occupy the entire range of possible gray levels and tend to be distributed uniformly, will have an appearance of high contrast and will exhibit a large variety of gray tones. • The probability of occurrence of gray level rk in an image is approximated by pr(rk) = nk / n k=0, 1, …, L-1 IT 523 - Digital Image Processing 13
Histogram Equalization (2/4) • Histogram equalization is given by sk = T(rk) = ∑ pr(rj) = ∑ nk/n k=0, 1, …, L-1 • It has a tendency of spreading the histogram of the input image so the levels in the output image spans a fuller range of gray scale. NOTE: T(rk) depends on pr(rk), but the resulting ps(sk) is always uniform like independent of the form of pr(rk). IT 523 - Digital Image Processing 14
Histogram Equalization IT 523 - Digital Image Processing (3/4) 15
Histogram Equalization IT 523 - Digital Image Processing (4/4) 16
Histogram Specification (1/4) • It is sometimes useful to be able to specify the shape of the histogram we wish the processed image to have. • The procedure to do histogram specification is as follows: 1. Obtain the histogram of the given image. 2. Equalize the histogram to pre-compute a mapped level sk for each level rk sk = T(rk) = ∑ pr(rj) = ∑ nk/n k=0, 1, …, L-1 IT 523 - Digital Image Processing 17
Histogram Specification (2/4) 3. Obtain the transformation function G from the given pz(z) using vk = G(zk) = ∑ pz(zi) = sk k=0, 1, …, L-1 4. Pre-compute zk for each value of sk using a iterative scheme i. e. find the smallest integer zˆ in the interval [0, L-1] such that (G(zˆ) - sk ) ≥ 0 k=0, 1, …, L-1 5. For each pixel in the original image rk map this value to its corresponding level sk, then map sk into the final level zk. Use pre-computed values in steps 2 and 4 for IT 523 these mappings. - Digital Image Processing 18
Histogram Specification IT 523 - Digital Image Processing (3/4) 19
Histogram Specification IT 523 - Digital Image Processing (4/4) 20
That’s all for now. IT 523 - Digital Image Processing 21
- Slides: 21