Upload
hatorri-hanso
View
3.209
Download
0
Tags:
Embed Size (px)
DESCRIPTION
Citation preview
EECE/CS 253 Image Processing
Richard Alan Peters IIDepartment of Electrical Engineering and
Computer ScienceFall Semester 2007
Lecture Notes: Introduction and Overview
This work is licensed under the Creative Commons Attribution-Noncommercial 2.5 License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/2.5/ or send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA.
April 10, 2023 2 1999-2007 by Richard Alan Peters II
Introduction and Overview
This presentation is an overview of some of the ideas and techniques to be covered during the course.
April 10, 2023 3 1999-2007 by Richard Alan Peters II
1. image formation 2. point processing and equalization 3. color correction 4. the fourier transform 5. convolution 6. image sampling and warping 7. spatial filtering 8. noise reduction 9. mathematical morphology10. image compression
TopicsTopics
April 10, 2023 4 1999-2007 by Richard Alan Peters II
Wallace and Gromit
Wallace
Gromitlikes cheeselikes cheese
reads Electronics for Dogsreads Electronics for Dogs
http://www.aardman.com/wallaceandgromit/index.shtml
Wallace and Gromit will be subjects of some of the imagery in this introduction.
April 10, 2023 5 1999-2007 by Richard Alan Peters II
Image FormationImage Formation
objec
t
image plane
lens
April 10, 2023 6 1999-2007 by Richard Alan Peters II
Image FormationImage Formationlig
ht so
urce
April 10, 2023 7 1999-2007 by Richard Alan Peters II
Image FormationImage Formation
projection through lens
projection through lens
image of objectimage of object
April 10, 2023 8 1999-2007 by Richard Alan Peters II
Image FormationImage Formation
projection onto discrete sensor array.
projection onto discrete sensor array. digital cameradigital camera
April 10, 2023 9 1999-2007 by Richard Alan Peters II
Image FormationImage Formation
sensors register average color.
sensors register average color.
sampled imagesampled image
April 10, 2023 10 1999-2007 by Richard Alan Peters II
Image FormationImage Formation
continuous colors, discrete locations.
continuous colors, discrete locations.
discrete real-valued image
discrete real-valued image
April 10, 2023 11 1999-2007 by Richard Alan Peters II
Digital Image Formation: Quantization
continuous color input
disc
rete
col
or o
utpu
t
continuous colors mapped to a finite, discrete set of colors.
continuous colors mapped to a finite, discrete set of colors.
April 10, 2023 12 1999-2007 by Richard Alan Peters II
Sampling and Quantization
pixel grid
sampledreal image quantized sampled & quantized
April 10, 2023 13 1999-2007 by Richard Alan Peters II
Digital ImageDigital Image
a grid of squares, each of which contains a single color
a grid of squares, each of which contains a single color
each square is called a pixel (for picture element)
each square is called a pixel (for picture element)
Color images have 3 values per pixel; monochrome images have 1 value per pixel.
April 10, 2023 14 1999-2007 by Richard Alan Peters II
Color Images Are constructed from three
intensity maps. Each intensity map is pro-
jected through a color filter (e.g., red, green, or blue, or cyan, magenta, or yellow) to create a monochrome image.
The intensity maps are overlaid to create a color image.
Each pixel in a color image is a three element vector.
April 10, 2023 15 1999-2007 by Richard Alan Peters II
Color Images On a CRT
Color Images On a CRT
April 10, 2023 16 1999-2007 by Richard Alan Peters II
Point ProcessingPoint Processing
original + gamma- gamma + brightness- brightness
original + contrast- contrast histogram EQhistogram mod
April 10, 2023 17 1999-2007 by Richard Alan Peters II
Color Processing
requires some knowledge of how we see colors
requires some knowledge of how we see colors
April 10, 2023 18 1999-2007 by Richard Alan Peters II
Eye’s Light Sensors
#(blue) << #(red) < #(green)
cone density near fovea
April 10, 2023 19 1999-2007 by Richard Alan Peters II
Color Sensing / Color PerceptionThese are approximations of the responses to the visible spectrum of the “red”, “green”, and “blue” receptors of a typical human eye.
These are approximations of the responses to the visible spectrum of the “red”, “green”, and “blue” receptors of a typical human eye.
April 10, 2023 20 1999-2007 by Richard Alan Peters II
These are approximations of the responses to the visible spectrum of the “red”, “green”, and “blue” receptors of a typical human eye.
These are approximations of the responses to the visible spectrum of the “red”, “green”, and “blue” receptors of a typical human eye.
The simultaneous red + blue response causes us to perceive a continuous range of hues on a circle. No hue is greater than or less than any other hue.
The simultaneous red + blue response causes us to perceive a continuous range of hues on a circle. No hue is greater than or less than any other hue.
Color Sensing / Color Perception
April 10, 2023 21 1999-2007 by Richard Alan Peters II
luminance
huesaturatio
n
photo receptorsbrain
The eye has 3 types of photoreceptors: sensitive to red, green, or blue light.
The brain transforms RGB into separate brightness and color channels (e.g., LHS).
Color Sensing / Color Perception
April 10, 2023 22 1999-2007 by Richard Alan Peters II
Color Perception
all bandsall bands luminanceluminance chrominancechrominance
redred greengreen blueblue
16× pixelization of:
luminance and chrominance (hue+saturation) are perceived with different resolutions, as are red, green and blue.
luminance and chrominance (hue+saturation) are perceived with different resolutions, as are red, green and blue.
April 10, 2023 23 1999-2007 by Richard Alan Peters II
Color Perception
all bandsall bands luminanceluminance chrominancechrominance
redred greengreen blueblue
16× pixelization of:
April 10, 2023 24 1999-2007 by Richard Alan Peters II
Color Balance and Saturation
Uniform changes in color components result in change of tint.
E.g., if all G pixel values are multiplied by > 1 then the image takes a green cast.
April 10, 2023 25 1999-2007 by Richard Alan Peters II
Color Transformations
218222222
185222222
11412217
106227236
103171240
160171240
17112117
166230240
17112117
11412217
218222222
185222222
160171240
103171240
166230240
106227236
Image aging: a transformation, , that mapped:
April 10, 2023 26 1999-2007 by Richard Alan Peters II
The 2D Fourier Transform of a Digital Image
21 1
0 0, , ,
ur vciR C
R C
u vI r c u v e
I
1 1 2
1
0 0( , )
ur vcR C i
R CRC
r cu,v I r c e
I
Let I(r,c) be a single-band (intensity) digital image with R rows and C columns. Then, I(r,c) has Fourier representation
where
are the R x C Fourier coefficients.
these complex exponentials are 2D sinusoids.
these complex exponentials are 2D sinusoids.
April 10, 2023 27 1999-2007 by Richard Alan Peters II
2D Sinusoids:
orientationorientation
... are plane waves with grayscale amplitudes, periods in terms of lengths, ...
... are plane waves with grayscale amplitudes, periods in terms of lengths, ...
1sin
Rcos
C
2cos
2,
rcA
crI
A
= phase shift
r
c
April 10, 2023 28 1999-2007 by Richard Alan Peters II
2D Sinusoids: ... specific orientations, and phase shifts.
... specific orientations, and phase shifts.
orientation
orientationr
c
r
c
April 10, 2023 29 1999-2007 by Richard Alan Peters II
The Value of a Fourier Coefficient …
… is a complex number with a real part and an imaginary part.
… is a complex number with a real part and an imaginary part.
If you represent that number as a magnitude, A, and a phase, , …
If you represent that number as a magnitude, A, and a phase, , …
..these represent the amplitude and offset of the sinusoid with frequency and direction .
..these represent the amplitude and offset of the sinusoid with frequency and direction .
April 10, 2023 30 1999-2007 by Richard Alan Peters II
The Sinusoid from the Fourier Coeff. at (u,v)
April 10, 2023 31 1999-2007 by Richard Alan Peters II
I |F{I}| [F{I}]
The Fourier Transform of an Image
magnitudemagnitude phasephase
April 10, 2023 32 1999-2007 by Richard Alan Peters II
Continuous Fourier Transform
The continuous Fourier transform assumes a continuous image exists in a finite region of an infinite plane.
The continuous Fourier transform assumes a continuous image exists in a finite region of an infinite plane.
The BoingBoing BloggersThe BoingBoing Bloggers
April 10, 2023 33 1999-2007 by Richard Alan Peters II
Discrete Fourier Transform
The discrete Fourier transform assumes a digital image exists on a closed surface, a torus.
The discrete Fourier transform assumes a digital image exists on a closed surface, a torus.
1
0
21
0)(I
C
u
R
vr
C
uciR
veu,vr,c
I
1
0
21
0)(I
C
u
R
vr
C
uciR
veu,vr,c
I
The BoingBoing BloggersThe BoingBoing Bloggers
April 10, 2023 34 1999-2007 by Richard Alan Peters II
Convolution
16,16 cr
0,0 cr
16,16 cr 16,16 cr
16,16 cr
Sum times 1/5Sum times 1/5
Sums of shifted and weighted copies of images or Fourier transforms.
April 10, 2023 35 1999-2007 by Richard Alan Peters II
Convolution Property of the Fourier Transform
The Fourier Transform of a product equals the convolution of the Fourier Transforms. Similarly, the Fourier Transform of a convolution is the product of the Fourier Transforms
The Fourier Transform of a product equals the convolution of the Fourier Transforms. Similarly, the Fourier Transform of a convolution is the product of the Fourier Transforms
.
bycomputed be can nconvolutio spatiala Then,
tionmultiplicapointwiserepresents
nconvolutiorepresents
.}{
Moreover,
.}{
Then,
).,( and ),( TransformsFourier
have ),( and ),( functionsLet
1GFgf
GFgf
GFgf
vuGvuF
crgcrf
-
F
F
F
April 10, 2023 36 1999-2007 by Richard Alan Peters II
Sampling, Aliasing, & Frequency Convolution
aliasing (the jaggies) no aliasing (smooth lines)
April 10, 2023 37 1999-2007 by Richard Alan Peters II
Sampling, Aliasing, & Frequency Convolution
(a) (b)
(c) (d)
(a) aliased(b) power spectrum(c) unaliased(d) power spectrum
(a) aliased(b) power spectrum(c) unaliased(d) power spectrum
April 10, 2023 38 1999-2007 by Richard Alan Peters II
Resampling
8× 16×nearest neighbornearest neighbor nearest neighbornearest neighbor
bicubic interpolationbicubic interpolation bicubic interpolationbicubic interpolation
(resizing)
April 10, 2023 39 1999-2007 by Richard Alan Peters II
Rotation
and motion blur
April 10, 2023 40 1999-2007 by Richard Alan Peters II
Image Warping
April 10, 2023 41 1999-2007 by Richard Alan Peters II
Gaussian LPF in FDGaussian LPF in FDOriginal ImageOriginal Image Power SpectrumPower Spectrum
Image size: 512x512SD filter sigma = 8
Image size: 512x512SD filter sigma = 8Frequency Domain (FD) Filtering
April 10, 2023 42 1999-2007 by Richard Alan Peters II
Original ImageOriginal ImageFiltered ImageFiltered Image Filtered Power SpectrumFiltered Power Spectrum
Image size: 512x512SD filter sigma = 8
Image size: 512x512SD filter sigma = 8FD Filtering: Lowpass
April 10, 2023 43 1999-2007 by Richard Alan Peters II
Original ImageOriginal ImageFiltered ImageFiltered Image Filtered Power SpectrumFiltered Power Spectrum
Image size: 512x512FD notch sigma = 8
Image size: 512x512FD notch sigma = 8FD Filtering: Highpass
April 10, 2023 44 1999-2007 by Richard Alan Peters II
Original ImageOriginal ImageFiltered ImageFiltered Image Filtered Power SpectrumFiltered Power Spectrum
Image size: 512x512FD notch sigma = 8
Image size: 512x512FD notch sigma = 8FD Filtering: Highpass
signed image with0 at middle gray
signed image with0 at middle gray
April 10, 2023 45 1999-2007 by Richard Alan Peters II
originalblurred sharpened
Spatial Filtering
April 10, 2023 46 1999-2007 by Richard Alan Peters II
Spatial Filtering
bandpassfilter
unsharpmasking
original
April 10, 2023 47 1999-2007 by Richard Alan Peters II
Spatial Filtering
bandpassfilter
unsharpmasking
original
signed image with0 at middle gray
signed image with0 at middle gray
April 10, 2023 48 1999-2007 by Richard Alan Peters II
Motion Blurverticalregional
zoom rotational
original
April 10, 2023 49 1999-2007 by Richard Alan Peters II
color noiseblurred image color-only blur
Noise Reduction
April 10, 2023 50 1999-2007 by Richard Alan Peters II
5x5 Wiener filtercolor noiseblurred image
Noise Reduction
April 10, 2023 51 1999-2007 by Richard Alan Peters II
Noise Reduction
originalperiodic
noisefrequency tuned filter
April 10, 2023 52 1999-2007 by Richard Alan Peters II
Shot Noise or Salt & Pepper Noise
+ shot noise - shot noises&p noise
April 10, 2023 53 1999-2007 by Richard Alan Peters II
Nonlinear Filters: the Median
s&p noiseoriginal median filter
April 10, 2023 54 1999-2007 by Richard Alan Peters II
Nonlinear Filters: Min and Maxmin
+ shot noise min filter maxmin filter
April 10, 2023 55 1999-2007 by Richard Alan Peters II
Nonlinear Filters: Max and Minmax
- shot noise max filter minmax
April 10, 2023 56 1999-2007 by Richard Alan Peters II
Nonlinear Processing: Binary Morphology
“L” shaped SE
O marks origin
Foreground: white pixels
Background: black pixels
Cross-hatched pixels are indeterminate.
April 10, 2023 57 1999-2007 by Richard Alan Peters II
Used after opening to grow back pieces of the original image that are connected to the opening.
Permits the removal of small regions that are disjoint from larger objects without distorting the small features of the large objects.
original opened reconstructed
Nonlinear Processing: Binary Reconstruction
April 10, 2023 58 1999-2007 by Richard Alan Peters II
“L” shaped SE
O marks origin
Foreground: white pixels
Background: black pixels
Cross-hatched pixels are indeterminate.
Nonlinear Processing: Grayscale Morphology
April 10, 2023 59 1999-2007 by Richard Alan Peters II
Grayscale Morphology: Opening
opening: erosion then dilation opened & original
April 10, 2023 60 1999-2007 by Richard Alan Peters II
Grayscale Morphology: Opening
erosion & opening erosion & opening & original
April 10, 2023 61 1999-2007 by Richard Alan Peters II
reconstructed openingoriginal
Nonlinear Processing: Grayscale Reconstruction
April 10, 2023 62 1999-2007 by Richard Alan Peters II
Forensic Analysis of Photographs
Photographs by Robert Fenton of a battlefield in the Crimean war taken on 23 April 1855. From Morris, Errol, “Which Came First, the Chicken or the Egg?”, Parts 1-3, New York Times, Zoom Editorial Section, 25 Sept. 2007 (pt.1), 7 Oct. 2007 (pt.2), 30 Oct. 2007 (pt.3).
Which came first?
April 10, 2023 63 1999-2007 by Richard Alan Peters II
Photographs by Robert Fenton of a battlefield in the Crimean war taken on 23 April 1855. From Morris, Errol, “Which Came First, the Chicken or the Egg?”, Parts 1-3, New York Times, Zoom Editorial Section, 25 Sept. 2007 (pt.1), 7 Oct. 2007 (pt.2), 30 Oct. 2007 (pt.3).
Which came first?Which came first?
Forensic Analysis of Photographs
April 10, 2023 64 1999-2007 by Richard Alan Peters II
Photographs by Robert Fenton of a battlefield in the Crimean war taken on 23 April 1855. From Morris, Errol, “Which Came First, the Chicken or the Egg?”, Parts 1-3, New York Times, Zoom Editorial Section, 25 Sept. 2007 (pt.1), 7 Oct. 2007 (pt.2), 30 Oct. 2007 (pt.3).
Forensic Analysis of Photographs
Which came first?Which came first?
April 10, 2023 65 1999-2007 by Richard Alan Peters II
Image Compression
Yoyogi Park, Tokyo, October 1999. Photo by Alan Peters.
Original image is 5244w x 4716h @ 1200 ppi: 127MBytes
Original image is 5244w x 4716h @ 1200 ppi: 127MBytes
April 10, 2023 66 1999-2007 by Richard Alan Peters II
Image Compression: JPEGJP
EG
qua
lity
leve
lF
ile size in bytes
April 10, 2023 67 1999-2007 by Richard Alan Peters II
JPE
G q
ualit
y le
vel
File size in
bytes
Image Compression: JPEG
April 10, 2023 68 1999-2007 by Richard Alan Peters II
Image Compositing Combine parts from separate images to form a new image. It’s difficult to do well. Requires relative positions, orientations, and scales to be
correct. Lighting of objects must be consistent within the separate
images. Brightness, contrast, color balance, and saturation must
match. Noise color, amplitude, and patterns must be seamless.
April 10, 2023 69 1999-2007 by Richard Alan Peters II
Prof. Peters in his home office. Needs a better shirt.
Image Compositing Example
April 10, 2023 70 1999-2007 by Richard Alan Peters II
This shirt demands a monogram.
Image Compositing Example
April 10, 2023 71 1999-2007 by Richard Alan Peters II
He needs some more color.
Image Compositing Example
April 10, 2023 72 1999-2007 by Richard Alan Peters II
Nice. Now for the way he’d wear his hair if he had any.
Image Compositing Example
April 10, 2023 73 1999-2007 by Richard Alan Peters II
He can’t stay in the office like this.
Image Compositing Example
April 10, 2023 74 1999-2007 by Richard Alan Peters II
Where’s a hepcat Daddy-O like this belong?
Image Compositing Example
April 10, 2023 75 1999-2007 by Richard Alan Peters II
In the studio!
Collar this jive, Jackson. Like crazy,
Man !
Collar this jive, Jackson. Like crazy,
Man !
Image Compositing Example