1 of 84

ELEN0450 · Multimedia Systems

Lecture 5

Camera model & digital sensors

Mathematics behind the camera and digital sensors

www.viulab.be

2 of 84

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

3 of 84

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

4 of 84

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

5 of 84

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

6 of 84

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

7 of 84

The pinhole camera

7

A pinhole camera is a camera with an infinitely small aperture.

  • Rays through a pinhole form an inverted image

Definition

8 of 84

The pinhole camera model

8

 

Mathematical definition

 

 

 

 

 

 

C = camera center

(pinhole aperture)

 

principal axis (optical axis)

 

9 of 84

Exercise: perspective projection

9

Example

 

10 of 84

Exercise: perspective projection of two objects

10

Example

 

 

The building looks twice bigger while the person’s size hasn’t changed!

11 of 84

How to take better monument portraits

11

Example

Source: LexieLimitless

12 of 84

Or gorgeous savanna sunset pictures

12

13 of 84

Field of view and focal length

13

 

Property

14 of 84

Exercise: the field of view of a lens

14

Example

 

15 of 84

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.

16 of 84

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

17 of 84

Building a mathematical model for cameras

 

Problem statement

18 of 84

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

19 of 84

Projection in homogeneous coordinates

 

 

 

We can rewrite the triangle inequality as a matrix product

Mathematical definition

20 of 84

Decomposition of the camera matrix

 

Intrinsic parameters

Linked to the camera itself

Extrinsic parameters

Controls the position of the camera in space

Mathematical definition

21 of 84

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

22 of 84

Extrinsics: where the camera is

 

 

6 extrinsic parameters

  • A translation vector (3 values)
  • 3 rotation angles

Mathematical definition

23 of 84

The full projection matrix

Results

 

 

 

 

 

 

 

24 of 84

Use-cases of this projection matrix

24

Examples

Calibration

Rendering

Homography

Input: Broadcast video

Output: Minimap

25 of 84

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.

26 of 84

Limitations of the pinhole camera model

26

Limitations

Valid only if: single projection center, projective ray-to-pixel map, one pose per frame.

Limitations:

  • Lens distortion is not expressible.
  • Wide FoV, >100° to 120° does not translate well.
  • Defocus pinhole assumes infinite depth of field
  • Long focal length ill-conditioned
  • Rolling shutter no single time per frame, needs per-row pose

27 of 84

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

28 of 84

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

29 of 84

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

30 of 84

Example of pinhole versus wide aperture image

30

Very small aperture

Wide aperture

Example

31 of 84

Reflection and refraction

31

Reflection

Refraction

Concave mirrors are used in telescopes

Convex lenses are smaller and used in cameras

Reminder

32 of 84

Lens types

32

Property

33 of 84

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

34 of 84

Focusing and framing

Idea

 

35 of 84

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!

36 of 84

Aperture and f-number

Definition

 

37 of 84

Exercise: what one stop actually is

Example

 

38 of 84

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

39 of 84

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.

40 of 84

Shooting the Milkyway

40

41 of 84

Depth of field

Property

 

42 of 84

Camera aperture examples

42

43 of 84

Depth of field computation

43

 

Idea

Decreasing the aperture size (4) reduces the size of the blur spots for points

44 of 84

Depth of field computation

44

 

Mathematical definition

45 of 84

Depth of field with respect to the focal length

45

Property

46 of 84

Depth of field with respect to N

46

Property

47 of 84

The tilt-shift effect

47

48 of 84

Typical lens defects

48

Spherical aberrations

Properties

Effect: blur (sharp core + halo)

Chromatic aberrations

Effect: colored blur or fringes

Distortions

Effect: displacement, no blur

 

49 of 84

Chromatic aberration

49

Examples

50 of 84

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)

51 of 84

Lens distortion and focal face distortion examples

51

Examples

52 of 84

Lenses in professional photography

52

Idea

 

53 of 84

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

54 of 84

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

55 of 84

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

56 of 84

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

57 of 84

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).

58 of 84

ADC converter

58

ADC is an Analog-to-Digital Converter.

  • After the exposure of a picture ends, the electrons captured in each photosite are converted to a voltage.
  • ISO amplifies the analog signal before the ADC converter.
  • The ADC takes this analog signal as input and classifies it into a brightness level represented by a binary signal.

Property

59 of 84

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?

60 of 84

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

61 of 84

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

62 of 84

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

63 of 84

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

64 of 84

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.

65 of 84

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.

66 of 84

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.

67 of 84

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.

68 of 84

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.

69 of 84

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

70 of 84

Electronic shutter

70

Idea

The charges can be electronically reset, hence is there no need for a mechanical shutter anymore?

  • For initialization, indeed there is no need: all pixels can be reset at the same time.
  • For read-out: it is slow and hence unread pixels continue to accumulate. Hence need for a mechanical shutter to stop charge accumulation.

Image source: The Slow-Mo Guys

71 of 84

71

Image source: Camera Shutters are Extremely Fast - The Slow Mo Guys

72 of 84

72

Image source: Camera Shutters are Extremely Fast - The Slow Mo Guys

73 of 84

73

Image source: Camera Shutters are Extremely Fast - The Slow Mo Guys

74 of 84

74

Image source: Camera Shutters are Extremely Fast - The Slow Mo Guys

75 of 84

Mechanical leaf shutter

75

Idea

Separate the shutter from the sensor plane such that it acts as a pinhole throughout.

  • The shutter is located inside the lens (expensive).
  • Keeps the entire image all the time until the shutter is completely closed.

76 of 84

76

Image source: Camera Shutters are Extremely Fast - The Slow Mo Guys

77 of 84

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

78 of 84

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

79 of 84

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

80 of 84

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

81 of 84

Summary

 

Summary

82 of 84

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

83 of 84

Next time & further reading

• Session 5: Camera model & digital video

Source: Fundamentals of Multimedia

• Questions?

84 of 84

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