Lecture 11 Camera Isp
Lecture 11 Camera Isp
Processing
Pipeline
Kari Pulli
VP Computational Imaging
Light
Imaging without optics?
Large pinhole
geometric blur
Optimal pinhole
too little light
Small pinhole
diffraction blur
Add a lens to get more light
Real lenses are complex
Thin lens approximation: Gauss’s ray diagram
http://graphics.stanford.edu/courses/cs178/applets/thinlens.html
1 1 1
Changing the focus distance + =
so si f
To focus on objects at
different distances
move sensor relative to
the lens
1 1 1
Changing the focus distance + =
so si f
To focus on objects at
different distances
move sensor relative to
the lens
At so = si = 2f we get 1:1
imaging (macro) because
1 1 1
+ =
2f 2f f
1 1 1
Changing the focus distance + =
so si f
To focus on objects at
different distances
move sensor relative to
the lens
At so = si = 2f we get 1:1
imaging (macro) because
1 1 1
+ =
2f 2f f
A c
d D
Sensor
Dnear Dfar
position
http://graphics.stanford.edu/courses/cs178/applets/dof.html
Chromatic aberration
Irradiance is proportional to
projected area of aperture
as seen from pixel
projected area of pixel
as seen from aperture
distance2 from aperture to pixel
Combining all these
each ~ a factor of cos θ
light drops as cos4 θ
Fix by calibrating
take a photo of a uniformly white object
the picture shows the attenuation, divide the pixel values by it
CMOS sensor
Front- vs. Back-illuminated sensor
Anti-aliasing filter
Pixel Non-Uniformity
each pixel has a slightly different sensitivity to light
typically within 1% to 2%
reduce by calibrating an image with a flat-field image
also eliminate the effects of vignetting and other optical variations
Stuck pixels
some pixels are turned always on or off
identify, replace with filtered values
Dark floor
temperature adds noise
sensors usually have a ring of covered pixels
around the exposed sensor, subtract their signal
AD Conversion
Pixel Non-Uniformity
each pixel in a CCD has a slightly different sensitivity to light,
typically within 1% to 2% of the average signal
can be reduced by calibrating an image with a flat-field image
flat-field images are also used to eliminate the effects of
vignetting and other optical variations
Stuck pixels
some pixels are turned always on or off
identify, replace with filtered values
Dark floor
temperature adds noise
sensors usually have a ring of covered pixels
around the exposed sensor, subtract their signal
Color filter array
Bayer pattern
Demosaicking
Your eyes do it too…
Demosaicking
First choice: bilinear interpolation
Easy to implement
http://graphics.stanford.edu/courses/cs178/applets/threedgamut.html
The CIE Chromaticity Diagram
Intensity is measured as
the distance from origin
black = (0, 0, 0)
Chromaticity coordinates
give a notion of color
independent of brightness
Channels
Y = luminance [linear]; Y’ = luma [gamma corrected]
CbCr / UV = chrominance [always linear]
44
Gamma encoding
http://graphics.stanford.edu/courses/cs178/applets/gamma.html
45
Luminance from RGB
49
Film response curve
Toe region
the chemical process
is just starting
Middle
follows a power function
if a given amount of light
turned half of the grain
crystals to silver,
the same amount more
turns half of the rest
Shoulder region
close to saturation
Toe and shoulder preserve more dynamic range at dark and bright areas
at the cost of reduced contrast
Film has more dynamic range than print
~12bits
50
Digital camera response curve
http://graphics.stanford.edu/courses/cs178/applets/autofocusCD.html
Hunt for the peak
6 7
8
4 5
3 9
1
2
Lens
position
Scan direction
Auto-White-Balance
(source: www.cambridgeincolour.com)
Identify the color of the illuminant
Grey card
take a picture of a neutral object (white or gray)
deduce the weight of each channel
1 1 1
= (1− α ) + α
T T1 T2
Y 1 Intensity
Exposure metering examples
Adjustment examples
P = 0.995, Y = 0.9
max 0.5% of pixels are saturated (highlights)
P = 0.1, Y = 0.1
max 10% of pixels are under-exposed (shadows)
Auto-exposure somewhere in between, e.g., P = 0.9, Y = 0.4
JPEG 2000
ISO, 2000
better compression, inherently hierarchical, random access, …
but much more complex than JPEG
JPEG XR
Microsoft, 2006; ISO / ITU-T, 2010
good compression, supports tiling (random access without
having to decode whole image), better color accuracy (incl.
HDR), transparency, compressed domain editing
http://source.android.com/devices/
camera/index.html
HAL v3