Вы находитесь на странице: 1из 37

What is an image?

  Ideally, we think of an image as a 2-dimensional light


intensity function, f(x,y), where x and y are spatial
coordinates, and f at (x,y) is related to the brightness or
color of the image at that point.
  In practice, most images are defined over a rectangle.
  Continous in amplitude („continous-tone“)
  Continous in space: no pixels!

Bernd Girod: EE368 Digital Image Processing Point Operations no. 1


Digital Images and Pixels

  A digital image is the representation of a continuous image


f(x,y) by a 2-d array of discrete samples. The amplitude of
each sample is quantized to be represented by a finite
number of bits.
  Each element of the 2-d array of samples is called a pixel
or pel (from „picture element“)
  Think of pixels as point samples, without extent.

Bernd Girod: EE368 Digital Image Processing Point Operations no. 2


Image Resolution

200x200 100x100 50x50 25x25

•  These images were produced by simply picking every n-th sample


horizontally and vertically and replicating that value nxn times.
•  We can do better
–  prefiltering before subsampling to avoid aliasing
–  Smooth interpolation

Bernd Girod: EE368 Digital Image Processing Point Operations no. 3


Color Components
Monochrome image

R(x,y) = G(x,y) = B(x,y)

Red R(x,y) Green G(x,y) Blue B(x,y)

Bernd Girod: EE368 Digital Image Processing Point Operations no. 4


Different numbers of gray levels
256 32 16

„Contouring“

8 4 2
Bernd Girod: EE368 Digital Image Processing Point Operations no. 5
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. 6


Brightness discrimination experiment

  Can you see the circle?

I + ΔI

Note: I is luminance,
125
126
128
129
130
127
I measured in cd m 2

  Visibility threshold
„Weber fraction“
ΔI I ≈ KWeber ≈ 1…2% „Weberʻs Law“

Bernd Girod: EE368 Digital Image Processing Point Operations no. 7


Contrast with 8 Bits According to Weberʻs Law

  Assume that the luminance difference between two


successive representative levels is just at visibility threshold

I max 255
= (1 + KWeber )
I min

I max
  For KWeber = 0.010.02 = 13156
  Typical display contrast
I min
  Cathode ray tube 100:1
  Print on paper 10:1
  Suggests uniform perception in the log(I) domain
(„Fechnerʻs Law“)

Bernd Girod: EE368 Digital Image Processing Point Operations no. 8


Gamma characteristic

  Cathode ray tubes (CRT) 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. 9


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. 10


Photographic film
Hurter & Driffield curve (H&D curve)
for photographic negative

slope -γ Luminance
2.0 shoulder
I = I 0 ⋅10 − d
= I 0 ⋅10 −( − γ log E +d0 )
density d

„linear“ region
1.0 = I 0 ⋅10 − d0 ⋅ E γ

toe log E
0
d0 E is exposure
  γ measures film contrast
  General purpose films: γ = -0.7 . . . -1.0
  High-contrast films: γ = -1.5 . . . -10
  Lower speed films tend to have higher absolute γ

Bernd Girod: EE368 Digital Image Processing Point Operations no. 11


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. 12


Adjusting γ

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. 13


Changing gradation by γ-adjustment

Scaled ramp 2γ0

Original ramp γ0

Scaling chosen to
approximately preserve
brightness of mid-gray
Scaled ramp 0.5γ0

Bernd Girod: EE368 Digital Image Processing Point Operations no. 14


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 #ι
  Histogram can be interpreted as an estimate of the
probability density function (pdf) of an underlying random
process.
  You can also use fewer, larger bins to trade off amplitude
resolution against sample size.

Bernd Girod: EE368 Digital Image Processing Point Operations no. 15


#pixels Example histogram

Cameraman
image
gray level

Bernd Girod: EE368 Digital Image Processing Point Operations no. 16


#pixels
Example histogram

Pout
image
gray level

Bernd Girod: EE368 Digital Image Processing Point Operations no. 17


Histogram equalization

  Idea: find 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 first, assuming

  0 ≤ f ≤1 0 ≤ g ≤1
  T(f) is strictly monotonically increasing, hence, there
exists
f = T −1 ( g ) 0 ≤ g ≤1

  Goal: pdf pg(g) = const. over the range

Bernd Girod: EE368 Digital Image Processing Point Operations no. 18


Histogram equalization for continuous case

  From basic probability theory


 df 
pg ( g ) =  p f ( f ) 
 dg  f =T −1 ( g )
  Consider the transformation function
f
g = T ( f ) = ∫ p f (α )dα 0 ≤ f ≤1
0

  Then . . . dg
= pf ( f )
df
 df   1 
pg ( g ) =  p f ( f )  =  pf ( f )  =1 0 ≤ g ≤1
 dg  f =T −1 ( g )  p f ( f )  −1
f =T ( g )

Bernd Girod: EE368 Digital Image Processing Point Operations no. 19


Histogram equalization for discrete case

  Now, f only assumes discrete amplitude values f0 , f1 ,, fL−1


with „probabilities“
n0 n1 nL−1
P0 = P1 =  PL−1 =
n n n
f
  Discrete approximation of g = T ( f ) = ∫ p f (α ) dα
0
k
gk = T ( fk ) = ∑ Pi
i=0

  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. 20


Histogram equalization example

Original image Pout Pout


after histogram equalization

Bernd Girod: EE368 Digital Image Processing Point Operations no. 21


Histogram equalization example
Original image Pout . . . after histogram equalization
#pixels

#pixels
gray level gray level

Bernd Girod: EE368 Digital Image Processing Point Operations no. 22


Histogram equalization example

Original image Cameraman


Cameraman after histogram equalization

Bernd Girod: EE368 Digital Image Processing Point Operations no. 23


Histogram equalization example
Original image Cameraman . . . after histogram equalization
#pixels

#pixels
gray level gray level

Bernd Girod: EE368 Digital Image Processing Point Operations no. 24


Histogram equalization example

Original image Moon Moon


after histogram equalization

Bernd Girod: EE368 Digital Image Processing Point Operations no. 25


Histogram equalization example
Original image Moon . . . after histogram equalization

#pixels
#pixels

gray level gray level

Bernd Girod: EE368 Digital Image Processing Point Operations no. 26


Adaptive Histogram Equalization

  Apply histogram equalization based on a histogram obtained


from a portion of the image

Sliding window approach:
 Tiling approach:



different histogram (and mapping)
 subdivide into overlapping regions,

for every pixel mitigate blocking effect by smooth blending

between neighboring tiles

  Must limit contrast expansion in flat regions of the image,



e.g. by clipping individual histogram values to a maximum

Bernd Girod: EE368 Digital Image Processing Point Operations no. 27


Adaptive Histogram Equalization

Original Global histogram Tiling
 Tiling



8x8 histograms 32x32 histograms

Bernd Girod: EE368 Digital Image Processing Point Operations no. 28


Adaptive histogram equalization

Original image Tire Tire after 
 Tire after 



equalization of
 adaptive histogram equalization

global histogram 8x8 tiles

Bernd Girod: EE368 Digital Image Processing Point Operations no. 29


Point Operations Combining Images

  Image averaging for noise reduction


  Combination of different exposure 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
1 image 2 images 4 images

http://www.cambridgeincolour.com/tutorials/noise-reduction.htm

Bernd Girod: EE368 Digital Image Processing Point Operations no. 31


Image averaging for noise reduction

  Take N aligned images f1 ( x, y ) , f 2 ( x, y ) ,, f N ( x, y )

1 N
  ( )
Average image: f x, y = ∑ f i x, y
N i=1
( )
  Mean squared error vs. noise-free image g
2 2
2   1      1   
     

( 
)     N i
(
E  f − g  = E   ∑ f i  − g   = E   ∑ g + ni  − g  
  N i    
)
 
2
 1   1 1
= E  ∑ ni   = 2 ∑ E ni2 = { } E n2 { }
 N i   N i N

{ }
provided E ni n j = 0∀i, j { }
E ni = E n ∀i {}
Bernd Girod: EE368 Digital Image Processing Point Operations no. 32
High-dynamic range imaging

16 exposures, one f-stop (2X) apart

[Debevec, Malik, 1997] Combined image


Bernd Girod: EE368 Digital Image Processing Point Operations no. 33
Image subtraction

  Find differences/changes between 2 mostly identical images


  Example from IC manufacturing: 

defect detection in photomasks 

by die-to-die comparison

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

Bernd Girod: EE368 Digital Image Processing Point Operations no. 36


Digital Subtraction Angiography

- +

Contrast
enhancement

http://www.isi.uu.nl/Research/Gallery/DSA/
Bernd Girod: EE368 Digital Image Processing Point Operations no. 37

Вам также может понравиться