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:
s
r
2
sin
If light source is a point source, the “ unit area” is omitted in
above definition.
Illumination: light energy radiated or received on a unit
area of surface.
For a point light source,
L I ( i , i ) sin i cos i d i di
where I ( i , i )
is the radiance of light source in the
direction ( i , i ) ; cos i is due to the foreshorten of effective
area of the surface patch in the radiation direction.
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.
BRDF f ( i , i ; e , e )
Where (i ,i ) --- incident angle;
( e ,e ) --- emitting angle
Radiance (reflectance) :
2 2
L( e , e ) I 0 f ( i , i ; e , e ) cos i sin i d i di
0 0
The L( e , e ) is the brightness of an object surface
that you look at.
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) = L( e , e )
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
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
BRDF f (θi ,φi ;θe ,φe )
π
I0
L(θe ,φe ) cosθi
π
where I0 ----- illumination of incident light.
i
----- 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.
2) Specula surface (mirror)
( e i ) (e i )
BRDF f (i ,i ; e ,e )
sin i cos i
L( e ,e ) I ( i , i )
3) Combinational surface:
Surface with reflectance between Lambertain and
specular surfaces:
( e i ) (e i )
BRDF (1 )
sin i cos i
Where -----weigh factor
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,
z
z
z x y
x
y
Denote
p=
Surface normal
z
x
, q=
z
y
n
( p, q,1)
nˆ
n
1 p2 q2
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 map
Assume: Lambertain surface
E(x,y) = L( e , e ) =
I0
cos i
When image intensity is normalized by
E ( x, y )
I ( x, y )
max{ E ( x, y ); ( x, y ) image plane}
then
I ( x, y ) cosi
On another hand, for a 3D surface, let
nˆ ( p, q,1)
be surface normal; Let nˆ s ( ps , qs ,1) be incident direction of
light, then
pps qqs 1
R ( p, q )
2
2
2
2
p q 1 ps qs 1
Where R ( p, q ) 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:
ei [ I ( x, y ) R( p, q)] dxdy min
2
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:
2 p( x, y) 0
2 q( x, y) 0
Thus, the minimization becomes
ei {[ I ( x, y ) R( p, q)]2 [( 2 p) 2 ( 2 q) 2 }dxdy min
In discrete images:
1
2
pij pij ( pi , j 1 pi , j 1 pi 1, j pi 1, j ) pij pij
4
qij qij qij
2
Let
e( x, y )
0
p
e( x, y )
0
q
We get
R
[ I ( x, y ) R( p, q)]
[ p( x, y ) p ] 0
p
R
[ I ( x, y ) R( p, q)]
[ q( x , y ) q ] 0
q
So,
R
p( x, y ) p ( x, y ) [ I ( x, y ) R( p, q)]
p
1
R
q( x, y ) q ( x, y ) [ I ( x, y ) R( p, q)]
q
1
Since p ( x, y ) and q ( x, y ) 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).
p
( n 1)
q
( n 1)
R ( n )
( x, y ) p ( x, y ) {[ I ( x, y ) R( p, q)] }
p
1
(n)
R ( n )
( x, y ) q ( x, y ) {[ I ( x, y ) R( p, q)] }
q
1
(n)
For a Lambertain surface,
R ( p, q )
pps qqs 1
p 2 q 2 1 ps2 qs2 1
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 stereo
Assume:
i) Fixed camera position
ii) Light source located at 3 different positions to surface, at
each position, One images is obtained.
iii) Lambertain surface
iv) Orthographic projection for three images.
Let incident direction be :
ˆ
ˆ ˆ
ˆ ( psi x qsi y z ) ,
si
p 2 si q 2 si 1
i=1,2,3
Surface normal:
n̂
, unknown
Image: normalized image: I i ( x, y ), i 1,2,3
From reflectance map of Lambertain:
ˆ ˆ
I i Si n , i 1,2,3
Write
sˆ1 s1 x
S sˆ2 s21x
sˆ s
3 3x
s1 y
s2 y
s3 y
s1z
s2 z
s3 z
I1
I I2
I
3
Then we have I Snˆ .
ˆ
ˆ
1
This is a linear equation ,which can be solved by n S I
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.
© Copyright 2025 Paperzz