You are encouraged to collaborate on homework
problems and labs with your classmates. However,
cheating of any kind, including copying of others’
work of any kind is prohibited, and will not be
tolerated All university,
tolerated.
university school,
school department rules
apply.

Optical Illusions
• How accurately can we estimate and compare distances and areas?
• By which features can we detect and distinguish objects?

Why do we need long optical nerves?

Adelson's checker shadow illusion
Square A is exactly the same
shade of grey as square B.
Link

When interpreted as a 3D scene,
our visual system immediately
estimates a lighting vector and
uses this to judge the property of
the material.

The Brain Sees What We Don't
The human visual system is extremely powerful in
recognizing objects, but is less well suited for
accurate measurements of gray values, distances,
and areas.
areas
Solution: Let computers do the math and
measurements.

Purpose: Spreading/compressing
a narrow range of the low
intensity values in the input image
into a wider range of intensities
– s =c*log(1+ r)
– c is a constant

L-1

Power Law Transformation
s  c(r  ε)γ
Purpose: the same as the log
transformation
Advantages:
• More flexible in comparison to log
transformation
• Varying one parameter is enough to
yield a change in the image
• Varying gamma can get a family of
transformation curves

s  c(r  ε)γ
c = 1,
γ = 1, 3, 4

Criteria: Subjective or Objective?

9

Which gray mapping method?

255

0
threshold

255

0

255
negative

• Purpose: increase the dynamic range of intensities in the
image
• Determine 2 points (r1,s1) and (r2,s2) which band the
transformation line
r1, r2 relate to the input image
s1, s2 relate to the output image
Result is 3 sections each with a different linear
transformation

255

255

255

Piecewise-Linear Transformation Functions

0

log

255

0

255
γ=2

Piecewise-Linear Transformation Functions

Looks better after transformation?

Application: Contrast Stretching

Disadvantage: requires considerably more user input.

Bit Plane Slicing

Bit Planes
Original

Least significant bit plane 

 Most significant bit plane

For pattern recognition, the most significant bit plane is enough

10

Recon from bit planes 7-8

bit planes 6-8

bit planes 5-8

Most medical images are saved in 16 bit integer, unsigned

Bit Planes (1-8)

Bit Planes (9-16)

Steganography

Original image in uint16

Recon image from bit plane 8 to 14

In most hospitals and universities, the first choice is ‘keep everything’.

Removing all but the two least significant bits of each color component
produces an almost completely black image. Making that image 85 times
brighter produces the image on the right side.
http://en.wikipedia.org/wiki/Steganography

• Let pr(r) and ps(s) denote the Probability Density Function (PDF) of
the random variables r and s respectively.
• Given pr(r) and T(r), if T(r) is continuous and differentiable, the PDF
of the transformed variable s

ddr
p s ( s )  pr ( r )
ds
• The PDF of the transformed variable, s, is determined by the PDF of
the input image and on the transformation function

1

• Most widely used: a cumulative distribution function as the
transformation function
r

Local Histogram Processing
• Define a mask and move the center from pixel to pixel
for each neighborhood. (sliced window)
• Calculate histogram equalization/specification function
• Map the intensity of pixel centered in neighborhood
• Can use new pixel values and previous histogram to
calculate next histogram (implementation details)

original

equalized

specified

Note: Histogram specification is easier for discrete case, but the
histogram of an output image is the approximation for desired
histogram.

Averaging Filter
• Purpose: remove high frequencies from the image
(smoothing or blurring)
• Operation: Assign the average value of a kernel to the
center of a neighborhood
• The size of kernel controls the smoothing effect

– R = min(zk | k=1,…,9)

• Predefined percentage

8

2

5

5

4

6

7

8

9

Averaging vs. Median Filter

X-Ray image

3x3 averaging filter

8 2 5 5 4 6 7 8 9
Average: 6

Difference between median and average?

Weighted Average

1

3x3 median filter
? ×

It seems that the averaging is quite close to the
median. Why the output images are so different?

Gaussian Kernel

1

1

1

1

Weighted Averaging Equation
1

g ( x, y ) 

1

  w(s, t ) f ( x  s, y  t )

s  1t  1

1

1

  w(s, t )

s  1t  1

You can design your own filters by modifying the weights.

17

Kernel Size

1x1

3x3

9x9

5x5

Image from Hubble
Space Telescope

35 x 35

15 x 15

•
•

15 x 15 averaging
kernel

Thresholding

Get a gross representation of objects
Detect large objects

Image Sharpening
• Operators for sharpening: derivative operator which is
proportional to the degree of intensity discontinuity.