Transcript ch5-10

Chapter 5
Digital Image Processing
Fundamentals
Time
• Why would you want to?
• How do you time stuff?
• What kinds of API’s are available for
timing.
Why time stuff?
• Image Processing can be slow.
• To measure performance improvements.
• WHO CARES?
– User cares. Users notice if a program runs slow.
– Hardware people ( mission critical response
times).
– Medical Application.
– Security (luggage) face recognition.
How do you time stuff?
•
•
•
•
•
stop-watch
subroutines (date functions) to get time.
java.util.date (perhaps to within a second)
Hardware interface
Processor clock (milliseconds).
To automate timing..
• Need framework for benchmarking.
• Framework – set of related classes design to
solve a problem.
• java 4 programmers I have:
– utils.Timer
How do I use the Timer?
•
•
•
•
•
•
•
•
•
•
•
•
public static void main(String[] args) {
Timer t = new Timer();
t.mark();
double j = Math.PI;
for (int i=0; i < 100000000; i++){
j = j / Math.E;
j = Math.PI;
}
t.record();
float f = t.getElapsedTime();
t.report();
}
How do you make timing
meaningful?
• What was done in the given time?
• What environment ran the experiment?
–
–
–
–
–
What machine was used?
How did much memory did you have?
What processor was there?
What speed did the processor run at?
What compiler switches did you use?
How do I find out about the
machine?
• System.properties!
Learning Goals
• The human visual system
• Digitizing images
• Display of Images
Trading an eye for an ear
optical
axis
fovea
centralis
cornea
iris
optic
lens disk
retina
optic
nerve
An eye is a Multi-mega pixel
camera
•
•
•
•
It has a lens (adjustable zoom)
It has an automatic f-stop (iris 2-8 mm)
It has a sensor plane (100 million pixels)
The sensor has a transfer function senstive
to mesopic range; 380 to about 700 nm
The eyes have a USB2 data rate!
•
•
•
•
•
•
250,000 neurons in the optic nerve
variable voltage output on EACH nerve
17.5 million neural samples per second
12.8 bits per sample
224 Mbps, per eye (a 1/2 G bps system!).
Compression using lateral inhibition
between the retinal neurons
Response curves
• Eye has Gaussian response to light.
• Gives rise to biologically motivated image
processing
Quantization of an Image
• Computers use digital cameras ->
quantization
SNR  6b  4.8
SNR 10 log 3  2
2b
  20b log 2 10log 3
Delta-function
 x(0) n  0
x ( n)   ( n)  
0 else
Sampling an Image
f ( x)
Anti-aliasing
Filter
fs
Sampling=convolution w pulse
train

F(u) * P(u) 
F(

)P(u


)d






 j 2 ux 
F(u) * P(u)   f (x)   (x  n / f s )e
dx



n



Quantization Error is visible
Displays
• Color Monitors are made for people