Title: Digital Image Processing Fundamentals
1Chapter 5
- Digital Image Processing Fundamentals
2Learning Goals
- The human visual system
- Digitizing images
- Display of Images
3Trading an eye for an ear
4An 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
5The 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
6Response curves
- Eye has Gaussian response to light.
- Gives rise to biologically motivated image
processing
7Quantization of an Image
- Computers use digital cameras -gt quantization
8Delta-function
9Sampling an Image
10Samplingconvolution w pulse train
11Quantization Error is visible
12Displays
- Color Monitors are made for people
13Chapter 6-7
- Opening and Saving Images
14Chapter 8 Convolutionwith a kernel, g(x)
15Convolution
- 1D and 2D signal processing
16Consider the delta function
17Time-shift delta
18Sample the input (its a convolution!)
19What does sampling do to spectrum?
20What is the spectrum?
21Fourier Coefficients
22CTFT
23Eulers identity
24Sine-cos Rep
25Harmonic Analysis
26Convolutiontime-shiftmulti
27Convolution Thm
multiplication in the time domain convolution
in the frequency domain
28Sample
29Spectrum reproduced
spectrum to be reproduced at intervals
30Summary
31Example of 1D convoln
322D Convolution
33Region of Support
- The region of support is defined as that area of
the .kernel which is non-zero - linear convolutionsignal has infinite extent
but kernel has finite support - If function has finite region of support we have
compact support
34Real images have finite region of support
- But we treat them as periodic and infinite!
- We repeat kernels so that they have the same
period as the images. - We call this cyclic convolution.
35Convolution in 2D
36Avoid the Mod op
37What is wrong with avoiding the mod op?
- How do I find the center of the kernel?
38Cyclic Convolution
39Implementing Convolution
for(int y 0 y lt height y) for(int
x 0 x lt width x) sum 0.0
for(int v -vc v lt vc v)
for(int u -uc u lt uc u)
sum fcx(x-u) cy(y-v) k uucvvc
if (sum lt 0) sum 0 if (sum gt 255)
sum 255 hxy (short)sum
40What happens to the image if you ignore the wrap?
41Cyclic Convolution keeps the edges
42Can you think of a better way to implement
convolution?
- Keep the edges!
- Dont use the mod operation.
- How about growing the image by the size of the
kernel2?
43Convolution is slow, how can I speed it up?
44Chapter 9
- Spatial Filters
- Blurring
- Median Filtering
- Hi-pass filtering
- SpatialFilterFrame and JAI
45BlurringLow-pass Filters
46Why Blur an Image?
- Remove Noise
- Other ideas?
47Averagelow-pass
48Want Unity Gain
49Many variations on LP filters
50Gaussian Blur
51Why use Gaussian Blur?
- How the eye works
- Symmetric
- Differentiable
- Smooth
52Classic bell curve
53Larger Kernelsmore blur
54Median Filtering
- Middle of a list of samples listed in ascending
order. - Sort samples, return n/2
55Why use median filtering?
- Discard outliers
- 0, 85, 90, 87 and 100. The mean is 72
- Median is 87.
- 0, 85, 87, 90, and 10087
56How do I implement the median?
57Salt and Pepper
58Median 3x3
59Median on any kernel
60Median result
61Median Octagon, less aggressive
62Median Octagon results
63Median Filtering is not FREE!
- Image degradation
- Selective median filtering.
- How do you know when to apply it?