Course 10 Shading
Course 10 Shading
1. Basic Concepts:Light Source:
Radiance: the light energy
radiated from a unit area of
light source (or surface) in
a unit solid angle.
Solid angle:
If light source is a point source, the “ unit area” is omitted in above definition.
sin2
r
s
Illumination: light energy radiated or received on a unit area of surface.
For a point light source,
where is the radiance of light source in the
direction ; is due to the foreshorten of
effective area of the surface patch in the radiation
direction.
iiiiii ddIL cossin),(
),( iiI
),( ii icos
Surface:
Bi-directional reflectance distribution function (BRDF):
BRDF of a surface is the ratio of energy radiated from
a surface patch in some direction to the energy
arriving at the surface from some direction.
Where --- incident angle;
--- emitting angle
),;,( eeiifBRDF
),( ii
),( ee
Radiance (reflectance) :
The is the brightness of an object surface that you look at.
iiiieeiiee ddfIL
sincos),;,(),(2
0 0
0
2
),( eeL
Imaging :
Assume that the irradiance at a point (X,Y) of an image plane is equal to the radiance from a corresponding surface patch, i.e.,
E(X,Y) = L(x,y,z) =
This indicates that the terms of brightness, intensity and gray-level will have the same meaning as irradiance for an image.
Note: radiance ----- out-going energy
irradiance ----- in-going energy
),( eeL
2. Surface Reflectance 1) Lambertain surface (Diffuse surface) in micro: rough
in macro: smooth
Def. Lambertain surface is a kind of surface that reflects incident light equally in all directions regardless the direction of incident light. A Lambertain surface is assumed not to absorb any incident illumination.
π
1),φ;θ,φθfBRDF eeii (
where I0 ----- illumination of incident light.
----- incident angle to surface.
Remark: For a Lambertain surface, its brightness percieved by a viewer do not relate to the position of the viewer. But the brightness is strongly related to the direction from which the light is illuminated to the surface.
i
i0
ee cosθπ
I),φL(θ
2) Specula surface (mirror)
3) Combinational surface:Surface with reflectance between Lambertain and specular surfaces:
Where -----weigh factor
),;,( eeiifBRDF ii
ieie
cossin
)()(
),( eeL
)1(
BRDF
),( iiI
ii
ieie
cossin
)()(
3. Shape from shading (Horn,1970)Assumptions: i) Lambertain surface ii) Parallel light source from known direction iii) Orthographic projection for image
Imaging: given the condition of light source and object surface in 3D, the intensity of each pixel in image plane can be uniquely determined.
Question: If an image is given, can we evaluate the structure of the 3D surface? i.e., can we find the surface normal at each surface point? How is about the illumination of light source?
Surface Orientation :
Let a 3D surface be z=z (x,y), then,
Denote
p= , q=
Surface normal
yy
zx
x
zz
x
z
y
z
221
)1,,(ˆ
qp
qp
n
nn
Note: p and q are the functions of 3D point (x,y,z) at a surface. Under the assumption of orthographic projection p and q are also the functions of (X,Y) of image, i.e.
p = p(x,y) = p(X,Y), q = q(x,y) = q(X,Y)
Question : How to determine the two functions from image clue?
1) Reflectance mapAssume: Lambertain surface
E(x,y) = =
When image intensity is normalized by
then
On another hand, for a 3D surface, let
be surface normal; Let be incident direction of light, then
),( eeL i
I
cos0
plane} image),();,(max{
),(),(
yxyxE
yxEyxI
iyxI cos),( )1,,(ˆ qpn
)1,,(ˆ sss qpn
),(11
12222
qpRqpqp
qqpp
ss
ss
Where is called reflectance map of a 3D
surface.
To solve for p(x,y) and q(x,y) , we can use variation to
minimize [I(x,y) R(p,q)]2 over image plane:
Note that this is an ill-conditional problem, to solve for
functions p = p(x,y) and q = q(x,y), we enforce
smoothness constraint:
),( qpR
min)],(),([ 2 dxdyqpRyxIei
0),(2 yxp 0),(2 yxq
Thus, the minimization becomes
In discrete images:
Let
min})()[()],(),({[ 22222 dxdyqpqpRyxIei
ijijjijijijiijij pppppppp )(4
1,1,11,1,
2
ijijij qqq 2
0),(
p
yxe
0),(
q
yxe
We get
So,
0]),([)],(),([
pyxpp
RqpRyxI
0]),([)],(),([
qyxqq
RqpRyxI
p
RqpRyxIyxpyxp
)],(),([1
),(),(
q
RqpRyxIyxqyxq
)],(),([1
),(),(
Since and are computed from the value of the neighbor pixels of p(x,y), iterative method should be used to solve for p(x,y) and q(x,y).
For a Lambertain surface,
),( yxp ),( yxq
)()()1( })],(),({[1
),(),( nnn
p
RqpRyxIyxpyxp
)()()1( })],(),({[1
),(),( nnn
q
RqpRyxIyxqyxq
11
1),(
2222
ss
ss
qpqp
qqppqpR
Remark:
1) assumed incident light direction is known.
2) the choice of initial values of p(x,y) and q(x,y)
is
important to get a convergence at global
minimum.
4. Photometric stereoAssume:i) Fixed camera positionii) Light source located at 3 different positions to surface, a
t each position, One images is obtained.iii) Lambertain surfaceiv) Orthographic projection for three images.Let incident direction be :
, i=1,2,31
)ˆˆˆ(ˆ
22
sisi
sisi
iqp
zyqxps
Surface normal: , unknownImage: normalized image:From reflectance map of Lambertain:
Write
Then we have . This is a linear equation ,which can be solved by
n̂3,2,1),,( iyxIi
3,2,1,ˆˆ
inSIii
zyx
zyx
zyx
sss
sss
sss
s
s
s
S
333
2221
111
3
2
1
ˆ
ˆ
ˆ
3
2
1
I
I
I
I
nSIˆ
ISnˆˆ 1
Further reading: In estimation of surface orientation, we need to know the direction of the illumination from light source first !!
How to estimate the direction of light source from an intensity image?
---- Pentland’s method
---- Lee & Rosenfeld’s method
---- Tsai and Shah’s method
---- Zheng & Chellapa’s method
All assume that the 3D surface is a part of share in the stage of estimation of illumination direction of light source.