Title: CG for Vision Research
1CG for Vision Research
- Lecture 11
- Winter Term 05-06
- Quoc Vuong, Franck Caniard, MPI
2OpenGL Projections Transformations Graphics
Primitives Textures Lighting Material Properties
Vision Research Viewpoint Effect Structure from X
(Motion, Shading, Stereo) Active
Exploration Navigation
GLUT Window Management Input Devices Event
Loop Timing
Fun/Advanced Modeling Animations Mapping (bumps,
terrains) Physics Simulation Sound (OpenAL)
3Todays Menu
- Stereo and shading
- Dissociating position, normal, and disparity
- Bump mapping
- cheap realism
- Stereo and shading integration
4Stereo - Shading
5Escher, 3 Spheres
6// Normals and z from Teapot // Disparity from
Rabbit! // Right Eye glBegin(GL_TRIANGLES) for
(i0 iltn i) glNormal3f(nxT, nyT, nzT)
glVertex3f(xRR,y,zT) glEnd() // Left
Eye glBegin(GL_TRIANGLES) for (i0 iltn i)
glNormal3f(nxT, nyT, nzT)
glVertex3f(xLR,y,zT) glEnd()
We can start mixing and matching position,
normal, and disparity!
7Limitations
- Shading does not provide good disparity signal
because of smooth gradient - Correspondence problem in vision
- Need textures (features)
- Position and disparity not completely
independent disparity distorts projected image - ok if disparity is small
- Humans have high stereoacuity
- Complexity and differences of 3d models will make
a big difference!
8Template Code 11
9Bump Mapping
10What do you see?
112d images
- Most of the time, we think of color
- red, green, blue channels
- or grayscale intensity
- But can encode anything!
- e.g. intensity height
- Normals!
- nx, ny, nz -gt R, G, B
12(No Transcript)
13Mark Kilgard, 2000, NVIDIA
14(No Transcript)
15Components ofbump mapping
- Normal map
- Extension of texture mapping
- Just an image
- So can do interpolation, sampling, mipmapping,
etc. - Perturbs normal at each vertex on a per pixel
basis - Tangent space
- Tangents at local surface
- Normal
16Simple idea Perturb normal with normal map
- Original idea by Jim Blinn
- Change shape of the surface by changing its
normal - Affects shading!
- Cheap realism
- Easier than actually rendering bumpy surface
- Less memory intensive for higher quality
- Uses texture mapping techniques to smoothly
interpolate shading per pixel
Mark Kilgard, 2000, NVIDIA
17Normals ? Normal maps
- Normals have 3 components
- Nx, Ny, Nz
- Components form unit length vector
- Nx2 Ny2 Nz2 1
- Lie within 1 to 1
- Arbitrarily convert to color space!
- R (Nx1)/2, G (Ny1)/2, B (Nz1)/2 (get
into 0-1 range) - Any arbitrary RGB image can be treated as a
normal map - Take picture of real bumpy surface, and use that
image as a normal map
18Tangent space
- In texture mapping, image is used to change color
per pixel of a model within object space - In bump mapping, image is used to perturb normal
to affect shading (and shape) within tangent
space - Space formed by the normal vector, and the 2
tangent vectors - Displacement mapping Actually perturb 3d vertex
position using similar ideas
19Micro-textures
- Psychophysics and vision?
- Shading gradients provide a weak disparity signal
- Use bump mapping to add micro-textures
(high-contrast features) to enhance signal
strength - Does not affect global shading across shape
- Possibly more controllable than just adding noise
to the normals (as done in Stereo-Shading
template code) - Efficient method to add realism to stimuli by
adding micro-textures
20Template Code 11
- Bump mapping
- (modified from www.paulsproject.net)
21This slide left intentionally blank