L2 ImageFormationRepresentation
L2 ImageFormationRepresentation
L2 ImageFormationRepresentation
Computer Vision
A Simple model of image formation
• The scene is illuminated by a single source.
• The scene reflects radiation towards the camera.
• The camera senses it via solid state cells (CCD cameras)
Image formation (cont’d)
• There are two parts to the image formation process:
center of
projection perspective projection:
(x,y) fX fY
(X,Y,Z) x y
Z Z
f: focal length
What is the effect of aperture size?
Large aperture: light from the
source spreads across the
image (i.e., not properly
focused), making it blurry!
SOLUTION: refraction
Refraction
• Bending of wave when it enters a medium where its
speed is different.
Lens
• Lens duplicate pinhole geometry without resorting to
undesirably small apertures.
– Gather all the light radiating from an object point towards
the lens’s finite aperture .
– Bring light into focus at a single distinct image point.
refraction
Lens (cont’d)
• Lens improve
image quality,
leading to
sharper images.
Properties of “thin” lens (i.e., ideal lens)
focal point
focal point
focal point
v u
f
object
image
Thin lens equation (cont’d)
Using similar triangles:
v u
f
y
y’
y’/y = v/u
image
Thin lens equation (cont’d)
Using similar triangles:
v u
f
y
y’
y’/y = (v-f)/f
image
Thin lens equation (cont’d)
Combining the equations:
v u
f
1 1 1
+ =
u v f
image
Thin lens equation (cont’d)
1 1 1
+ =
u v f
“circle of
confusion”
• The thin lens equation implies that only points at distance u from
the lens are “in focus” (i.e., focal point lies on image plane).
• Other points project to a “blur circle” or “circle of confusion”
in the image (i.e., blurring occurs).
Thin lens equation (cont’d)
focal point 1 1 1
+ =
u v f
f
http://www.cambridgeincolour.com/tutorials/depth-of-field.htm
How can we control depth of field?
• The size of blur circle is proportional to aperture size.
How can we control depth of field? (cont’d)
f f
Field of View (Zoom)
Reduce Perspective Distortions
by varying Distance / Focal Length
Less perspective
distortion!
• All but the simplest cameras contain lenses which are actually
comprised of several "lens elements."
• Each element aims to direct the path of light rays such that they
recreate the image as accurately as possible on the digital sensor.
Lens Flaws: Chromatic Aberration
• Lens has different refractive indices for different wavelengths.
• Could cause color fringing:
– i.e., lens cannot focus all the colors at the same point.
Chromatic Aberration - Example
Lens Flaws: Radial Distortion
• Ratio of L to M to S cones: 50
– approx. 10:5:1
• Almost no S cones in
400 450 500 550 600 650
the center of the fovea
WAVELENGTH (nm.)
Human Eye (cont’d)
• Rods (120 million) more sensitive to light than cones but
cannot discern color.
– Primary receptors for night vision and detecting motion.
– Large amount of light overwhelms them,
and they take a long time to “reset”
and adapt to the dark again.
– Once fully adapted to darkness,
the rods are 10,000 times more
sensitive to light than the cones
Digital cameras
• A digital camera replaces film
with a sensor array.
http://electronics.howstuffworks.com/digital-camera.htm
Digital cameras (cont’d)
CCD Cameras
• CCDs move photogenerated charge from pixel to pixel and convert it to
voltage at an output node.
• An analog-to-digital converter (ADC) then turns each pixel's value
into a digital value.
http://www.dalsa.com/shared/content/pdfs/CCD_vs_CMOS_Litwiller_2005.pdf
CMOS Cameras
• CMOs convert charge to voltage inside each element.
• Uses several transistors at each pixel to amplify and move the charge
using more traditional wires.
• The CMOS signal is digital, so it needs no ADC.
http://www.dalsa.com/shared/content/pdfs/CCD_vs_CMOS_Litwiller_2005.pdf
Image digitization
Sampling Quantization
What is an image?
8 bits/pixel
255
What is an image? (cont’d)
• We can think of a (grayscale) image as a function, f, from
R2 to R (or a 2D signal):
– f (x,y) gives the intensity at position (x,y)
f (x, y)
Images have
been resized
sampled by a factor of 4 sampled by a factor of 8 for easier
comparison
Image Quantization - Example
• 256 gray levels (8bits/pixel) 32 gray levels (5 bits/pixel) 16 gray levels (4 bits/pixel)
=
Color images
r ( x, y )
f ( x, y ) g ( x, y )
b( x, y )
Color sensing in camera: Prism
• Requires three chips and precise alignment.
CCD(R)
CCD(G)
CCD(B)
Color sensing in camera: Color filter array
• In traditional systems, color filters are applied to a single
layer of photodetectors in a tiled mosaic pattern.
Bayer grid
Why more green?
demosaicing
(interpolation)
Color sensing in camera: Foveon X3
• CMOS sensor; takes advantage of the fact that red, blue
and green light silicon to different depths.
http://www.foveon.com/article.php?a=67
Alternative Color Spaces
• Various other color representations can be computed
from RGB.
• This can be done for:
– Decorrelating the color channels:
• principal components.
– Bringing color information to the fore:
• Hue, saturation and brightness.
– Perceptual uniformity:
• CIELuv, CIELab, …
Alterative Color paces
• RGB (CIE), RnGnBn (TV - National Television Standard Committee)
• XYZ (CIE)
• UVW (UCS de la CIE), U*V*W* (UCS modified by the CIE)
• YUV, YIQ, YCbCr
• YDbDr
• DSH, HSV, HLS, IHS
• Munsel color space (cylindrical representation)
• CIELuv
• CIELab
• SMPTE-C RGB
• YES (Xerox)
• Kodak Photo CD, YCC, YPbPr, ...
Processing Strategy
Red Red
Processing
Green Green
T T-1
Blue Blue
Color Transformation - Examples
Skin color
RGB rg
r
g
Skin detection
ASCI
Binary