Intro to Computer Vision

advertisement
Introduction to Computer Vision
CS / ECE 181B
Tues, May 18, 2004
Ack: Matthew Turk (slides)
Outline
• Radiance and Irradiance
• Lambertian and Specular surfaces
• Bidirectional reflectance distribution function (BRDF)
• Fundamental Radiometric Relation
• Gradient Space
• Reflectance Map
• Photometric Stereo
Geometry and Radiometry
• In creating and interpreting images, we need to understand
two things:
– Geometry – Where scene points appear in the image (image
locations)
– Radiometry – How “bright” they are (image values)
• Geometric enables us to know something about the scene
location of a point imaged at pixel (u, v)
• Radiometric enables us to know what a pixel value
implies about surface lightness and illumination
• This is relevant to both computer vision and computer
graphics
– Ray tracing
– Illumination and shading models
Radiometry
• Radiometry is the measurement of light
– Actually, electromagnetic energy
• Imaging starts with light sources
– Emitting photons – quanta of light energy
– The sun, artificial lighting, candles, fire, blackbody radiators …
• Light energy interact with surfaces
– Reflection, refraction, absorption, fluorescence…
– Also atmospheric effects (not just solid surfaces)
• Light energy from sources and surfaces gets imaged by a
camera
– Through a lens, onto a sensor array, finally to pixel values – an
image!
Ray tracing
Reversible:
- From camera to light sources
- From light sources to camera
light source
pixels
visibility?
reflection
surface
camera
center
What’s the intensity value (and color) at this pixel?
Computer graphics examples
CG example: Pixar
Geri’s Game
1997 Oscar Award
Best Animated Short Film
Illumination and shading in CG
• The illumination model describes how light interacts with
the surface
– A set of calculations for determining color and intensity at a given
surface point, given a lighting model (model of light sources)
– E.g., what color is that point on that surface?
– Local vs. global
 Whether or not computation takes into account other elements
in the scene (local model doesn’t)
– May be empirical or experimental
– Should model the effects of ambient light, incident light, surface
reflection (diffuse and specular), etc.
Illumination models
• An illumination model is a function of
– Time (exposure time)
– Position and orientation of
 Object surface
 Lighting sources
 Camera
– Wavelength of
 Lighting sources
 Surface reflectance function
– Surface albedo ()
 The fraction of incident light that is reflected by the surface,
independent of wavelength
 Corresponds to intuitive notion of surface lightness
Three surface reflectance functions/models
Ideal diffuse
(Lambertian)
Ideal
specular
Directional
diffuse
Cook-Torrance Model
Different parameters give different surface appearances
Radiometry
• Radiometry – the science of measurement of
electromagnetic radiation
– The complete EM spectrum (not just visible light)
• To understand radiometry, we have to understand the
notions of foreshortening and solid angle
Foreshortening
• Principal of foreshortening – When a patch of area A is
tilted at an angle  with respect to a distant view point p, it
appears to have an area A cos 
• This is true for viewing a light source from the point of
view of a surface patch; and also for viewing a surface
patch from the point of view of a light source

Which plate will heat faster?
Irradiance  cos 
Solid angle
• Around any point on a surface is a hemisphere of
directions
– Parameterized by two angles,  and 
• We’ll be considering light entering and exiting such
hemispheres
Solid angle
• Solid angle of a cone of directions – the area cut out by the
cone on the unit sphere
– Solid angle () = surface area at r=1
–  = A/r2
• Solid angle of a complete sphere = 4π steradians (sr)
What’s the area of a circle?
What’s the surface area of a sphere?
Solid angle
• The solid angle subtended by a patch of area dA is given by
dA cos 
d 
r2
• The solid angle subtended by a patch
of angular size (d, d) is
d  sin  d d
Radiance and irradiance
• Radiance (L) – energy exiting a source or surface
• Irradiance (E)– incoming energy
E
L
E
E
L
L
E
L
Which (E or L) does a camera sensor array directly measure?
Example
• Luminance of common sources:
–
–
–
–
–
–
surface of the sun: 2,000,000,000 cd/m2
sunlit clouds: 30,000 cd/m2
clear day: 3000 cd/m2
overcast day: 300 cd/m2
moonlight: 0.03 cd/m2
moonless sky: 0.00003 cd/m2
Photometric
term
• Luminance = commonly called “brightness”
– Density of radiated power
• Radiance = “scene brightness”
• Irradiance = “image brightness”
Radiometric
terms
Irradiance
• A surface experiencing radiance L(x,,) coming in from
solid angle d experiences irradiance
E  Lx, , cos d
radiance
solid
angle
foreshortening
factor
Calculating Irradiance
• Integrate weighted incident radiance over hemisphere
solid
angle
Since d  sin  d d
Light and surfaces
• When light energy hits a surface, several things can
happen, depending on the surface properties (texture, color,
opacity, material, …)
–
–
–
–
–
–
Reflection
Absorption
Refraction
Transmission
Scattering
Various combinations
• The result is called reflectance, and it is a function of the
incoming (incident) and outgoing angles of the light
Reflectance example
Irradiance (E)
Radiance (L)
?
Surface Reflectance
K
Bidirectional Reflectance Distribution Function
• The BRDF tells us how bright a surface appears when
viewed from one direction while light falls on it from
another one
– General model of local reflection
• More precisely, it is the ratio of reflected radiance dLr in
the direction toward the viewer to the irradiance dEi in the
direction toward the light source
Reflected energy
N
Incident energy
BRDF :   f ( i , i ,  o , o )
0  
i
o
BRDF models
For many surfaces, a simple BRDF suffices
• Specular surface (e.g., a mirror)
1

if  i   o and i  o

f ( i , i , o , o )   cos  sin 

0 otherwise

• Lambertian (diffuse, matte) surface (e.g., white powder)
– Independent of exit angle
f (i , i ,o , o )   L
• Combinations (Phong, Lambertian+Specular, …)
Surface Brightness
How bright will a Lambertian surface be when it is illuminated by a point
source of radiance E?
Cosine or Lambert’s law
of reflection
A point source located in direction
The term
has radiance E:
ensures that the integral of this expression is just E, that is:
Examples (again)
Ideal diffuse
(Lambertian)
Ideal
specular
Directional
diffuse
Image formation by thin lens
Image irradiance on the image plane
• The image irradiance (E) is proportional to the object
radiance (L)
Lens diameter
Angle off optical axis
 d 2

E     cos 4 L


4  f 

Focus distance
What the image reports to us

via pixel values
What we really want to know
Power captured by the lens
• Power captured by the lens from the surface patch is the product of the
following three terms
– The radiance L of the surface patch in the direction of the lens
– The foreshortened area
of the patch in the direction of the
lens
– The solid angle subtended by the aperture of the lens at the surface patch
Foreshortened area of the aperture in the direction of the patch
Square of the distance of the aperture from the patch
Fundamental Radiometric Relation
Irradiance
Radiometry summary
• Radiometry tells us how light energy from sources
interacts with object surfaces and eventually gets collected
(by photons releasing electrons) in the image sensor array
• Light is additive and the process is linear
– Double the power of the light source and the image value doubles
(sort of…)
• Modeling the true paths of all light sources (including
surface interreflections, atmospheric effects, etc.) is
impossible – our models are approximations
• Can we determine the shape of an object by its image? By
detecting shadows?
• What about color?
Download