Professional Documents
Culture Documents
1 / 184
Cameras
2 / 184
Cameras
Any point on the screen receives light from lot of point on the candle
but we do not see a clear image.
We can argue that an image is being formed but it is a blurry image
and not a clear one.
How can we create a clear image of the candle on screen?
3 / 184
Cameras
4 / 184
Pinhole Camera: Perspective Projection
5 / 184
Pinhole Camera: Perspective Projection
6 / 184
Pinhole Camera: Perspective Projection
The images B’ and C’ of the posts B and C have the same height,
but A and C are really half the size of B.
Figure: Perspective Effects: far objects appears smaller than the closed ones
7 / 184
Pinhole Camera: Perspective Projection
A single ray travels from point P on the object to the image plane
′
and projects on to the point P .
′
We want to know the relation between point P and P .
Figure: The perspective projection equations are derived from the colinearity of
the point P, its image P’ and the pinhole O.
8 / 184
Pinhole Camera: Perspective Projection
A single ray travels from point P on the object to the image plane
′
and projects on to the point P .
′
We want to know the relation between point P and P .
Figure: The perspective projection equations are derived from the colinearity of
the point P, its image P’ and the pinhole O.
9 / 184
Pinhole Camera: Perspective Projection
The vectors i and j form a basis for a vector plane parallel to the
′ ′
image plane Π , located at distance f from the pinhole along the
vector k.
′
The line perpendicular to Π and passing through the pinhole is called
the optical axis.
′ ′
The point C where it pierces Π is called the image center.
10 / 184
Pinhole Camera: Perspective Projection
′
Let P denote a scene point with coordinates (x, y , z) and P denote
′ ′ ′
its image with coordinates (x , y , z ).
′ ′ ′
Since P lies in the image plane, we have z = f
′
−−→′ −→
Since the three points P, O and P are colinear, we have OP = λOP
for some number λ.
Hence, ′
x = λx
x y
′
f
′ ′
′
y = λy ⇔λ= = = ,
′
x y z
f = λz
Therefore, ( ′ ′
x = f xz ,
′ ′
y = f yz .
11 / 184
Perspective Projection of a Line
12 / 184
Perspective Projection of a Line
All the light rays that pass through the pinhole lie on this plane.
All the light rays that pass through the pinhole towards the image
plane also lie on this plane.
This is why in the photographs, we see that the straight lines in the
scene maps to straight lines in the photographs.
13 / 184
Image Magnification
14 / 184
Image Magnification
15 / 184
Image Magnification
16 / 184
Image Magnification
Using A and C, we can write
xi + dxi xi x0 + dx0 x0
− = −
f f z0 z0
which implies
dxi dx0
= (D)
f z0
Similarly, using B and C, we get
dyi dy0
= (E)
f z0
Using D and E in magnification expression, we get
q
|di | dxi2 + dyi2 f
|m|= =q =| |
|d0 | dx 2 + dy 2 z 0
0 0
17 / 184
Image Magnification
18 / 184
Image Magnification
19 / 184
Image Magnification
Some remarks:
m can be assumed to be constant if the range of scene depth ∆z is
much smaller than the average scene depth z̄.
The ratio is area of the object in the image to the area of object in
the scene is given by
areai
= m2
area0
20 / 184
Vanishing Point
22 / 184
Finding a Vanishing Point
We need to construct a line parallel to these lines passing through the
pinhole.
The point where this line pierces the image is the vanishing point
corresponding to this set of lines in 3D.
We first define the direction of the set of parallel lines. This is given
by the vector I (lx , ly , lz ).
Then, we create a point P in that direction from the pinhole.
24 / 184
Finding a Vanishing Point
Now we perspectively project the point onto the image using
perspective projection equations.
25 / 184
Perspective Projection is Non-linear
The perspective projection is a non-linear transformation.
The condition for linearity is
Figure: Images of some text obtained with shrinking pinholes: large pinholes give
bright but fuzzy images but pinholes that are too small also give blurry images
because of diffraction effects.
28 / 184
Pinhole size
29 / 184
Ideal Pinhole size
where,
f : effective focal length
λ : Wavelength
In case of visible light images, the wavelength lies between 400 nm to
700 nm. You use this wavelength and use the effective focal length to
get the ideal pinhole diameter.
30 / 184
Image Formation using Lenses
All the light rays received by the lens from point P0 are refracted or
bent by the lens to converge at a point Pi .
31 / 184
Image Formation using Lenses
In case of pinhole camera, only green ray would have made it through
to the point Pi .
32 / 184
Gaussian Lens (Thin Lens) Law
f : focul length
i : image distance
f : object distance
1 1 1
+ =
i o f
33 / 184
How to Find a Focal Length?
34 / 184
Finding Focal Length
Showing the lens an object that is far away (such as the sun a very
distant point source) and looking at where the image of that point
source is formed on the sheet of paper, the distance between the
focused image and the lens is the focal length.
35 / 184
Finding Focal Length
Height of the object is h0 and we want to know the height of an
image hi .
Magnification is defined as: Magnification= hh0i
The highlighted triangles in the image are similar triangles. Using
this, we have
hi i
m= =
h0 o
36 / 184
Two Lens System
We have two lenses L1 and L2 located at d distance.
38 / 184
Aperture of the Lens
The aperture of lens is the area of lens that gathers light from the
points in the scene.
It has a diameter D.
39 / 184
Aperture of the Lens
The aperture is implemented using a diaphragm.
A diaphragm is a camera component within a lens comprised of
overlapping metal blades that open and close to change the size of
the opening (they allow different levels of light to pass through to the
sensor - thus controlling the aperture.
40 / 184
f-number of lens
41 / 184
Lens Defocus
What is the price that we pay when we use lens?
There is only one plane in the scene that is perfectly focused onto the
image plane by a lens.
Distance o is focused at the distance i behind the lens.
43 / 184
Lens Defocus
The light received by the lens from this point will not be focused at a
single point on the image plane but will be distributed over a circular
disc.
So the image of this point will be blurred. This is called a Blur Circle.
Let the diameter of blur circle be b. We want to know the blue circle
diameter for any given position of object in a scene.
44 / 184
Lens Defocus
45 / 184
Lens Defocus
If we use a lens which deviates from pinhole camera more and more
(larger and larger aperture), we will get larger degree of blur for the
points that lie outside the plane of focus.
46 / 184
Blue Circle (Defocus)
Using the Gaussian lens law for focused point, we have
1 1 1 of
+ = ⇒i =
i o f o−f
Similarly, for defocused point
1 1 1 ′ o ′f
+ = ⇒ i =
i ′ o′ f o′ − f
Using these two equations, we have
f f
i′ − i = · o − o′
·
(o ′ −f) o −f
Substituting in the expression for blur circle, we have
(o − o ′ ) f 2 (o − o ′ )
b = Df ′ =
o (o − f ) N o ′ (o − f )
47 / 184
Focusing
Figure: Move the lens Figure: Move both lens and image plane
48 / 184
Depth of Filed (DoF)
Summery:
For any given image plane location, that is only one plane in the
scene that is perfectly focused.
All objects that lie outside this plane of focus are going to be out of
focus.
The degree of defocus is going to increase with the distance of the
object from the plane of focus.
Images have finite resolution which are made up of pixels of finite size.
Depth of Field:
The best focused region in the scene (range of depths in the scene
that are best focused) are those points in the scene for which the blur
circle lies within a single pixel.
As long as the blur circle diameter is smaller than the size of a pixel,
all point are going to be equally focused.
49 / 184
Depth of Field (DoF)
Range of object distances over which the image is sufficiently well”
focused, i.e., range over which blur circle diameter b is less than pixel
size.
51 / 184
Depth of Field (DoF)
52 / 184
Depth of Field (DoF)
Consider point o2 further away from o whose image is formed in front
of the image plane and diverges from there to form a blur circle of
size c.
Depth of filed is given by o2 − o1 .
Let us compute the blur circle. We will make use of the expression for
blur circle.
53 / 184
Depth of Field (DoF)
Let o1 and o2 be the nearest and the furthest distances respectively
for which the blur circle is maximum c.
Then, using the expression for blur circle, we can write
f 2 (o − o1 )
c= (A)
No1 (o − f )
f 2 (o2 − o)
c= (B)
No1 (o − f )
Using A and B, we can get the Depth of Field as
2of 2 cN (o − f )
Depth of Field:o2 − o1 =
f 4 − c 2 N 2 (o − f )2
Note that the distance o2 − o is greater than o − o1 .
Remark: As we go closer and closer to the lens, the defocus is going
to increase more rapidly.
54 / 184
Hyperfocal Distance
The hyperfocal distance is the closest distance that you would focus
a lens at for which all point beyond that distance are going to be in
focus.
All points beyond this distance (all the way to infinity) are going to
produce a blur circle that is smaller than the pixel size.
Consider a point at infinity (o2 = ∞) and the parallel rays that come
to the lens that converge at point i2 and diverge to form a blur circle
that is exactly equal to the pixel size.
55 / 184
Hyperfocal Distance
f2
h= +f
Nc
If we create an imaging system which is focused on the hyperfocal
distance, then all the points beyond that points will be in focus.
Only points that are closer to the lens will be out of focus.
In case of a smart phone camera, we want to set a focus at a
hyperfocal distance.
56 / 184
Aperture Size: DoF vs. Brightless
Trade-off between depth of field and the brightness of an image.
57 / 184
Aperture Size: DoF vs. Brightless
Figure: Focal length = 50 nm, Focus= 1m, Aperture D= 12.5 mm, f-number N
=4
58 / 184
Aperture Size: DoF vs. Brightless
Figure: Focal length = 50 nm, Focus= 1m, Aperture D= 6.25 mm, f-number N
=8
59 / 184
Aperture Size: DoF vs. Brightless
Figure: Focal length = 50 nm, Focus= 1m, Aperture D= 3.125 mm, f-number N
=16
60 / 184
Aperture Size: DoF vs. Brightless
Summery:
Large Aperture (Small f-Number):
⇒ Bright Image or Short Exposure Time
⇒ Shallow Depth of Field
Small Aperture (Large f-Number):
⇒ Dark Image or Long Exposure Time
⇒ Large Depth of Field
61 / 184
Tissue Box Camera
Figure: Camera
62 / 184
Tissue Box Camera
Figure: Camera
63 / 184
Blocking the Lens
Figure: Camera
64 / 184
Blocking the Lens
Figure: Image
65 / 184
Tilting the Lens
67 / 184
Tilting the Lens
The plane of focus will not be parallel to the image plane in this
scenario.
What is the use of such system?
68 / 184
Tilting the Lens
You have to have a camera looking out at something, but we are
interested in maintaining in focus not the plane which is parallel to
the image plane.
For example, we want to take a picture of something in front of you
on the street, and want to see the entire ground plane, the road, all
the people on the road in focus but not interested to what happens to
the sky and the things that are further up.
In this case you can tilt the lens and make entire ground plane in
focus. This construction that we just discussed is called Scheimpflug
Condition.
69 / 184
Lens related Issues: Compound Lenses
We have lenses L1, L2 and L3. They all have different sizes or
openings.
When we place a point on the optical axes, lot of the light make it
way to the image sensor.
However, if we move the point A along the same plane of focus away
from the optical axes, we see that there is greater chance that rays of
light from this point are going to be blocked by the lenses as they
travel through.
71 / 184
Vignetting
For this reason images often tend to be darker towards the periphery
and this effect is called vignetting.
If you know what the vignetting of the lens is, we can correct the
images that are captured for these effects.
one nice thing is given the lens, we can measure these effects,
72 / 184
Chromatic Aberration
Lens is made of a certain material say glass or plastic which has a
certain refractive index and that is what gives lenses the bending
power.
The refractive index is the function of wavelength of light (visible
light goes from 400nm to 700nm). Blue is 400nm and red is 700 nm
and green is somewhere in between.
Since the refractive index depends on wavelength, that means the
focal length also depends on wavelength. That is, the bending power
of lens depends on wavelength.
73 / 184
Chromatic Aberration
So the blue image is focused at the different distance from the red
image with respect to the image plane.
This causes some shifts in color in the image.
Below is an image of a printed shit of paper which is black and white
but even so you can see that at edges the colors are shifted.
This is called Chromatic Aberration.
74 / 184
Geometric Distortion
Radial Distortion
As you move away from the center of the image, points tend to get
pushed out more and more. It is also called barrel distortion.
If you know exactly what the barrel distortion is, you can correct for it.
75 / 184
Geometric Distortion
Tangential Distortion
In the case of tangential distortion you have a slight twisting of the
image.
As you go further and further away from the center of the image, the
twisting increases.
These are due to imperfections in the lenses.
76 / 184
Geometric Distortion Correction
Image is taken with inexpensive wide angle camera.
The straight lines in the scene no longer map to the straight lines
because its not perspective projection. There is a barrel distortion.
If you know what the barrel distortion is, you can apply a software
mapping to get pure perspective image.
All straight lines are maps to straight lines in the corrected image.
The field of view is not rectangular because the field of view of
original image itself due to barrel distortion was not rectangular.
78 / 184
Image Sensing
79 / 184
Brief History of Imaging
16th Century
80 / 184
Brief History of Imaging
17th Century
Figure: A camera obscura box with mirror, with an upright projected image at the
top.
81 / 184
Brief History of Imaging
19th Century
82 / 184
Brief History of Imaging
19th Century
83 / 184
Brief History of Imaging
Color Film: 19th Century
84 / 184
Brief History of Imaging
85 / 184
Brief History of Imaging
Figure
86 / 184
Brief History of Imaging
Figure
87 / 184
Brief History of Imaging
Figure: iPhone 1
88 / 184
Converting Light into Electric Charge
Figure
89 / 184
Image Sensor
Figure: 18 Megapixels
The problem is: What is that value x tells us about the corresponding
point in the scene?
91 / 184
From 2D to 3D
92 / 184
From 2D to 3D
93 / 184
Image Intensity
Let us consider a point on the object. The light from the source falls
on to this point and reflected or scattered in different directions.
What is this image intensity value say about the corresponding point
in the scene?
94 / 184
Image Intensity
Let us take a point on a surface.
A point light source illuminates the point and it reflects the light in
the direction of the camera that produce an image intensity
corresponding to that point.
96 / 184
Concept: Angle in (2D)
We have a circle of radios r . We want to know the radius of the angle
covered by the arc of length dl.
dl
dθ = Unit: radian (rad)
r
98 / 184
Concept: Light Flux
99 / 184
Concept: Radiant Intensity
The Radiant Intensity is the flux emitted by the source per unit
solid angle.
dϕ
J= Unit: W sr −1
dω
100 / 184
Concept: Surface Irradiance
We can now talk about the illumination of a surface which is at some
distance r from the light source having radiant intensity J.
What is illumination of a surface?
The illumination of a surface is called Surface Irradiance which is
denoted by E .
It is given by the flux falling on the surface per unit area.
dϕ
E= Unit: W m−1
dA
101 / 184
Concept: Surface Irradiance
102 / 184
Concept: Surface Radiance
Light flux emitted per unit foreshortened area per unit solid flux.
d 2Φ
L= unit: W m−2 sr −1
(dAcosθr ) dω
Observations:
⇒ L depends on direction θr : L (θr ).
⇒ Surface can radiate into the whole hemisphere.
⇒ L depends on reflectance property of the surface.
103 / 184
Scene Radiance and Image Irradiance
104 / 184
Scene Radiance and Image Irradiance
105 / 184
Scene Radiance and Image Irradiance
We are looking at the intensity captured by the pixel having area dAi .
This pixel is observing through perspective projection an area dAs in
the scene.
Lets assume that the patch has an orientation n̄ which makes an
angle θ with the line of sight shown in yellow line.
The line of sight makes an angle α with the optical axis.
Depth of this patch with respect to the lens is z.
106 / 184
Scene Radiance and Image Irradiance
107 / 184
Scene Radiance and Image Irradiance
We can see that: dωi = dωs .
We can compute dωi and dωs as
dAi cos α dAs cos θ
dωi = 2
and dωs =
(f /cos α) (z/cos α)2
Using dωi = ωs , we get
dAs cos α z 2
= (1)
dAi cos θ f
108 / 184
Scene Radiance and Image Irradiance
The solid angle subtended by the lens from the surface point.
Let say the lens has a diameter d.
2
The foreshortened area of the lends is given by πd4 cos α.
Using this, the solid angle is given as
πd 2 cos α
dωL = (2)
4 (z/cos α)2
109 / 184
Scene Radiance and Image Irradiance
Energy Conservation:
Flux received by lens from dAs = Flux projected onto dAi
How do we know what is the flux received by the lens?
Let say the radiance of the patch in the scene is L. We know the
equation for L
d 2ϕ
L=
(dAs cos θ) dωL
Using this, the flux received by the lens from dAs is
d 2 ϕ = L (dAs cos θ) dωL (3)
This flux received by the lens is gets bent by the lens and it falls on
the pixel with area dAi .
Therefore, the Image Irradiance is given by
dϕ
E= ⇒ dϕ = E · dAi (flux projected on dAi ) (4)
dAi
110 / 184
Scene Radiance and Image Irradiance
111 / 184
Scene Radiance and Image Irradiance
Observations:
1 Image Irradiance is proportional to scene radiance.
2 Image brightness falls off from the image center as cos4 α.
3 As we move away from the center of the image, that is the optical axis,
the angle α increases so cos4 α decreases.
4 For small fields of view, effects of cos4 α is small.
112 / 184
Scene Radiance and Image Irradiance
If you move the camera away from the scene, does the brightness of
the scene point change?
Intuitively we might think that as we move away from the scene and
therefore collect less light and the brightness should reduce.
113 / 184
Scene Radiance and Image Irradiance
114 / 184
Scene Radiance and Image Irradiance
The area subtended by the scene onto the pixel are shown with yellow
line. If we pull the camera back, that area increases.
That means the same pixel is going to be accumulating light from a
larger area, which seems to imply that the brightness of the pixel is
going to increase.
But we know that is not the case.
115 / 184
Scene Radiance and Image Irradiance
Larger the scene depth, larger the area of light accumulation.
On the other hand, we also have the solid angle subtended by the lens
from each point in the scene. That also governs how much light is
being collected.
That is large when the lens is closer to the scene and falls as it moves
away.
These two effects cancel each other as a result of which image
irradiance is independent of scene depth.
116 / 184
Bidirectional Reflectance Distribution Function (BRDF)
117 / 184
Surface Appearance
118 / 184
Surface Reflectance
Two directions are important to us. One is the direction from which
the light arrives and the second is the direction in which the light is
reflected and observed.
To describe the reflectance property of any material, we want to be
able to describe its properties both in terms of the illumination
direction and the viewing direction.
119 / 184
Bidirectional Reflectance Distribution Function
The direction of the light source, the direction from which the light
arrives is (θi , ϕi ).
120 / 184
Bidirectional Reflectance Distribution Function
E (θi , ϕi ): Irradiance due to source in direction (θi , ϕi ).
L (θr , ϕr ): Radiance of surface in the direction (θr , ϕr ).
Now, we can define the BRDF as
L (θr , ϕr ) 1
BRDF : f (θi , ϕi , θr , ϕr ) = Unit :
E (θi , ϕi ) sr
121 / 184
Bidirectional Reflectance Distribution Function
f (θi , ϕi , θr , ϕr ) = f (θr , ϕr , θi , ϕi )
122 / 184
BRDF of Isotropic Surfaces
123 / 184
Isotropic BRDF and Anisotropic BRDF
124 / 184
Reflection Mechanism
Surface Reflection:
Specular Reflection
Glossy Appearance
Smooth Surfaces (e.g., mirror, glass, etc)
125 / 184
Reflection Mechanism
Body Reflection:
Diffuse Reflection
Matte Appearance
Non-homogeneous Medium (e.g., clay, paper, etc)
Image Intensity=Body Reflection+Surface Reflection
126 / 184
Examples
127 / 184
Lambertian Model (Body)
Surface appears equally bright from all directions.
Doesn’t matter which direction you observe it from, it has the same
surface radiance.
It’s BRDF is a constant
ρd
f (θi , θr , ϕi , ϕr ) =
π
where ρd is called the Albedo which is in the range 0 ≤ ρd ≤ 1.
Albedo is 0 for perfectly black surface and 1 for perfectly white
surface.
Perfectly white surface reflects all the light that it receives.
128 / 184
Lambertian Model (Body)
This is a very commonly used model is computer vision and computer
graphics because of its simplicity and also because it also descries at
least approximately a variety of surfaces found in the real world.
Radiance is proportional to irradiance:
▷d
L= E
π
We know that
J cos(θi ) J
E= = 2 (n̄ · s̄)
r2 r
where n̄ is the unit vector in the direction of surface orientation and s̄
is the unit vector in the direction of source.
129 / 184
Lambertian Model (Body)
Hence, we get surface radiance as
ρd J
L= (n̄ · s̄)
π r2
We know that J and ▷d are constants, let us assume that r is also
constant. We want to understand that what happens to Lambertian
surface when we move source at a fixed distance.
Figure
130 / 184
Ideal Specular Model (Surface)
Perfect Mirrors: All incident energy is reflected in a single direction.
All the reflection takes place at the interface itself. So it is surface
reflection not body reflection.
Mirror BRDF:
δ (θi − θr ) δ (ϕi + π − ϕr )
f (θi , θr , ϕi , ϕr ) =
cos θi cos θr
The viewer receives light only when v̄ = r¯.
Figure
131 / 184
Ideal Specular Model (Surface)
Mirror BRDF:
δ (θi − θr ) δ (ϕi + π − ϕr )
f (θi , θr , ϕi , ϕr ) =
cos θi cos θr
The first delta function essentially says that the two zenith angles
must be the same.
The second delta function says that the azimuthal angles must be the
opposite of each other.
The term in the denominator is a factor of proportionality. It is just
making sure that the low of conservation of energy is being satisfied.
That is, the light that is reflected is equal to the light that is reflected.
132 / 184
Examples
In this case the camera observes a reflection non-zero value only for
one point on the sphere, and that point is q.
The point q has a surface normal which is a bisector of v̄ and s̄ and
that is the point for which the angle of incident and the angle of
reflection are going to be same.
These are very simple but very popular models because we know in
real life we have shiny object and also objects which are matte
Lambertian like objects in real world.
134 / 184
Surface roughness
Imagine that the surface is made up of a lot of tiny little facets. The
surface has a mean orientation n̄.
Each facet has its own orientation α.
We can now define the roughness of the surface using a distribution.
Gaussian Micro-Facet Model:
1 α2
p (α, σ) = √ e − 2σ2
σ 2π
where σ is the roughness parameter.
136 / 184
Modeling Surface roughness
Greater the value of σ more is the roughness.
If σ = 0 then all the facets looking up in the direction of the mean
orientation and we get a perfectly flat surface.
This kind of roughness models are used with both the Lambertian
model and the specular model.
That is, the assumptions are made that the facets are made up of
either perfectly mirror like or perfectly Lambertian. Then we look at
what is the aggregate reflection of entire patch we are looking at.
137 / 184
Specular Reflection from Rough Surface
where p (α, σ) is the surface roughness distribution and G (s̄, n̄, v̄ ) is the
geometric factor (masking, shadowing).
Each one of the facets have its own orientation. When we calculate
the BRDF, we calculate it for the entire ensemble of facets.
138 / 184
Specular Reflection from Rough Surface
The function G takes into account various geometric effects that
happen when you have a surface that is not flat.
Let us consider that we have a V groove in the structure.
If the lighting a coming from the direction of yellow arrows, one facet
could cast a shadow on the other facet.
If we are observing from the direction of red arrows, one facet could
mask the visibility of the other facet.
The function G takes into account all these effects.
If we substitute σ = 0, we get the BRDF of a perfect mirror, a
specular surface.
139 / 184
Specular Reflection from Rough Surface
140 / 184
Specular Reflection from Rough Surface
141 / 184
Body Reflection from Rough Surface
Oren-Nayar BRDF Model: (Each Facet is Limbertian)
ρd
f (θi , θr , ϕi , ϕr ) = (A + B · max (0, cos (ϕr − ϕi )) sin α tan β)
π
σ2
A=1− α = max (θi , θr )
2 (σ 2 + 0.33)
0.45σ 2
B= β = min (θi , θr )
σ 2 + 0.09
where σ is the surface roughness.
Figure
142 / 184
Body Reflection from Rough Surface
Figure
143 / 184
Body Reflection from Rough Surface
Figure
144 / 184
Body Reflection from Rough Surface
Figure
145 / 184
Dichromatic Model
What will be the effect of each one of these mechanisms on the color
of incident light.
That is, when we have the surface radiance or the reflection light by a
surface, what is the relationship between the color of the light that is
reflected by the surface and the color of the light that is incident on
the surface?
146 / 184
Color Reflectance Model
Figure
147 / 184
Color Reflectance: Dichromatic Model
Pixel color is a linear combination of the color of body reflection and
the color of surface reflection.
Look at it in the color space.
Any pixel that we measure on this object (assuming object is uniform
in terms of its material properties) is a linear combination of these
two vectors.
148 / 184
Photometric Stereo
149 / 184
Photometric Stereo
We are going to take the following assumption
Image Intensity (known)I = F(Source (known),
Surface Normal n̄ (unknown),
Surface Reflectance) (known)
We are going to assume that the source is at a large distance so that
every point on the surface end up seeing the same source direction.
Photometric stereo is a method for recovering 3D shape information
from image intensities measured using multiple sources.
150 / 184
Surface Gradient and Normal
151 / 184
Surface Gradient and Normal
The surface normal is now defined as
∂z ∂z
N = − , − , 1 = (p, q, 1)
∂x ∂y
Unit surface normal:
N (p, q, 1)
n= =p
||N|| p2 + q2 + 1
The surface normal is represented with only two parameters (p, q).
152 / 184
Gradient Space
Let us visualize the relationship between the normal vector and the
corresponding (p, q) value.
Let us consider a coordinate system x-y-z and a surface normal unit
vector n̄.
We form a plane at z=1 which is parallel to the x-y plane.
Axes p and q are parallel to axes x and y.
The plane z=1 is called the gradient space or pq plane.
153 / 184
Gradient Space
If we extend the unit vector to intersect the pq plane, where ever it
intersects the plane is the normal vector N(p, q, 1).
That is the relationship between any unit vector and the
corresponding (p, q) value.
Every point (p, q) on the pq space corresponds to a unique
orientation.
Source Direction:
S (ps , qs , 1)
s= =p
||S|| ps2 + qs2 + 1
154 / 184
Reflectance Map R (p, q)
We assume that we are given reflectance property of the surface, i.e.,
BRDF.
We are also given all the information about the source that
illuminating the surface.
We assume that there is a single source of a certain brightness at a
certain distance and in the direction s.
Reflectance map: For a given source direction s and surface
reflectance, image intensity at a point (x, y ).
I = R(p, q)
155 / 184
Reflectance Map R (p, q)
156 / 184
Lambertian Surface
157 / 184
Reflectance Map: Lambertian Surface
The reflectance map of Lambertian surface that is illuminated by a
source in certain direction with a certain brightness is given by
ρ J ρ
Image Intensity :I = c 2
cos θi = c k (n · s)
πr π
where k is the source brightness, ρ is the surface Albedo
(Reflectance) and c is a constant (Camera Gain).
In this case, we know c, ρ, J and r . We can assume c πρ k = 1, then
I = cos θi = n · s.
158 / 184
Reflectance Map: Lambertian Surface
n and s are unit vectors.
We can express this in gradient space. We know that n is (p, q, 1)
and s is (ps , qs , 1). Using this, we have
pps + qqs + 1
I =n·s = p p = R (p, q)
p 2 + q 2 + 1 ps2 + qs2 + 1
(ps , qs ) is the source direction.
What are contours in the reflectance map that have the same
brightness?
160 / 184
Reflectance Map: Lambertian Surface
161 / 184
Shape from Single Image?
Can we estimate the shape of a surface from a single image?
Given Image I , source direction s and surface reflectance, i.e,
reflectance map R(p, q). Can we estimate the surface gradient (p, q)
at any particular point? NO.
For example, as shown in figure, lets take one intensity value. This
intensity value corresponds to an iso-brightness contour in the
reflectance map.
Therefore, there are an infinite number of (p, q) values that would
have produced the same brightness value.
163 / 184
Photometric Stereo
The setup for photometric stereo is shown in Fig. We are looking at
one point on the surface but the same algorithm is applied to every
point on the surface.
It is assumed that the camera is the same for all the points on the
surface and the source directions are also the same for all the points
on the surface. In other words the camera and sources are far away
from the surface.
We have three light sources S1 , S2 and S3 . Let us assume the point
of interest has an orientation n and the viewing direction is v .
164 / 184
Photometric Stereo
Notations:
Direction of source i: si = (Psi , qsi )
Reflectance map for source i, Ri (p, q)
Image intensity produced by source i : Ii (x, y )
165 / 184
Photometric Stereo: Basic Idea
166 / 184
Photometric Stereo: Basic Idea
167 / 184
Photometric Stereo: Basic Idea
168 / 184
Photometric Stereo: Basic Idea
169 / 184
Photometric Stereo: Basic Idea
Step 3: For each pixel location (x, y ), find (p, q) as the intersection
of K curves. This (p,q) gives the surface normal at pixel (x,y).
170 / 184
Photometric Stereo: Lambertian Case
Here, I is known , the source matrix is known, the albedo and the
vector n are unknown.
171 / 184
Photometric Stereo: Lambertian Case
where N = πρ n
Solution:
N = (S)−1 I
Surface normal:
N
n=
||N||
Albedo:
ρ
= ||N||
π
172 / 184
When does it nor work?
173 / 184
More sources than minimum needed
Generally, we don’t want to do photometric stereo using minimum
number of sources that we need.
We generally want to use as many sources the application allows us
to. This way we get more robust result.
We get better results by using more than three (K > 3) light sources.
I1 sx1 sy1 sz1
I2 ρ sx sy sz ρ
2 2 2
.. = .. .. n ⇒ I = SN where N = n
..
. π . . . π
IK sxK syK szK
174 / 184
”Effective” point source from multiple sources
If we are looking at a Lambertian surface and we have a large number
of light sources or extended or area light source, these light sources if
they are ON at the same time can be replaced by a single point light
source.
This is possible only in case of Lambertian surface. This is what we
call an effective point light source for multiple sources.
Let say we are looking a point on Lambertian surface having
orientation n, and the viewing direction is v . Let say we have a source
in the direction s1 having brightness k1 which is its radient intensity
divided by the square of its distance from the point.
175 / 184
”Effective” point source from multiple sources
The image intensity measured due to source s1 will be I1 = πρ k1 n · s1 .
Let say we turn on the second source at the same time.
ρ ρ
I1 = k1 n · s1 I2 = k2 n · s2
π π
Since both sources are ON at the same time, the brightness of the
scene point is
ρ ρ
I = n · (k1 s1 + k2 s2 ) = k̂n · ŝ
π π
We are saying the magnitude of resultant source vector is k̂ and the
direction of vector is ŝ.
176 / 184
”Effective” point source from multiple sources
We are saying that if we turn on the two light sources at the same
time, and its a Lambertian object, as long as all points on the
Lambertian object end up seeing both the light sources, we can
basically replace those two light sources with a single point light
source with brightness k̂ and direction ŝ.
This can be extended to an are light source or extended light source.
ρ X ρ
I = n· ki si = k̂n · ŝ
π π
i
k̂, ŝ : Effective source is in direction of ”Centroid” of the sources.
177 / 184
Results: Lambertian Sphere
178 / 184
Results: Lambertian Sphere
179 / 184
Results: Lamberian Mask
This is the case of pained mask. In this case three light sources are
used (Shallow surface).
180 / 184
Results: Lamberian Mask
181 / 184
Results: Toy
182 / 184
Shape from Surface Normals
∂z ∂z
− ,− = (p, q)
∂x ∂y
183 / 184
References
184 / 184