Chapter Overview: Point Operations !
Relating gray values to brightness!
Gray value quantization! Webers Law! Gamma characteristic! Adjusting brightness and contrast!
Gray-level histograms and histogram equalization! Point operations for combining images!
Averaging! Subtraction! The need for image registration!
Bernd Girod: EE368 Digital Image Processing!
Point Operations no. 1 !
Quantization: how many bits per pixel? !
8 bits
5 bits
4 bits
Contouring
3 bits
Bernd Girod: EE368 Digital Image Processing!
2 bits
1 bit
Point Operations no. 2 !
How many gray levels are required? !
Contouring is most visible for a ramp!
32 levels! 64 levels! 128 levels! 256 levels!
Digital images typically are quantized to 256 gray levels. !
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 3 !
Brightness discrimination experiment !
Can you see the circle?!
I + I
125! 126! 128! 129! 130! 127!
Note: I is luminance, measured in cd m 2
Visibility threshold!
I I KWeber 12%
Bernd Girod: EE368 Digital Image Processing!
Weber fraction! Webers Law!
Point Operations no. 4 !
Contrast ratio without contouring !
Luminance ratio between two successive quantization levels at visibility threshold!
I max N 1 = (1 + KWeber ) I min
For! KWeber = 0.010.02 N = 256 Typical display contrast ratio!
I max = 13156 I min
Modern at panel display in dark room 1000:1! Cathode ray tube 100:1! Print on paper 10:1!
Suggests uniform perception in the log(I) domain (Fechners Law)!
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 5 !
Gamma characteristic !
Cathode ray tubes (CRTs) are nonlinear!
Luminance!
I!
I ~ U
= 2.0 . . . 2.3!
Voltage U!
Cameras contain -predistortion circuit!
U ~ I1
Bernd Girod: EE368 Digital Image Processing!
Point Operations no. 6 !
log vs. -predistortion !
U
U ~ log(I )
U ~ I1
Imax = 100 Imin
Similar enough for most practical applications!
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 7 !
Photographic lm!
Hurter & Drifeld curve (H&D curve)! for photographic negative! slope -!
Luminance!
shoulder!
2.0
density d
I = I 0 10 d = I 0 10 ( log E +d0 ) = I 0 10 d0 E
1.0
toe!
linear region!
log E
E is exposure
0
d0
measures lm contrast!
General purpose lms: = -0.7 . . . -1.0! High-contrast lms: = -1.5 . . . -10!
Lower speed lms tend to have higher absolute !
Bernd Girod: EE368 Digital Image Processing!
Point Operations no. 8 !
Brightness adjustment by intensity scaling !
Original image! Scaled image!
f [ x, y ]
a f [ x, y ]
Scaling in the -domain is equivalent to scaling in the linear luminance domain
I ~ ( a f [ x, y ]) = a ( f [ x, y ])
. . . same effect as adjusting camera exposure time. !
Bernd Girod: EE368 Digital Image Processing!
Point Operations no. 9 !
Contrast adjustment by changing !
Original image!
increased by 50%!
f [ x, y ]
a ( f [ x, y ])
with
= 1.5
. . . same effect as using a different photographic lm . . .!
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 10 !
Contrast adjustment by changing !
Scaled ramp 20!
Original ramp 0!
Scaling chosen to! approximately preserve! brightness of mid-gray!
Scaled ramp 0.50!
Point Operations no. 11 !
Bernd Girod: EE368 Digital Image Processing!
Gray level histograms !
Distribution of gray levels can be judged by measuring a histogram:!
For B-bit image, initialize 2B counters with 0 ! Loop over all pixels x,y! When encountering gray level f [x,y]=i, increment counter #
Normalized histogram may be thought of as an empirical probability distribution.! You can also use fewer, larger bins to trade off amplitude resolution against sample size.!
Bernd Girod: EE368 Digital Image Processing!
Point Operations no. 12 !
Example histogram !
#pixels!
Cameraman ! image! gray level!
Bernd Girod: EE368 Digital Image Processing!
Point Operations no. 13 !
Example histogram !
#pixels!
gray level!
Pout ! image!
Bernd Girod: EE368 Digital Image Processing!
Point Operations no. 14 !
Histogram equalization !
Idea: nd a non-linear transformation!
g=T(f)
!to be applied to each pixel of the input image f [x,y], such that a uniform distribution of gray levels in the entire range results for the output image g[x,y].
Analyse ideal, continuous case rst, assuming! 0 g 1 0 f 1
T(f) is strictly monotonically increasing, hence, there exists! 0 g 1 f = T 1 ( g )
Goal: pdf pg(g) = 1 over the range ! g 1 0
Point Operations no. 15 !
Bernd Girod: EE368 Digital Image Processing!
Histogram equalization for continuous case !
From basic probability theory!
df pg ( g ) = p f ( f ) dg f =T 1 ( g )
Consider the transformation function!
g = T ( f ) = p f ( ) d
0 f
0 f 1
Then . . . !
dg = pf ( f ) df
df 1 pg ( g ) = p f ( f ) = p f ( f ) =1 dg f =T 1 ( g ) p f ( f ) 1 f =T ( g )
0 g 1
Bernd Girod: EE368 Digital Image Processing!
Point Operations no. 16 !
Histogram equalization for discrete case !
Now, f only assumes discrete amplitude values f0 , f1 ,, fL1 ! !with empirical probabilities!
n0 P0 = n n1 P1 = n nL1 PL1 = n
L1
where n = nl
l =0
Discrete approximation of! g = T ( f ) = p f ( ) d
0
gk = T ( fk ) = Pi
i=0
for k = 0,1..., L 1
The resulting values gk are in the range [0,1] and need to be scaled and rounded appropriately. !
Bernd Girod: EE368 Digital Image Processing!
Point Operations no. 17 !
Histogram equalization example !
Original image Pout !
Pout! after histogram equalization !
Point Operations no. 18 !
Bernd Girod: EE368 Digital Image Processing!
Histogram equalization example !
Original image Pout ! . . . after histogram equalization !
#pixels!
gray level!
#pixels!
gray level!
Bernd Girod: EE368 Digital Image Processing!
Point Operations no. 19 !
Histogram equalization example !
Original image Cameraman !
Cameraman ! after histogram equalization !
Bernd Girod: EE368 Digital Image Processing!
Point Operations no. 20 !
Histogram equalization example !
Original image Cameraman ! . . . after histogram equalization !
#pixels!
gray level!
#pixels!
gray level!
Bernd Girod: EE368 Digital Image Processing!
Point Operations no. 21 !
Histogram equalization example !
Original image Moon !
Moon ! after histogram equalization !
Bernd Girod: EE368 Digital Image Processing!
Point Operations no. 22 !
Histogram equalization example !
Original image Moon ! . . . after histogram equalization !
#pixels!
gray level!
#pixels!
gray level!
Bernd Girod: EE368 Digital Image Processing!
Point Operations no. 23 !
Contrast-limited histogram equalization !
Output gray level!
Equalization with! original histogram!
#pixels!
Equalization with! clipped histogram!
Histogram Clipping!
Input gray level! gray level!
Input gray level!
Bernd Girod: EE368 Digital Image Processing!
Point Operations no. 24 !
Adaptive histogram equalization !
Apply histogram equalization based on a histogram obtained from a portion of the image!
Sliding window approach:
different histogram (and mapping) for every pixel!
Tiling approach:
subdivide into overlapping regions, mitigate blocking effect by smooth blending between neighboring tiles !
Must limit contrast expansion in at regions of the image, e.g. by clipping individual histogram values to a maximum (CLAHE - Contrast-limited adaptive histogram equalization)!
[Pizer, Amburn et al. 1987]!
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 25 !
Adaptive histogram equalization !
Original!
Global histogram!
Tiling 8x8 histograms!
Tiling 32x32 histograms!
Bernd Girod: EE368 Digital Image Processing!
Point Operations no. 26 !
Adaptive histogram equalization !
Original image Dental Xray !
Adaptive histogram equalization, 16x16 tiles !
Dental Xray after equalization of global histogram!
Bernd Girod: EE368 Digital Image Processing!
Point Operations no. 27 !
Adaptive histogram equalization !
Original image !
Global histogram equalization !
Adaptive histogram ! equalization 8x8 tiles !
Bernd Girod: EE368 Digital Image Processing!
Point Operations no. 28 !
Point operations for combining images !
Image averaging for noise reduction! Combination of different exposures for high-dynamic range imaging! Image subtraction for change detection! Accurate alignment is always a requirement!
Bernd Girod: EE368 Digital Image Processing!
Point Operations no. 29 !
Image averaging for noise reduction!
1 image 2 images 4 images!
[Link]
Bernd Girod: EE368 Digital Image Processing!
Point Operations no. 30 !
High-dynamic range imaging !
16 exposures, one f-stop (2X) apart!
[Debevec, Malik, 1997] !
Bernd Girod: EE368 Digital Image Processing!
Combined image!
Point Operations no. 31 !
Image subtraction !
Find differences/changes between 2 mostly identical images! Example: digital subtraction angiography!
Contrast ! enhancement !
[Link]
Bernd Girod: EE368 Digital Image Processing!
Point Operations no. 32 !
Video background subtraction !
New Frame ! Background Frame ! New Frame ! Background Frame !
+!
-!
+!
-!
Abs(.) > ?
Abs(.) > ?
Update: Background[t] := Background[t-1] + (1- ) New[t]
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 33 !
Image subtraction example from IC manufacturing: die-to-die comparison of photomasks !
Bernd Girod: EE368 Digital Image Processing!
Point Operations no. 34 !
Where is the defect? !
Image A (no defect)!
Image B (w/ defect)!
Bernd Girod: EE368 Digital Image Processing!
Point Operations no. 35 !
Absolute difference between two images!
w/o alignment!
w/ alignment and thresholding!
Bernd Girod: EE368 Digital Image Processing!
Point Operations no. 36 !