0% found this document useful (0 votes)
21 views18 pages

Topic2 - Shape From Shading

Uploaded by

tamerkobba12
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views18 pages

Topic2 - Shape From Shading

Uploaded by

tamerkobba12
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Shape from Shading

Light & Shading Slide 1


Application: Photometric Stereo
• Reconstruct a 3D patch of a surface from a series of
pictures of the surface taken under different
illuminants.
• For simplicity use an
orthographic projection: 3D
(x,y,z) → image (x,y)
• We use a depth map called a
Monge patch

Light & Shading 2


Photometric Stereo
• Photometric stereo is a method for recovering a
representation of a Monge Patch from image data.
• The method involves reasoning about the image
intensity values from several different images of a
surface in a fixed view illuminated by different sources.
• The resulting representation is known as a height map,
depth map, or dense depth map.

Light & Shading 3


Photometric Stereo
• We adopt a local shading model.
• Assume there is no ambient illumination such that only
a light source illuminates the point P.
Source vector

Surface
B( P) = r ( P)N( P).S1
radiosity

• This camera model assumes that there is only ONE


point P on the surface for each point (x,y) in the image.

B ( x, y ) = B ( P )
Light & Shading 4
Photometric Stereo
• We further assume that the response of the camera is
linear in the surface radiosity:
I ( x, y ) = kB( x, y )
= kr ( x, y )N( x, y ).S1
= g ( x, y ).V1
g ( x, y ) = r ( x, y ) N ( x, y )

V1 = kS1

k : constant connecting camera response


to the input radiance.
Light & Shading 5
Normal and Albedo
æ V1T ö
• If we have n sources with known Vi ç ÷
ç V2T ÷
n =ç ÷
ç ÷
ç VT ÷
è nø
æ I1 ( x, y ) ö
ç ÷
• For each image point we stack ç I 2 ( x, y ) ÷
the measurements into a vector: i ( x, y ) = ç ÷

ç ÷
ç I ( x, y ) ÷
è n ø
Light & Shading 6
Normal and Albedo
• Therefore:

i(x, y) = νg(x, y)

• Typically, n > 3 so that a least-squares-solution is


appropriate for each point in space.
• In this method, we only reconstruct point that are not
shaded

Light & Shading 7


Normal and Albedo

Light & Shading 8


Measuring Albedo
• We can extract the albedo from a measurement of g
because N is the unit normal.
g ( x, y ) = r ( x, y )
• The albedo should be between 0 and 1. Use this as a
check.

Light & Shading 9


Recovering Normals
• We can extract the surface normal from g because the
normal is a unit vector.

1
N ( x, y ) = g ( x, y )
g ( x, y )

Light & Shading 10


Shape from Normals
• Recalling the surface is (x, y, f(x,y) ) and the normal is:

T
1 ì ¶f ¶f ü
N ( x, y ) = í , ,1ý
¶f 2 ¶f 2 î ¶x ¶y þ
1+ +
¶x ¶y

• To recover the depth map we need to find f(x,y) from


the unit normals.

Light & Shading 11


Shape from Normals
• If the measured values of the unit normal at some
point (x,y) is (a(x,y), b(x,y), c(x,y)):
T
1 ì ¶f ¶f ü
N ( x, y ) = í , ,1ý
¶f 2 ¶f 2 î ¶x ¶y þ
1+ +
¶x ¶y
• To recover the depth map we need to find f(x,y) from
the unit normals.
¶f a ( x, y ) ¶f b( x, y )
= and =
¶x c( x, y ) ¶y c( x, y )
Light & Shading 12
Shape from Normals
• Now we have:
¶2 f ¶2 f
=
¶x¶y ¶y¶x

• So we have a sanity check as:

æ a ( x, y ) ö æ b ( x, y ) ö
¶çç ÷÷ ¶çç ÷÷
è c ( x, y ) ø - è c ( x, y ) ø » 0
¶y ¶x

Light & Shading 13


Shape by integration

• The surface can be reconstructed up to some constant


depth error.
• The partial derivative gives the change in surface height
with a small step in either the x or the y direction.
• Therefore, we get the surface by summing these
changes in height along some path.

Light & Shading 14


Shape by integration
æ ¶f ¶f ö
f ( x, y ) = ò çç , ÷÷.dl + c
C ¶x ¶y
è ø

v ∂f u ∂f
f (u, v) = ∫ (0, y)dy + ∫ (x, v)dx + c
0 ∂y 0 ∂x

Light & Shading 15


Light & Shading 16
Section 2.2 Inference from Shading 51

FIGURE 2.13: Photometric stereo could become the method of choice to capture complex
deformable surfaces. On the top, three images of a garment, lit from different directions,
which produce the reconstruction shown on the top right. A natural way to obtain three
different images at the same time is to use a color camera; if one has a red light, a green
Slide 17
light, and a blue light, then a singleLight
color& Shading
image frame can be treated as three images
under three separate lights. On the bottom, an image of the garment captured in this
Lab exercise:Photometric Stereo:
estimating surface normals and albedo

Use multiple images of an object taken under different


light conditions from different angles to get the surface
orientation.
MECH 642 Introduction Slide 18

You might also like