What we see What a computer sees
3
Computer Vision Week 2: Image Formation
Computer Vision is Making sense of these numbers
4
Computer Vision Week 2: Image Formation255255255255
239238247252
255232248255
255240255255
3D to 2D Conversion implies information loss
graphics
vision
Computer Graphics vs. Computer Vision
5
Computer Vision Week 2: Image Formation
Geometric Primitives and Transformations
•Basic building blocks used to describe the projection of 3D features into 2D features.
•Points
•Lines
•Planes
•Projections
6
Computer Vision Week 2: Image Formation
Points
•2D points (pixel coordinates in an image) can be denoted using
a pair of values, x = (x, y) ∈ R
2
, or alternatively, a column
vector x ∈ R
2x1
:
•3D points (coordinates in three dimensions) can be written
using x = (x, y, z) ∈ R
3
7
Computer Vision Week 2: Image Formation
Lines
•The general equation of a straight 2D line is given below, where
m is the gradient, and Y is the value where the line cuts the y-
axis.
L = mx + Y
•3D Lines can be represented by using two points on the line,
(P, X). Any other point on the line can be expressed as a linear
combination of these two points.
L : (x –x
1)/l = (y –y
1)/m = (z –z
1)/n
8
Computer Vision Week 2: Image Formation
3D Lines - Proof
Consider a line which passes through the point P(x
1, y
1, z
1), and has
direction vectord⃗=(l, m, n) ,wherel , m,andnare non-zero real
numbers. LetX=(x, y, z) be a random point on the line. Then the
vectorPX ⃗,which is the red arrow in the figure, will be parallel
tod⃗.Hence, we have:
9
Computer Vision Week 2: Image Formation
3D Lines - Example
Example 1: If a straight line is passing through the two fixed points in the 3-dimensional plane whose
position coordinates are P (2, 3, 5) and Q (4, 6, 12) then find its cartesian equation using the two-point
form.
Solution:
l=(4–2),m=(6–3),n=(12–5)
l = 2, m = 3, n = 7
Choosing the point P (2, 3, 5)
The required equation of the line
L : (x – 2) / 2 = (y – 3) / 3 = (z – 5) / 7
10
Computer Vision Week 2: Image Formation
3D Lines - Example
Example 1: If a straight line is passing through the two fixed points in the 3-dimensional whose
position coordinates are X (2, 3, 4) and Y (5, 3, 10) then find its cartesian equation using the two-
point form.
Solution:
l = (5 – 2), m = (3 – 3), n = (10 – 4)
l = 3, m = 0, n = 6
Choosing the point X (2, 3, 4)
The required equation of the line
L : (x – 2) / 3 = (y – 3) / 0 = (z – 4) / 6
L : (x - 2) / 3 = (z – 4) / 6 and y = 3
11
Computer Vision Week 2: Image Formation
Image Formation in the Human Eye
12
Computer Vision Week 2: Image Formation
•When the eye is properly focused, light from an object
outside the eye is imaged on the retina
•Retina consists of two types of light receptors: rodsand
cones
•Rods
Cover all of retina
75-150 Million
Several rods connected to one optical nerve (low-resolution)
Sensitive to small light intensities (dim-light vision)
Equal response to all colours
Image Formation in the Human Eye
13
Computer Vision Week 2: Image Formation
•When the eye is properly focused, light from an object outside
the eye is imaged on the retina
•Retina consists of two types of light receptors: rodsand
cones
•Cones
Concentrated at fovea
6-7 Million
One cone connected to one optical nerve (high-resolution)
Sensitive to bright light
(bright-light vision)
Sensitive to colours
Image Formation in Human Eye
14
Computer Vision Week 2: Image Formation
The Electromagnatic Spectrum
15
Computer Vision Week 2: Image Formation
Trichromatic Vision
16
Computer Vision Week 2: Image Formation
•Cone cellsare of three types, each containing a
photosensitive pigmentthat responds to a
particular wavelength of light
•S-cones are sensitive to “short” wavelengths,
corresponding to the blue colour
•M-cones are sensitive to “medium” wavelengths,
corresponding to the green colour
•L-cones are sensitive to “long” wavelengths,
corresponding to the red colour
Capturing Images
•Pinhole Cameras
•Lenses
•Digital Cameras
The first photograph on record, “la table
servie”, obtained by Nicephore Niepce in
1822
17
Computer Vision Week 2: Image Formation
Pinhole Camera
18
Computer Vision Week 2: Image Formation
Introducing Lens
•Smaller the pinhole sharper the
images but also darker
•Larger the pinhole brighter the
image but also more blurry
•Most cameras use a converging lens
to allow light to enter the device.
•Zoom lenses found in cameras
utilize a combination of convex and
concave lenses to produce different
types of images.
21
Computer Vision Week 2: Image Formation
Optical Geometry
•Snell’s law, if r1 is the ray incident to the interface
between two transparent materials with indices of
refraction n1 and n2, and r2 is the refracted ray,
then r1, r2, and the normal to the interface are
coplanar, and the angles α1 and α2 between the
normal and the two rays are related by:
n
1 sin α
1 = n
2 sin α
2
22
Computer Vision Week 2: Image Formation
Reflection
23
Computer Vision Week 2: Image Formation
•Incident light is reflected in two main
forms
1.Diffuse reflection: light scattered
isotropicallyin all directions (shows
true colour of the object)
2.Specular reflection: Incident light
reflected in a specific direction
(mirror-like effect)
•Most materials exhibit a mixture of
diffuse and specular reflections
Thin Lens Phenomena
The thin lens equation defines the
relationship between the focal length of a
lens, the distance of an object from that
lens, and the distance of the image formed
by the lens.
24
Computer Vision Week 2: Image Formation
Focal Length of a Lens
25
Computer Vision Week 2: Image Formation
Focal Length
Focal length, usually represented in millimeters
(mm).
Itis a calculation of an optical distance from the point where
light rays converge to form a sharp image of an object to the
digital sensor at the focal plane in the camera.
The focal length of a lens is determined when the lens
is focused at infinity.
Lens focal length tells us theangle of view—how much of the
scene will be captured—and themagnification—how large
individual elements will be.
The longer the focal length, the narrower the angle of
view and the higher the magnification.
The shorter the focal length, the wider the angle of
view and the lower the magnification.
26
Computer Vision Week 2: Image Formation
Digital Cameras
•Image sensing
pipeline,
•Various sources of
noise
•Typical digital post-
processing steps
27
Computer Vision Week 2: Image Formation
Capturing Digital Images
•Light falling on an imaging sensor is
usually picked up by an active sensing
area
•Charge-Coupled Device (CCD)
•Complementary Metal Oxide on Silicon
(CMOS)
•CCDs are prone to “Blooming”
•CCD sensors outperformed CMOS in
quality-sensitive applications
28
Computer Vision Week 2: Image Formation
Representing Image as a Matrix
34
Computer Vision Week 2: Image Formation
Image formation is an analog
to digital conversion of an
image with the help of 2D
Sampling and Quantization
techniques that is done by the
capturing devices like
cameras.
Computer Vision Week 2: Image Formation
35
Sampling
•Sampling is a spatial
resolution of the digital
image.
•The rate of sampling
determines the quality of
the digitized image.
36
Computer Vision Week 2: Image Formation
Spatial Resolution
•The spatial resolution of an image is
determined by how sampling was carried
out.
•There are 3 measures which we see often
relating to Image Size/Resolution
a.Pixel count - e.g., 3000x2000 pixels
b.Physical size - e.g., 8" x 10"
c.Resolution - e.g., 240 pixels per inch (PPI)
37
Computer Vision Week 2: Image Formation
Quantization
•The transition of the continuous values
from the image function to its digital
equivalent is called quantization.
•Quantization is the number of grey levels
in the digital image.
•It is related to the intensity values of the
image.
•8-bit quantization: 28 =256 gray levels
(0: black, 255: white)
•1-bit quantization: 2 gray levels
(0: black, 1: white) – binary
38
Computer Vision Week 2: Image Formation
Intensity Resolution
•Intensity level resolution refers to
the number of intensity levels used
to represent the image
•The more intensity levels used, the
finer the level of detail in an image
•Intensity level resolution is usually
given in terms of the number of bits
used to store each intensity level
39
Computer Vision Week 2: Image Formation
Resolution: How Much is Enough?
40
Computer Vision Week 2: Image Formation
Digital Image is an approximation of a real world scene
41
Computer Vision Week 2: Image Formation
Image as a Function
•Consider image as a function f or I, from
R
2
to R
M
:
f(x, y) gives intensity or value at position (x, y)
•Digital image is defined over some bound:
f : [a, b]x [c, d]y → [min, max] gives
intensity or value at position (x, y) where: x
ranges from a to b, and y ranges from c to d and
intensity from min to max.
42
Computer Vision Week 2: Image Formation
Image Representations
Image is a collection of light intensities at different locations.
43
Computer Vision Week 2: Image Formation
Image Representations
Pixel – Building Block of Digital Image
44
Computer Vision Week 2: Image Formation
Binary vs. Grey-Scale vs. RGB Images
51
Computer Vision Week 2: Image Formation
Factors Affecting Performance of Digital Cameras
•Shutter Speed – Under exposed vs Over-Exposed
52
Computer Vision Week 2: Image Formation
Factors Affecting Performance of Digital Cameras
•Sampling Pitch - Physical spacing between adjacent sensor cells
53
Computer Vision Week 2: Image Formation
Factors Affecting Performance of Digital Cameras
•Fill Factor - active sensing area size as a fraction of the theoretically available sensing area
54
Computer Vision Week 2: Image Formation
Factors Affecting Performance of Digital Cameras
•Chip Size- having a larger chip size is preferable, since each sensor cell can be more photo-
sensitive
•Analog Gain - a higher gain allows the camera to perform better under low light conditions
(less motion blur due to long exposure times when the aperture is already maxed out).
•Sensor Noise - noise is added from various sources, which may include fixed pattern noise,
dark current noise, shot noise, amplifier noise, and quantization noise
•ADC Resolution - how many bits it yields and its noise level (how many of these bits are useful
in practice)
55
Computer Vision Week 2: Image Formation