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
36
Embed
Chapter Overview: Point Operationsee225b/fa12/lectures/2-Point... · 2012-09-18 · Bernd Girod: EE368 Digital Image Processing! Point Operations no. 15! Histogram equalization! Idea:
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
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!
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”)!