ELEN0450 · Multimedia Systems
Lecture 5
Camera model & digital sensors
Mathematics behind the camera and digital sensors
www.viulab.be
Recap: where we are in the pipeline
Reminder
Last lecture: How analog systems capture and reproduce images and videos.
Camera history, film photography, development, motion pictures, and projectors.
This lecture : Camera model and digital photography and video.
Representation
Digitization
Acquisition Capture
Compression Storage
Distribution Transmission
Display
Render
Scope of the course
3
Analog path
Digital path
Physical scene
Light, sound, motion
Capture
Lens, sensor, microphone
Analog signal
Continuous in time and amplitude
Analog storage and transport
Film, vinyl, tape, broadcast
Rendering
Display, loudspeaker, print
Synthesis
Graphics, audio, generative
Digital signal representation
ADC, samples,
pixels, bit depth
Source coding
compression
JPEG, AAC, MP4
Storage
Container, disc, network
Transmission and decoding
Network, Inverse transform, DAC
Human perception
Visual and auditory systems
Sampling and quantization
Perceptual models drive the coding stage: chroma subsampling, quantization tables, masking thresholds
Scope
What you'll be able to do after today's class
4
Objective
Derive the pinhole projection and name camera intrinsics and extrinsics
Explain lenses, aperture, depth of field and exposure
Compare digital image sensors
Table of content
5
ELEN0450 · Multimedia Systems | |
1 | Basics of multimedia |
2 | Graphics & image representation |
3 | Colorimetry & color spaces |
4 | Analog image & video |
5 | Camera model & digital sensors |
6 | Analog and digital displays |
7 | Acoustics, microphones & speakers |
8 | Audio digitization & compression |
9 | Digital image compression |
10 | Digital video compression |
11 | Transmission protocols |
12 | Internet distribution |
Pinhole camera
– Perspective projection
– Field of view and focal length
Camera matrix
– Homogenous coordinates
– Intrinsics and extrinsics
Lenses and exposure
– Thin lens and f-number
– Exposure and depth of field
– Lens defects
Digital image sensor
– Photodiodes and ADC
– CCD versus CMOS
– Color filters
Camera automation
– Autofocus
– Auto exposure
– Auto white balance
What can be found in photographs
6
Slide credit: Thomas Hoyoux
Perspective effects
Defocus blur
Underexposure
Motion blur
Radial distortion
Chromatic aberration
Sensor noise
Compression artifacts
The pinhole camera
7
A pinhole camera is a camera with an infinitely small aperture.
Definition
The pinhole camera model
8
Mathematical definition
C = camera center
(pinhole aperture)
principal axis (optical axis)
Exercise: perspective projection
9
Example
Simulator: https://dofsimulator.net/en/
Exercise: perspective projection of two objects
10
Example
The building looks twice bigger while the person’s size hasn’t changed!
How to take better monument portraits
11
Example
Source: LexieLimitless
Or gorgeous savanna sunset pictures
12
Field of view and focal length
13
Property
Exercise: the field of view of a lens
14
Example
Playing with the distance and the focal length
15
Idea
The Dolly zoom effect is achieved by zooming a zoom lens to adjust the angle of view (often referred to as field of view, or FOV) while the camera dollies (moves) toward or away from the subject in such a way as to keep the subject the same size in the frame throughout.
Table of content
16
ELEN0450 · Multimedia Systems | |
1 | Basics of multimedia |
2 | Graphics & image representation |
3 | Colorimetry & color spaces |
4 | Analog image & video |
5 | Camera model & digital sensors |
6 | Analog and digital displays |
7 | Acoustics, microphones & speakers |
8 | Audio digitization & compression |
9 | Digital image compression |
10 | Digital video compression |
11 | Transmission protocols |
12 | Internet distribution |
Pinhole camera
– Perspective projection
– Field of view and focal length
Camera matrix
– Homogenous coordinates
– Intrinsics and extrinsics
Lenses and exposure
– Thin lens and f-number
– Exposure and depth of field
– Lens defects
Digital image sensor
– Photodiodes and ADC
– CCD versus CMOS
– Color filters
Camera automation
– Autofocus
– Auto exposure
– Auto white balance
Building a mathematical model for cameras
Problem statement
The projection ambiguity
18
Note
Even if the focal length is known, it is not possible to derive the position of an object in the scene from its projected values. There is always going to be an ambiguity based on the distance.
A miniature model © Michaël Fonder
An unstructured environment © Michaël Fonder
Projection in homogeneous coordinates
We can rewrite the triangle inequality as a matrix product
Mathematical definition
Decomposition of the camera matrix
Intrinsic parameters
Linked to the camera itself
Extrinsic parameters
Controls the position of the camera in space
Mathematical definition
Intrinsics: the generalized K matrix
K maps camera-frame coordinates to pixel coordinates.
It holds the focal length in pixels, the principal point, and a skew term.
Fixed for a given lens and sensor, so it is found once by calibration.
5 intrinsic parameters
Mathematical definition
Extrinsics: where the camera is
6 extrinsic parameters
Mathematical definition
The full projection matrix
Results
Use-cases of this projection matrix
24
Examples
Calibration
Rendering
Homography
Input: Broadcast video
Output: Minimap
Images produced by a pinhole camera
25
Note
In theory (or 3D rendered images), a pinhole camera produces an image in which everything is sharp, no matter the object distance to the camera.
In other words, the whole scene is always in focus, no matter the depth.
Limitations of the pinhole camera model
26
Limitations
Valid only if: single projection center, projective ray-to-pixel map, one pose per frame.
Limitations:
What can be found in photographs
27
Slide credit: Thomas Hoyoux
Perspective effects
Defocus blur
Underexposure
Motion blur
Radial distortion
Chromatic aberration
Sensor noise
Compression artifacts
Table of content
28
ELEN0450 · Multimedia Systems | |
1 | Basics of multimedia |
2 | Graphics & image representation |
3 | Colorimetry & color spaces |
4 | Analog image & video |
5 | Camera model & digital sensors |
6 | Analog and digital displays |
7 | Acoustics, microphones & speakers |
8 | Audio digitization & compression |
9 | Digital image compression |
10 | Digital video compression |
11 | Transmission protocols |
12 | Internet distribution |
Pinhole camera
– Perspective projection
– Field of view and focal length
Camera matrix
– Homogenous coordinates
– Intrinsics and extrinsics
Lenses and exposure
– Thin lens and f-number
– Exposure and depth of field
– Lens defects
Digital image sensor
– Photodiodes and ADC
– CCD versus CMOS
– Color filters
Camera automation
– Autofocus
– Auto exposure
– Auto white balance
Why a real camera needs a lens
29
Problem: A pinhole small enough to be sharp admits almost no light, so exposures are hours long.
Simply opening the aperture more produces blurry images.
A lens gathers a wide beam and focuses it
Very small aperture
Object
Sensor
aperture
Wide aperture + lens
With a simple lens, much more light can be brought into sharp focus.
object
sensor
aperture
lens
With a small pinhole light is reduced, but diffraction prevents the image spot from getting arbitrarily small.
Wide aperture
object
sensor
aperture
With a large pinhole, the image spot is large, resulting in a blurry image.
Property
Example of pinhole versus wide aperture image
30
Very small aperture
Wide aperture
Example
Reflection and refraction
31
Reflection
Refraction
Concave mirrors are used in telescopes
Convex lenses are smaller and used in cameras
Reminder
Lens types
32
Property
Thin lens equation
33
Note: Rays through the centre are undeviated, so the chief ray is exactly the pinhole ray.
The lens adds light, depth of field, and distortion.
It does not replace the pinhole projection model.
Mathematical definition
Focusing and framing
Idea
How the eye focuses an image
35
Principle
The eye cannot change it size, so how does it focus images at different depths?
�Muscles stretch the lens to change its focal point and focus the light on the retina.
Try it by holding a pen close to your eye and focus either on the pen or the background!
Aperture and f-number
Definition
Exercise: what one stop actually is
Example
Exposure: the three controls together
Idea
Exposure depends on aperture (how wide), shutter speed (how long) and ISO (how amplified).
Each also has a side effect: depth of field, motion blur, and noise.
The exposure triangle
ISO
(grain / gain)
Aperture
(f-number)
Shutter speed
(time)
Exposition is about finding the right balance between those quantities
Capturing High Dynamic Range (HDR)
Example
Problem: A single exposure cannot hold both a bright sky and a dark interior.
Solution: take several exposures and merge them into one image (HDR).
Phones now do this on every shot, which is computational photography.
Shooting the Milkyway
40
Depth of field
Property
Camera aperture examples
42
Depth of field computation
43
Idea
Decreasing the aperture size (4) reduces the size of the blur spots for points
Depth of field computation
44
Mathematical definition
Depth of field with respect to the focal length
45
Property
Depth of field with respect to N
46
Property
The tilt-shift effect
47
Typical lens defects
48
Spherical aberrations
Properties
Effect: blur (sharp core + halo)
Chromatic aberrations
Effect: colored blur or fringes
Distortions
Effect: displacement, no blur
Chromatic aberration
49
Examples
Lens distortion
Note
Real lenses bend straight lines: barrel on wide angles, pincushion on telephotos.
Corrected in software using coefficients found during calibration.
Pincushion
Barrel
Non (rectilinear)
Lens distortion and focal face distortion examples
51
Examples
Lenses in professional photography
52
Idea
Table of content
53
ELEN0450 · Multimedia Systems | |
1 | Basics of multimedia |
2 | Graphics & image representation |
3 | Colorimetry & color spaces |
4 | Analog image & video |
5 | Camera model & digital sensors |
6 | Analog and digital displays |
7 | Acoustics, microphones & speakers |
8 | Audio digitization & compression |
9 | Digital image compression |
10 | Digital video compression |
11 | Transmission protocols |
12 | Internet distribution |
Pinhole camera
– Perspective projection
– Field of view and focal length
Camera matrix
– Homogenous coordinates
– Intrinsics and extrinsics
Lenses and exposure
– Thin lens and f-number
– Exposure and depth of field
– Lens defects
Digital image sensor
– Photodiodes and ADC
– CCD versus CMOS
– Color filters
Camera automation
– Autofocus
– Auto exposure
– Auto white balance
From silver grains to silicon pixels
Idea
Film: light alters silver-halide crystals, and chemistry makes the change visible and permanent.
Digital sensor: light frees electrons in silicon, and electronics count them.
Both integrate light over the exposure time; only the readout technique differs.
Charge-coupled device (CCD)
1969 by Willard Boyle et George Smith
First digital camera
1975 by Steven Sasson
0.01MPx in black and white
Modern camera
A pixel counts photons
Definition
Each cell is a photodiode: photons free electrons, which collect in a charge well.
At the end of the exposure the charge is read out and digitized into one pixel value.
56
t
V
Exposure time
Value read-out
V
1
Photon
arrives during exposure
2
Absorption
Inside a photodiode
3
Well
charge accumulates
4
Readout
charge becomes voltage
5
ADC
voltage becomes a number
Photodiode
56
Definition
A photodiode: is a semiconductor diode sensitive to photon radiation (e.g., visible light, infrared or ultraviolet radiation, X-rays and gamma rays).
It produces an electrical current when it absorbs photons that can be converted to voltage.
All details on how a photodiode works in ELEN0075-3
What a photodiode can and cannot see
57
Idea
Blue stops at the surface
Absorbed within 0.1 µm. Much less efficiency.
It sees past 780 nm
An infrared-cut filter is mandatory in a color camera.
Blind past 1100 nm
Silicon becomes transparent. SWIR needs other materials (e.g., InGaAs).
ADC converter
58
ADC is an Analog-to-Digital Converter.
Property
ISO, gain and noise
Idea
Not enough light? Amplify the signal by raising the ISO (gain).
Amplification cannot tell signal from noise, so the noise grows too.
Question : Why is it sometimes better to increase the ISO than increase brightness in post?
Two main sensor types: CCD and CMOS
Same physics: both rely on the photoelectric effect to turn light into electrical charge. More light means more electrons collected in a pixel.
Different readout: a CCD moves every pixel's charge to one or a few output nodes for conversion to voltage, while in a CMOS sensor each pixel does its own charge-to-voltage conversion.
Principle
Charge-coupled device (CCD)
61
Each pixel is a small silicon capacitor that collects electrons, and the array is read out row by row using varying voltages. Charge is passed along like buckets in a bucket brigade to an output amplifier, with digitization off-chip.
Principle
Complementary metal-oxide-semiconductor (CMOS)
62
Each pixel has its own amplifier, and on-chip circuits handle noise reduction, analog-to-digital conversion and image processing.
Rows are selected one at a time and columns carry the signals to the ADCs.
Principle
CCD versus CMOS
63
Readout: a CCD shifts all charge to a single output, while a CMOS sensor converts charge to voltage in every pixel.
Speed and shutter: CMOS is faster thanks to parallel readout but mostly uses a rolling shutter, while CCDs usually have a global shutter.
Use today: CMOS is cheaper, lower-power and dominant; CCD is limited to niches such as low-light and near-infrared imaging.
Property
How to get color cameras?
64
Idea
Problem: Photodiodes only count photons, but don’t distinguish colors.
Solution: 3CCD professional cameras contain three sensor planes with filters (red, green, and blue) and a prism to split the incoming light.
Color: the Bayer filter
Idea
A photodiode grid measures intensity only, so a mosaic of color filters, called Bayer filter is laid over it.
The Bayer pattern uses two greens per red and blue; demosaicing interpolates the rest.
Demosaicing
66
Idea
Demosaicing: Missing colors are interpolated before the image is saved into the JPEG or PNG format, which looses the original information.
The RAW format keeps the original values and hence all the original information. Much better for photo editing.
Other colour-filter arrays
Note
Bayer is standard, but not the only option.
Fujifilm X-Trans uses a larger, more random pattern to reduce aliasing.
RGBW or RYYB add clear or yellow cells to gather more light in the dark.
Black & white versus colored photography
68
Idea
A dedicated black-and-white (monochrome) sensor is sharper and more sensitive to light than a color Bayer-filter sensor.
Why? In a bayer filter, each individual pixel is blocked from seeing two-thirds of the light spectrum by its colored dye.
Sensor and pixel size
69
A bigger sensor with bigger pixels collects more light per pixel.
That means less noise, more dynamic range and more control of depth of field.
It is why a full-frame camera beats a phone in low light at the same megapixel count (+ the lens quality).
Property
Electronic shutter
70
Idea
The charges can be electronically reset, hence is there no need for a mechanical shutter anymore?
Image source: The Slow-Mo Guys
71
Image source: Camera Shutters are Extremely Fast - The Slow Mo Guys
72
Image source: Camera Shutters are Extremely Fast - The Slow Mo Guys
73
Image source: Camera Shutters are Extremely Fast - The Slow Mo Guys
74
Image source: Camera Shutters are Extremely Fast - The Slow Mo Guys
Mechanical leaf shutter
75
Idea
Separate the shutter from the sensor plane such that it acts as a pinhole throughout.
76
Image source: Camera Shutters are Extremely Fast - The Slow Mo Guys
Table of content
77
ELEN0450 · Multimedia Systems | |
1 | Basics of multimedia |
2 | Graphics & image representation |
3 | Colorimetry & color spaces |
4 | Analog image & video |
5 | Camera model & digital sensors |
6 | Analog and digital displays |
7 | Acoustics, microphones & speakers |
8 | Audio digitization & compression |
9 | Digital image compression |
10 | Digital video compression |
11 | Transmission protocols |
12 | Internet distribution |
Pinhole camera
– Perspective projection
– Field of view and focal length
Camera matrix
– Homogenous coordinates
– Intrinsics and extrinsics
Lenses and exposure
– Thin lens and f-number
– Exposure and depth of field
– Lens defects
Digital image sensor
– Photodiodes and ADC
– CCD versus CMOS
– Color filters
Camera automation
– Autofocus
– Auto exposure
– Auto white balance
Autofocus
1
Contrast detection
Moves the lens and keeps the sharpest position. Accurate, but it must search past the peak.
2
Phase detection
Pixels seeing opposite halves of the lens form two images; their shift gives direction and distance, so the lens moves once.
3
Modern cameras
On-sensor phase detection (dual-pixel or masked pixels), refined by contrast and guided by subject detection and tracking.
78
Process
Auto exposure (metering)
1
Metering
Brightness is measured through the lens and weighted by zone: average, center-weighted, spot, face priority or multi-zone evaluative.
2
Control loop
Shutter time, aperture and gain are adjusted frame after frame until the weighted brightness reaches mid-grey (18%).
3
Limits
A meter assumes an average scene, so backlit subjects, snow or dark scenes need another mode or exposure compensation.
79
Process
Auto white balance
1
Problem
The sensor records surface color times light color: tungsten light turns the image orange, open shade turns it blue.
2
Estimation
The camera estimates the light color, e.g. gray world (the scene averages to gray) or white patch, then applies per-channel gains.
3
Limits
Scenes dominated by one color or mixed lighting fool simple rules; many modern cameras use learned estimators.
80
Process
Summary
Summary
Image: where each stage lands
Stage | Analog | Digital |
Transduction | Lens, film emulsion (silver halide) | Lens, colour filter array, CMOS or CCD sensor |
Representation | Continuous 2D density on film | Pixel grid, RGB or Y'CbCr, 8 to 16 bit |
Digitisation | Grain and lens MTF set the resolution limit | Sensor grid sampling, optical low pass filter |
Coding | | JPEG (DCT), JPEG 2000 (wavelet), PNG, WebP, AVIF |
Storage media | Negative, slide, print | Flash, HDD, SSD, cloud object storage |
Transmission | Wirephoto, fax over the telephone line | IP transfer, web, messaging |
Distribution | Physical prints, press circulation | CDN, social platforms, thumbnails on demand |
Rendering | Enlarger print, projector | LCD or OLED display, inkjet, ICC colour management |
Perception | Human visual system | |
Overview
82
Next time & further reading
• Session 5: Camera model & digital video
Source: Fundamentals of Multimedia
• Questions?
Table of content
84
ELEN0450 · Multimedia Systems | |
1 | Basics of multimedia |
2 | Graphics & image representation |
3 | Colorimetry & color spaces |
4 | Analog image & video |
5 | Camera model & digital sensors |
6 | Analog and digital displays |
7 | Acoustics, microphones & speakers |
8 | Audio digitization & compression |
9 | Digital image compression |
10 | Digital video compression |
11 | Transmission protocols |
12 | Internet distribution |
Pinhole camera
– Perspective projection
– Field of view and focal length
Camera matrix
– Homogenous coordinates
– Intrinsics and extrinsics
Lenses and exposure
– Thin lens and f-number
– Exposure and depth of field
– Lens defects
Digital image sensor
– Photodiodes and ADC
– CCD versus CMOS
– Color filters
Camera automation
– Autofocus
– Auto exposure
– Auto white balance