mage Processing - Lesson 2 mage Acquisition mage Characteristics mage Acquisition mage Digitization Sampling Quantization mage Histogram What is an mage? An image is a projection of a 3D scene into a 2D projection plane. An image can be defined as a 2 variable function (x,y), where for each position (x,y) in the projection plane, (x,y) defines the light intensity at this point. 2 mage Acquisition World Camera Digitizer Digital mage 0 0 0 5 50 70 80 0 0 00 20 25 30 30 0 35 00 50 50 80 50 0 5 70 00 0 20 20 0 5 70 0 0 0 5 PXEL (picture element) 5 5 50 20 0 30 0 5 0 20 50 50 20 250 3 4 Typically: 0 = black 255 = white
Three types of images: Binary images (x,y) {0, } Gray-scale images (x,y) [a, b] Color mages R (x,y) G (x,y) B (x,y) Grayscale mage y = 4 42 43 44 45 46 47 48 49 50 5 52 53 54 55 x = 58 59 60 6 62 63 64 65 66 67 68 69 70 7 72 20 209 204 202 97 247 43 7 64 80 84 54 54 57 58 206 96 203 97 95 20 207 56 63 58 53 53 6 62 5 20 207 92 20 98 23 56 69 65 57 55 52 53 60 50 26 206 2 93 202 207 208 57 69 60 55 77 49 62 6 22 206 2 94 96 97 220 56 63 60 55 46 97 58 06 209 24 224 99 94 93 204 73 64 60 59 5 62 56 48 204 22 23 208 9 90 9 24 60 62 66 76 5 49 55 24 25 25 207 208 80 72 88 69 72 55 49 56 52 56 209 205 24 205 204 96 87 96 86 62 66 87 57 60 48 208 209 205 203 202 86 74 85 49 7 63 55 55 45 56 207 20 2 99 27 94 83 77 209 90 62 64 52 93 52 208 205 209 209 97 94 83 87 87 239 58 68 6 5 56 204 206 203 209 95 203 88 85 83 22 75 6 58 60 60 200 203 99 236 88 97 83 90 83 96 22 63 58 64 66 205 20 202 203 99 97 96 8 73 86 05 62 57 64 63 5 6 Color mage mage Values mage ntensity - Light energy emitted from a unit area in the image. Device dependence. mage Brightness - The subjective appearance of a unit area in the image. Context dependence. Subjective. mage Gray-Level - The relative intensity at each unit area. Between the lowest intensity (Black value) and the highest intensity (White value). Device independent 7 8 2
ntensity vs Brightness ntensity 2 2 < 2, = 2 Equal intensity steps: Equal brightness steps: 9 0 Weber s Law n general, needed for just noticeable difference (JND) over background was found to satisfy: = constant ( is intensity, is change in intensity) Weber s Law: Perceived Brightness = log () f x y Continuous mage Plane f(x,y) Digitization 2 3 4 5 00 00 00 00 00 2 00 0 0 0 00 3 00 0 0 0 00 4 00 0 0 0 00 5 00 00 00 00 00 Digital mage G(i,j) K Stages in the Digitization Process: Perceived Brightness ntensity. SAMPLNG - spatial 2. QUANTZATON - gray level 2 3
SAMPLNG Using Different Number of Samples Two principles: coverage of the image plane uniform sampling (pixels are same size and shape) N = 4 N = 32 Hexagonal - 6 neighbors cell orientation 3 principle directions non-recursive N = 8 N = 64 Triangular - neighbors: 3 edge neighbors 3 across corner 6 side corner 2 cell orientations 3 principle directions recursive Square Grid - neighbors: 4 edge neighbors 4 corner neighbors cell orientation 2 principle directions recursive Used by most equipment (Raster) N = 6 N = 28 3 4 mage Resolution The density of the sampling denotes the separation capability of the resulting image. mage resolution defines the finest details that are still visible by the image. We use a cyclic pattern to test the separation capability of an image. number of cycles frequency = unit length unit length wavelength = = number of cycles frequency Nyquist Frequency 20 40 60 80 00 200 400 600 800 000 5200 400 600 800 2000 6 4
Sampling Density Nyquist Frequency Nyquist Rule: Given a sampling at intervals equal to d then one may recover cyclic patterns of wavelength > 2d. Aliasing: f the pattern wavelength is less than 2d erroneous patterns may be produced. D Example: 0 To observe details at frequency f one must sample at frequency > 2f. The Frequency 2f is the NYQUST frequency. 7 8 Aliasing Aliasing 9 20 5
Temporal Aliasing Digital mage De-mosaicing Can we do better than Nyquist? 2 22 Basic idea: Exploit correlations between color bands A joint Histogram of r x v.s. g x Quantization 500 450 400 f(x,y) g(i,j) Κ Green derivative 350 300 250 200 50 00 50 pixel region pixel value 00 200 300 400 500 Red derivative Continuous ntensity Range Discrete Gray Levels Choose number of gray levels (according to number of assigned bits). Divide continuous range of intensity values. 23 24 6
Different Number of Gray Levels Different Number of Gray Levels bits= bits=2 bits= bits=2 bits=3 bits=4 bits=3 bits=4 25 bits=8 26 bits=8 Low freq. areas are more sensitive to quantization: Uniform Quantization: quantization q 0 q q 2 q 3........ level q k- Z 0 Z Z 2 Z 3 Z 4.... Z k- Z k sensor voltage 0 8 8 bits image Gray-Level 6 4 2 0 0 0 20 30 40 50 60 70 80 90 00 Sensor Voltage 4 bits image 27 Zk Z Zi+ Zi = K Zi+ + Zi qi = 2 28 0 7
Non-Uniform Quantization. Non uniform visual sensitivity (Weber s Law). Optimal Quantization q 0 q q 2 q 3 quantization level sensor voltage q 0 q q 2 q 3 q 4 q 5 q 6 Z 0 Z Z 2 Z 3 Z 4 Z 5 Z 6 Z 7 Z 0 Z Z 2 Z 3 Z 4 High Visual Sensitivity 2. Non uniform sensor voltage distribution q q 2 q 3 q 4 q 5 Low Visual Sensitivity quantization level sensor voltage Minimizing the quantization error: k Zi+ i= 0 Zi 2 ( q Z) P( Z)dz i where P(Z) is the distribution of sensor voltage. Solution: q i = Z i + ZP ( Z ) dz Z i Z i + P ( Z ) dz Z i (weighted average in the range [Z i... Z i+ ]) Z 0 29 Z k P(Z) Z i = ( q i +q i )/2 terate until convergence 30 Example: mage Characteristics 8 bits image 4 bits image Uniform quantization 4 bits image Optimal quantization 3 32 8
mage Mean av = i i j ( i, j) j NEW (x,y)=(x,y)-b x x 33 34 mage Contrast The local contrast at an image point denotes the (relative) difference between the intensity of the point and the intensity of its neighborhood: C = p n n The contrast definition of the entire image is ambiguous. n general it is said that the image contrast is high if the image gray-levels fill the entire range. 0.3 0. 0.7 0.5 C = = 2 C = = 0. 4 0. 0.5 0.7 0.5 0.3 0. 35 Low contrast 36 High contrast 9
mage Contrast The mage Histogram Occurrence (# of pixels) x Gray Level x H(k) = #pixels with gray-level k NEW (x,y)=a (x,y)-b How can we maximize the image contrast using the above operation? Problems: Global (non-adaptive) operation. Outlier sensitive. 37 Normalized histogram: H norm (k)=h(k)/n where N is the total number of pixels in the image. 38 The mage Histogram (Cont.) H() H() 0.5 0. H() End Acquisition 0. H() Pixel permutation of the above image 39 40 0