Chapter Overview: Point Operationsee225b/fa12/lectures/2-Point... · 2012-09-18 · Bernd Girod:...
Transcript of Chapter Overview: Point Operationsee225b/fa12/lectures/2-Point... · 2012-09-18 · Bernd Girod:...
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 1!
Chapter Overview: Point Operations!
Relating gray values to brightness! Gray value quantization! Weberʼs 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. 2!
Quantization: how many bits per pixel?!
8 bits 5 bits 4 bits
3 bits 2 bits 1 bit
„Contouring“
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 3!
How many gray levels are required?!
Contouring is most visible for a ramp!
Digital images typically are quantized to 256 gray levels. !
32 levels!
64 levels!
128 levels!
256 levels!
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 4!
130!129!128!127!126!125!
Brightness discrimination experiment!
Can you see the circle?!
Visibility threshold!
I
I + ΔI
ΔI I ≈ KWeber ≈1…2% „Weber fraction“!„Weberʻs Law“!
Note: I is luminance,measured in cd m2
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 5!
Contrast ratio without contouring!
Luminance ratio between two successive quantization levels at visibility threshold!
For! Typical display contrast ratio!
Modern flat 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 („Fechnerʻs Law“)!
ImaxImin
= 1+ KWeber( )N−1
KWeber = 0.010.02 N = 256 Imax
Imin
= 13156
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 6!
Cathode ray tubes (CRTs) are nonlinear!
Cameras contain γ-predistortion circuit!
Gamma characteristic!
γ = 2.0 . . . 2.3!
Luminance!I!
Voltage U!
I ~U γ
U ~ I1 γ
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 7!
log vs. γ-predistortion!
Similar enough for most practical applications!
U
I
U ~ I1 γ
U ~ log(I )
ImaxImin
= 100
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 8!
Photographic film !
γ measures film contrast! General purpose films: γ = -0.7 . . . -1.0! High-contrast films: γ = -1.5 . . . -10!
Lower speed films tend to have higher absolute γ!
slope -γ!
log E
E is exposure
dens
ity d
shoulder!
toe!
„linear“ region!
I = I0 ⋅10−d
= I0 ⋅10− −γ logE+d0( )
= I0 ⋅10−d0 ⋅Eγ
Luminance!
Hurter & Driffield curve (H&D curve)!for photographic negative!
d0 0
2.0
1.0
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 9!
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
. . . same effect as adjusting camera exposure time.!
I ~ a ⋅ f x, y[ ]( )γ = aγ ⋅ f x, y[ ]( )γ
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 10!
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 film . . .!
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 11!
Contrast adjustment by changing γ!
Original ramp γ0!
Scaled ramp 2γ0!
Scaled ramp 0.5γ0!
Scaling chosen to!approximately preserve!brightness of mid-gray!
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 12!
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. 13!
Example histogram!
gray level!
#pix
els!
Cameraman!image !
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 14!
Example histogram!
gray level!
#pix
els!
Pout!image !
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 15!
Histogram equalization!
Idea: find a non-linear transformation!
!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 first, assuming! T(f) is strictly monotonically increasing, hence, there
exists!
Goal: pdf pg(g) = 1 over the range !
0 ≤ f ≤1
f = T −1 g( )
g = T f( )
0 ≤ g ≤1
0 ≤ g ≤1
0 ≤ g ≤1
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 16!
Histogram equalization for continuous case!
From basic probability theory!
Consider the transformation function!
Then . . . !
pg g( ) = pf f( ) dfdg
⎡
⎣⎢
⎤
⎦⎥f =T −1 g( )
g = T f( ) = pf α( )0
f
∫ dα 0 ≤ f ≤1
dgdf
= pf f( )
pg g( ) = pf f( ) dfdg
⎡
⎣⎢
⎤
⎦⎥f =T −1 g( )
= pf f( ) 1pf f( )
⎡
⎣⎢⎢
⎤
⎦⎥⎥ f =T −1 g( )
= 1 0 ≤ g ≤1
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 17!
Histogram equalization for discrete case!
Now, f only assumes discrete amplitude values !!with empirical probabilities!
Discrete approximation of!
The resulting values gk are in the range [0,1] and need to be scaled and rounded appropriately. !
f0 , f1,, fL−1
P0 =
n0
n P1 =
n1
n PL−1 =
nL−1
n where n = nl
l=0
L−1
∑
g = T f( ) = pf α( )0
f
∫ dα
gk = T fk( ) = Pii=0
k
∑ for k = 0,1...,L −1
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 18!
Histogram equalization example!
Original image Pout! Pout !after histogram equalization!
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 19!
Histogram equalization example!
Original image Pout! . . . after histogram equalization!
gray level!
#pix
els!
gray level!
#pix
els!
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 20!
Histogram equalization example!
Original image Cameraman!
Cameraman!after histogram equalization!
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 21!
Histogram equalization example!
Original image Cameraman! . . . after histogram equalization!
gray level!
#pix
els!
gray level!
#pix
els!
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 22!
Histogram equalization example!
Original image Moon! Moon!after histogram equalization!
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 23!
Histogram equalization example!
Original image Moon! . . . after histogram equalization!
gray level!
#pix
els!
gray level!
#pix
els!
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 24!
Contrast-limited histogram equalization!
gray level!
Histogram Clipping!
Input gray level!
Out
put g
ray
leve
l!
Equalization with!clipped histogram!
Equalization with!original histogram!
Input gray level!
#pix
els!
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 25!
Adaptive histogram equalization! Apply histogram equalization based on a histogram obtained
from a portion of the image!
Must limit contrast expansion in flat regions of the image,e.g. by clipping individual histogram values to a maximum(CLAHE - “Contrast-limited adaptive histogram equalization”)!
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 !
[Pizer, Amburn et al. 1987]!
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 26!
Adaptive histogram equalization!
Original! Global histogram! Tiling 8x8 histograms!
Tiling 32x32 histograms!
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 27!
Adaptive histogram equalization!
Original image Dental Xray!
Dental Xray after equalization ofglobal histogram!
Adaptive histogram equalization, 16x16 tiles!
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 28!
Adaptive histogram equalization!
Original image! Globalhistogram
equalization!
Adaptive histogram!equalization
8x8 tiles!
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 29!
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. 30!
Image averaging for noise reduction !
http://www.cambridgeincolour.com/tutorials/image-averaging-noise.htm!
1 image 2 images 4 images!
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 31!
High-dynamic range imaging!
16 exposures, one f-stop (2X) apart!
Combined image![Debevec, Malik, 1997] !
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 32!
Image subtraction!
Find differences/changes between 2 mostly identical images! Example: digital subtraction angiography!
- +
Contrast!enhancement!
http://www.isi.uu.nl/Research/Gallery/DSA/!
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 33!
Video background subtraction!
New Frame! Background Frame!
-!+!
Abs(.) > θ ?
-!+!
Abs(.) > θ ?
New Frame! Background Frame!
Update: Background[t] := α Background[t-1] + (1- α) New[t]
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 34!
Image subtraction example from IC manufacturing:die-to-die comparison of photomasks!
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 35!
Where is the defect?!
Image A (no defect)! Image B (w/ defect)!
Bernd Girod: EE368 Digital Image Processing! Point Operations no. 36!
Absolute difference between two images !
w/o alignment! w/ alignment and thresholding!