1 angel: interactive computer graphics5e © addison- wesley 2009 image formation fundamental imaging...

25
1 Angel: Interactive Computer Graphics5E © Addison-Wesley 2009 Image Formation Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis for image Physical basis for image formation formation Light Light Color Color Perception Perception Synthetic camera model Synthetic camera model

Upload: sherilyn-curtis

Post on 06-Jan-2018

219 views

Category:

Documents


1 download

DESCRIPTION

3 Figures are extracted from Angel's book (ISBN x) The Human Visual System vs The Pinhole camera Human Visual System Visible Spectrum Pinhole camera

TRANSCRIPT

Page 1: 1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis

1Angel: Interactive Computer

Graphics5E © Addison-Wesley 2009

Image FormationImage Formation Fundamental imaging notionsFundamental imaging notions Physical basis for image formationPhysical basis for image formation

LightLight ColorColor PerceptionPerception

Synthetic camera modelSynthetic camera model

Page 2: 1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis

2Angel: Interactive Computer

Graphics5E © Addison-Wesley 2009

Elements of Image Elements of Image FormationFormation

ObjectsObjects ViewerViewer Light source(s)Light source(s)

Attributes that govern how light Attributes that govern how light interacts with the materials in the interacts with the materials in the scenescene

Note the independence of the objects, Note the independence of the objects, the viewer, and the light source(s)the viewer, and the light source(s)

Page 3: 1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis

3Figures are extracted from Angel's book

(ISBN 0-201-38597-x)

The Human Visual The Human Visual System vs The Pinhole System vs The Pinhole

cameracamera

Human Visual System

Visible Spectrum

Pinhole camera

Page 4: 1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis

4Figures are extracted from Angel's book

(ISBN 0-201-38597-x)

The Synthetic-camera The Synthetic-camera ModelModel

Page 5: 1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis

Synthetic CameraSynthetic Cameray

(x,y,z)

X

Z

d

Xp, Yp, -d

Page 6: 1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis

Synthetic Camera Synthetic Camera Projection GeometryProjection Geometry

Z

X

Y

COP

d

(0,0,0)

x,y,z

x’ = x (d/z)y’ = y(d/z)z’ = d

(x’,y’,z’)

Projection Plane

Projected Point

Page 7: 1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis

7 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009

Models and Models and ArchitecturesArchitectures

Page 8: 1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis

8Angel: Interactive Computer

Graphics 5E © Addison-Wesley 2009

Practical ApproachPractical Approach Process objects one at a time in the order Process objects one at a time in the order

they are generated by the applicationthey are generated by the application Can consider only local lightingCan consider only local lighting

Pipeline architecturePipeline architecture

All steps can be implemented in All steps can be implemented in hardware on the graphics cardhardware on the graphics card

application program display

Page 9: 1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis

VerticesVertices

Vertices in world coordinatesVertices in world coordinates void glVertex3f(GLfloat x, void glVertex3f(GLfloat x,

GLfloat y, GLfloat z)GLfloat y, GLfloat z) Vertex (x, y, z) sent down the Vertex (x, y, z) sent down the

pipelinepipeline

Page 10: 1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis

TransformerTransformer

Transformer in world coordinatesTransformer in world coordinates Must be set before object is drawn!Must be set before object is drawn! glRotatef(45.0, 0.0, 0.0, -1.0);glRotatef(45.0, 0.0, 0.0, -1.0); glVertex2f(1.0, 0.0);glVertex2f(1.0, 0.0);

Complex [Angel Ch. 4]Complex [Angel Ch. 4]

Page 11: 1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis

Transformation Matrices Transformation Matrices in OpenGLin OpenGL

Stack

Current

Stack

Current

Load Matrix

Vertices

3DModel

Vertices 3D2D

Modelview Projection

Matrix Mode

Page 12: 1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis

12Angel: Interactive Computer

Graphics 5E © Addison-Wesley 2009

ProjectionProjection Projection Projection is the process that is the process that

combines the 3D viewer with the 3D combines the 3D viewer with the 3D objects to produce the 2D imageobjects to produce the 2D image Perspective projections: all projectors Perspective projections: all projectors

meet at the center of projectionmeet at the center of projection Parallel projection: projectors are Parallel projection: projectors are

parallel, center of projection is replaced parallel, center of projection is replaced by a direction of projectionby a direction of projection

Page 13: 1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis

ProjectorProjector

Page 14: 1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis

Orthographic ProjectionOrthographic Projection

If d = z - and d

x’ = xy’ = y z = d

x’ = x (d/z)y’ = y(d/z)z’ = d

Page 15: 1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis

15Angel: Interactive Computer

Graphics 5E © Addison-Wesley 2009

Primitive AssemblyPrimitive AssemblyVertices must be collected into Vertices must be collected into

geometric objects before clipping geometric objects before clipping and rasterization can take placeand rasterization can take place Line segmentsLine segments PolygonsPolygons Curves and surfacesCurves and surfaces

Page 16: 1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis

ClipperClipper

Page 17: 1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis

17Angel: Interactive Computer

Graphics 5E © Addison-Wesley 2009

ClippingClippingJust as a real camera cannot “see” the Just as a real camera cannot “see” the

whole world, the virtual camera can whole world, the virtual camera can only see part of the world or object only see part of the world or object spacespace Objects that are not within this volume Objects that are not within this volume

are said to be are said to be clippedclipped out of the scene out of the scene

Page 18: 1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis

18Angel: Interactive Computer

Graphics 5E © Addison-Wesley 2009

RasterizationRasterization If an object is not clipped out, the If an object is not clipped out, the

appropriate pixels in the frame buffer appropriate pixels in the frame buffer must be assigned colorsmust be assigned colors

Rasterizer produces a set of fragments for Rasterizer produces a set of fragments for each objecteach object

Fragments are “potential pixels”Fragments are “potential pixels” Have a location in frame buffferHave a location in frame bufffer Color and depth attributesColor and depth attributes

Vertex attributes are interpolated over Vertex attributes are interpolated over objects by the rasterizerobjects by the rasterizer

Page 19: 1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis

RasterizerRasterizer

Page 20: 1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis

20Angel: Interactive Computer

Graphics 5E © Addison-Wesley 2009

Fragment ProcessingFragment Processing

Fragments are processed to determine Fragments are processed to determine the color of the corresponding pixel in the color of the corresponding pixel in the frame bufferthe frame buffer

Colors can be determined by texture Colors can be determined by texture mapping or interpolation of vertex mapping or interpolation of vertex colorscolors

Fragments may be blocked by other Fragments may be blocked by other fragments closer to the camera fragments closer to the camera Hidden-surface removal Hidden-surface removal

Page 21: 1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis

21Angel: Interactive Computer

Graphics 5E © Addison-Wesley 2009

API ContentsAPI Contents Functions that specify what we need to Functions that specify what we need to

form an imageform an image ObjectsObjects ViewerViewer Light Source(s)Light Source(s) MaterialsMaterials

Other informationOther information Input from devices such as mouse and Input from devices such as mouse and

keyboardkeyboard Capabilities of systemCapabilities of system

Page 22: 1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis

22Angel: Interactive Computer

Graphics 5E © Addison-Wesley 2009

Object SpecificationObject Specification Most APIs support a limited set of Most APIs support a limited set of

primitives includingprimitives including Points (0D object)Points (0D object) Line segments (1D objects)Line segments (1D objects) Polygons (2D objects)Polygons (2D objects) Some curves and surfacesSome curves and surfaces

QuadricsQuadrics Parametric polynomialsParametric polynomials

All areAll are defined through locations in defined through locations in space or space or verticesvertices

Page 23: 1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis

23Angel: Interactive Computer

Graphics 5E © Addison-Wesley 2009

ExampleExample

glBegin(GL_POLYGON)glBegin(GL_POLYGON)glVertex3f(0.0, 0.0, 0.0);glVertex3f(0.0, 0.0, 0.0);glVertex3f(0.0, 1.0, 0.0);glVertex3f(0.0, 1.0, 0.0);glVertex3f(0.0, 0.0, 1.0);glVertex3f(0.0, 0.0, 1.0);

glEnd( );glEnd( );

type of object

location of vertex

end of object definition

Page 24: 1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis

24Angel: Interactive Computer

Graphics 5E © Addison-Wesley 2009

Camera SpecificationCamera Specification

Six degrees of freedomSix degrees of freedom Position of center of lensPosition of center of lens OrientationOrientation

LensLens Film sizeFilm size Orientation of film planeOrientation of film plane

Page 25: 1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis

25Angel: Interactive Computer

Graphics 5E © Addison-Wesley 2009

Lights and MaterialsLights and Materials Types of lightsTypes of lights

Point sources vs distributed sourcesPoint sources vs distributed sources Spot lightsSpot lights Near and far sourcesNear and far sources Color propertiesColor properties

Material propertiesMaterial properties Absorption: color propertiesAbsorption: color properties ScatteringScattering

DiffuseDiffuse SpecularSpecular