Dr. Praveen Sankaran Department of ECE NIT Calicut December 28, 2012 Winter 2013 December 28, 2012 1 / 18
Outline 1 Piecewise-Linear Functions Review 2 Histogram Processing Winter 2013 December 28, 2012 2 / 18
Review Outline 1 Piecewise-Linear Functions Review 2 Histogram Processing Winter 2013 December 28, 2012 3 / 18
Review Review Summary Image sampling, quantization and associated problems. Image formats examples..pgm and.ppm formats. Looked at a code to read an image and compute mean. Integer and oat values for computed Image mean dier, why? Spatial domain operations. Intensity transformation functions that work on single pixel values. Winter 2013 December 28, 2012 4 / 18
Outline 1 Piecewise-Linear Functions Review 2 Histogram Processing Winter 2013 December 28, 2012 5 / 18
Contrast Dened as the dierence in intensity between the highest and the lowest intensity levels in an image. Also can be explained as - the dierence in luminance and/or color that makes an object (or its representation in an image or display) distinguishable. 1 1 http://en.wikipedia.org/wiki/contrast_%28vision%29 r. Praveen Sankaran (Department of ECE NIT Calicut DIP) Winter 2013 December 28, 2012 6 / 18
Low Contrast Poor scene illumination - absense of higher valued gray levels. Lack of dynamic range(?) in the imaging sensor. Dynamic range is the ratio between the largest and smallest possible values of a changeable quantity, such as in signals like sound and light. 2 Dynamic range of scene luminance range of the scene being photographed. Dynamic range of sensor denes max and min value of luminance a sensor can capture. Small dynamic range of sensor would result in image with lowest and highest intensity levels close together. Wrong lens aperture during imaging. 2 http://en.wikipedia.org/wiki/dynamic_range Winter 2013 December 28, 2012 7 / 18
Some Calculations - Contrast How do we set up a calculation for this? Let g be an M N digital image with l = 0,1,..., L 1 possible gray levels. Image contrast relates to the global amount of image gray level dispersion (variation about the mean gray level). Dispersion Image pixel value variance. g g 2 = 1 MN M 1 g = 1 MN M 1 m=0 N 1 n=0 m=0 N 1 n=0 g [m, n] (g [m, n] g)2 Units are squared here. Contrast = g g = g g 2 standard deviation. Note that it would take an order O (MN) algorithm to nd this. Winter 2013 December 28, 2012 8 / 18
Idea expand the range of intensity levels in an image so that it spans the full intensity range of the recording medium or display device. Position of (r 1, s 1 ) and (r 2, s 2 ) controls the function. r 1 r 2 and s 1 s 2. Single valued, monotonically increasing. Specic case here (r 1, s 1 ) = (r min,0) and (r 2, s 2 ) = (r max, L 1) Winter 2013 December 28, 2012 9 / 18
Intensity Level Slicing Idea Highlight a specic range of intensity levels by using a window. Winter 2013 December 28, 2012 10 / 18
Bit-plane Slicing Idea Each pixel value (e.g. between 0 and 255) is represented by 8 bits. Remember each of the planes would have a set of 0's and 1's. Winter 2013 December 28, 2012 11 / 18
Bit-planes - Visual Information Winter 2013 December 28, 2012 12 / 18
Histogram Processing Outline 1 Piecewise-Linear Functions Review 2 Histogram Processing Winter 2013 December 28, 2012 13 / 18
Histogram Processing Histogram Let g be an M N digital image with l = 0,1,..., L 1 possible gray levels. c [l] =the number of pixels with gray level l. Dene relative frequency p [l] = c[l] MN, L 1 l=0 p [l] = 1 digital image gray level distribution. The probability that a randomly selected pixel has value l. Note that the computation would take an algorithm with order O (L + MN). Winter 2013 December 28, 2012 14 / 18
Histogram Processing Histogram - Example Winter 2013 December 28, 2012 15 / 18
Histogram Processing Some More Calculations - Contrast M 1 m=0 N 1 n=0 g [m, n] = L 1 lc [l]. l=0 M 1 m=0 N 1 n=0 g 2 [m, n] = L 1 l=0 l 2 c [l]. Note that l MN. So if we have the gray level distribution model, we can speed things up! random selection of a small sub-set of a large image to obtain gray level distribution. not accurate, but could live with it! especially if we are sure about the randomness. g = L 1 lp [l] l=0 g g = L 1 l=0 (l g)2 p [l] Winter 2013 December 28, 2012 16 / 18
Histogram Processing Summary Contrast? image standard deviation. Contrast stretching. Intensity slicing, bit-plane slicing. Gray level distribution, histogram. Winter 2013 December 28, 2012 17 / 18
Histogram Processing Questions 3.1, 3.2, 3.3, 3.4, 3.5 Winter 2013 December 28, 2012 18 / 18