David Luebke3/11/2016 CS 551 / 645: Introductory Computer Graphics Geometric transforms: perspective projection Color.

Slides:



Advertisements
Similar presentations
CS 445 / 645 Introduction to Computer Graphics Lecture 13 Color Color.
Advertisements

Introduction to Computer Graphics ColorColor. Specifying Color Color perception usually involves three quantities: Hue: Distinguishes between colors like.
Color & Light, Digitalization, Storage. Vision Rods work at low light levels and do not see color –That is, their response depends only on how many photons,
Color To understand how to make realistic images, we need a basic understanding of the physics and physiology of vision.
Color Image Processing
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Color Week 5, Fri Feb.
CS 445 / 645 Introduction to Computer Graphics Lecture 12 Camera Models Lecture 12 Camera Models.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Vision/Color II, Virtual.
School of Computing Science Simon Fraser University
CS 4731: Computer Graphics Lecture 24: Color Science
CS248 Midterm Review. CS248 Midterm Mon, November 4, 7-9 pm, Terman Aud Mostly “short answer” questions – Keep your answers short and sweet! Covers lectures.
SWE 423: Multimedia Systems Chapter 4: Graphics and Images (2)
CS248 Midterm Review Derek Chan and Ethan Dreyfuss.
CS248 Midterm Review. CS248 Midterm Mon, November 3, 7-9 pm, Gates B01 Mostly “short answer” questions – Keep your answers short and sweet! Covers lectures.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Color 2 Week 10, Fri 7 Nov 2003.
CS248 Midterm Review Michael Green and Sean Walker (based on the work of previous TAs)
Display Issues Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
1 CSCE441: Computer Graphics: Color Models Jinxiang Chai.
CS559-Computer Graphics Copyright Stephen Chenney Color Recap The physical description of color is as a spectrum: the intensity of light at each wavelength.
Colour in Computer Graphics Mel Slater. Outline: This time Introduction Spectral distributions Simple Model for the Visual System Simple Model for an.
9/14/04© University of Wisconsin, CS559 Spring 2004 Last Time Intensity perception – the importance of ratios Dynamic Range – what it means and some of.
CS 376 Introduction to Computer Graphics 01 / 26 / 2007 Instructor: Michael Eckmann.
Transformations Aaron Bloomfield CS 445: Introduction to Graphics
Any questions about the current assignment? (I’ll do my best to help!)
CS 480/680 Computer Graphics Representation Dr. Frederick C Harris, Jr. Fall 2012.
1 Color vision and representation S M L.
CS 445 / 645: Introductory Computer Graphics Color.
Clipping Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by David Luebke)
Homogeneous Form, Introduction to 3-D Graphics Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Monday, October 20,
CS 445 / 645 Introduction to Computer Graphics Lecture 13 Color Color.
Color Theory ‣ What is color? ‣ How do we perceive it? ‣ How do we describe and match colors? ‣ Color spaces.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Chapter 2: Color Basics. 2 What is light?  EM wave, radiation  Visible light has a spectrum wavelength from 400 – 780 nm.  Light can be composed.
The Rendering Pipeline CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
CSC361/ Digital Media Burg/Wong
David Luebke11/14/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
COLORCOLOR Angel 1.4 and 2.4 J. Lindblad
CS6825: Color 2 Light and Color Light is electromagnetic radiation Light is electromagnetic radiation Visible light: nm. range Visible light:
CS 551 / 645: Introductory Computer Graphics Color.
Three-Receptor Model Designing a system that can individually display thousands of colors is very difficult Instead, colors can be reproduced by mixing.
1 CSCE441: Computer Graphics: Color Models Jinxiang Chai.
Introduction to Computer Graphics
EEL Introduction to Computer Graphics PPT12: Color models Yamini Bura – U
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Introduction to Computer Graphics CS 445 / 645 Lecture 12 Chapter 12: Color.
Transformations CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
1 CSCE441: Computer Graphics: Color Models Jinxiang Chai.
David Luebke1/10/2016 CS 551 / 645: Introductory Computer Graphics David Luebke
Taxonomy of Projections FVFHP Figure Taxonomy of Projections.
Transformations: Projection CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
CS-321 Dr. Mark L. Hornick 1 Color Perception. CS-321 Dr. Mark L. Hornick 2 Color Perception.
David Luebke 1 2/5/2016 Color CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
David Luebke2/23/2016 CS 551 / 645: Introductory Computer Graphics Color Continued Clipping in 3D.
ECE 638: Principles of Digital Color Imaging Systems Lecture 5: Primaries.
CS 551 / 645: Introductory Computer Graphics Viewing Transforms.
09/10/02(c) University of Wisconsin, CS559 Fall 2002 Last Time Digital Images –Spatial and Color resolution Color –The physics of color.
Color University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016 Tamara Munzner.
Color Measurement and Reproduction Eric Dubois. How Can We Specify a Color Numerically? What measurements do we need to take of a colored light to uniquely.
Viewing. Classical Viewing Viewing requires three basic elements - One or more objects - A viewer with a projection surface - Projectors that go from.
1 of 32 Computer Graphics Color. 2 of 32 Basics Of Color elements of color:
Introduction to 3-D Viewing Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Monday, October 27, 2003.
Color Models Light property Color models.
Half Toning Dithering RGB CMYK Models
CS 551 / 645: Introductory Computer Graphics
Display Issues Ed Angel
COLOR space Mohiuddin Ahmad.
Modeling 101 For the moment assume that all geometry consists of points, lines and faces Line: A segment between two endpoints Face: A planar area bounded.
Perception and Measurement of Light, Color, and Appearance
Color Representation Although we can differentiate a hundred different grey-levels, we can easily differentiate thousands of colors.
Slides taken from Scott Schaefer
Presentation transcript:

David Luebke3/11/2016 CS 551 / 645: Introductory Computer Graphics Geometric transforms: perspective projection Color

David Luebke3/11/2016 Administrivia l Problems submitting assignment 2 late l Hand out assignment 3….or not l Graphics Lunch (Glunch)…Fridays at noon, typically in Olsson 236D (this week in 228E) –uva.cs.graphics

David Luebke3/11/2016 Perspective Projection l We talked about geometric transforms, focusing on modeling transforms –Ex: translation, rotation, scale, gluLookAt() –These are encapsulated in the OpenGL modelview matrix l Can also express perspective projection (and other projections) as a matrix l Next few slides: representing perspective projection with the projection matrix

David Luebke3/11/2016 Recap: Transformation Matrices l Represent these transformation using matrices –Rotation, scale, shear: 3x3 matrices suffice –Would be nice to work translation and projection into the same system l Solution: homogeneous coordinates –A point in homogeneous coordinates: [x, y, z, w] T –Corresponding point in 3-D: [x/w, y/w, z/w] T –Now transformation matrices are 4x4

David Luebke3/11/2016 Recap: Homogeneous Coordinates l 4x4 matrix for rotation about the X axis:

David Luebke3/11/2016 Recap: Homogeneous Coordinates 4x4 matrix for scaling by S x, S y, S z :

David Luebke3/11/2016 Recap: Homogeneous Coordinates 4x4 matrix for translating by T x, T y, T z :

David Luebke3/11/2016 Recap: Compositing Transforms l We can composite the effect of multiple transforms by multiplying their matrices: Ex: rotate 90° about X, then 10 units down Z :

David Luebke3/11/2016 Recap: Compositing Transforms l These transforms, in general, do not commute –Translate then rotate very different from rotate then translate l Write transforms down from right to left in the order in which they take place –Example: p’ = R y  -1 R x  -1 R z  R x  R y  p

David Luebke3/11/2016 More On Homogeneous Coords l The w coordinate of a homogeneous point is typically 1 l Decreasing w makes the point “bigger”, meaning further from the origin l Homogeneous points with w = 0 are thus “points at infinity”, meaning infinitely far away in some direction. (What direction?) l To help illustrate this, imagine subtracting two homogeneous points

David Luebke3/11/2016 Perspective Projection l In the real world, objects exhibit perspective foreshortening: distant objects appear smaller l The basic situation:

David Luebke3/11/2016 Perspective Projection l When we do 3-D graphics, we think of the screen as a 2-D window onto the 3-D world: How tall should this bunny be?

David Luebke3/11/2016 Perspective Projection l The geometry of the situation is that of similar triangles. View from above: l What is x’? P (x, y, z)X Z View plane d (0,0,0) x’ = ?

David Luebke3/11/2016 Perspective Projection Desired result for a point [x, y, z, 1] T projected onto the view plane: l What could a matrix look like to do this?

David Luebke3/11/2016 A Perspective Projection Matrix l Answer:

David Luebke3/11/2016 A Perspective Projection Matrix l Example: l Or, in 3-D coordinates:

David Luebke3/11/2016 A Perspective Projection Matrix OpenGL’s gluPerspective() command generates a slightly more complicated matrix: –Can you figure out what this matrix does?

David Luebke3/11/2016 Projection Matrices l Now that we can express perspective foreshortening as a matrix, we can composite it onto our other matrices with the usual matrix multiplication l End result: a single matrix encapsulating modeling, viewing, and projection transforms

David Luebke3/11/2016 Matrix Operations In OpenGL l Certain commands affect the current matrix in OpenGL –glMatrixMode() sets the current matrix –glLoadIdentity() replaces the current matrix with an identity matrix –glTranslate() postmultiplies the current matrix with a translation matrix –gluPerspective() postmultiplies the current matrix with a perspective projection matrix l It is important that you understand the order in which OpenGL concatenates matrices

David Luebke3/11/2016 Matrix Operations In OpenGL l In OpenGL: –Vertices are multiplied by the modelview matrix –The resulting vertices are multiplied by the projection matrix l Example: –Suppose you want to scale an object, translate it, apply a lookat transformation, and view it under perspective projection. What order should you make calls?

David Luebke3/11/2016 Matrix Operations in OpenGL l Problem: scale an object, translate it, apply a lookat transformation, and view it under perspective l A correct code fragment: glMatrixMode(GL_PERSPECTIVE); glLoadIdentity(); gluPerspective(…); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt(…); glTranslate(…); glScale(…); /* Draw the object...*/

David Luebke3/11/2016 Matrix Operations in OpenGL l Problem: scale an object, translate it, apply a lookat transformation, and view it under perspective l An incorrect code fragment: glMatrixMode(GL_PERSPECTIVE); glLoadIdentity(); glTranslate(…); glScale(…); gluPerspective(…); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt(…); /* Draw the object...*/

David Luebke3/11/2016 Color l Next topic: Color To understand how to make realistic images, we need a basic understanding of the physics and physiology of vision. Here we step away from the code and math for a bit to talk about basic principles.

David Luebke3/11/2016 Basics Of Color l Elements of color:

David Luebke3/11/2016 Basics of Color l Physics: –Illumination n Electromagnetic spectra –Reflection n Material properties (i.e., conductance) n Surface geometry and microgeometry (i.e., polished versus matte versus brushed) l Perception –Physiology and neurophysiology –Perceptual psychology

David Luebke3/11/2016 Physiology of Vision l The eye: l The retina –Rods –Cones n Color!

David Luebke3/11/2016 Physiology of Vision l The center of the retina is a densely packed region called the fovea. –Cones much denser here than the periphery

David Luebke3/11/2016 Physiology of Vision: Cones l Three types of cones: –L or R, most sensitive to red light (610 nm) –M or G, most sensitive to blue light (560 nm) –S or B, most sensitive to blue light (430 nm) –Color blindness results from missing cone type(s)

David Luebke3/11/2016 Physiology of Vision: The Retina l Weirdly, rods and cones are at the back of the retina, behind a mostly-transparent neural structure that collects their response.

David Luebke3/11/2016 Perception: Metamers l A given perceptual sensation of color derives from the stimulus of all three cone types l Identical perceptions of color can thus be caused by very different spectra

David Luebke3/11/2016 Perception: Other Gotchas l Color perception is also difficult because: –It varies from person to person (thus std observers) –It is affected by adaptation (transparency demo) –It is affected by surrounding color:

David Luebke3/11/2016 Color Spaces l Three types of cones suggests color is a 3D quantity. How to define 3D color space? l Idea: shine given wavelength ( ) on a screen, and mix three other wavelengths (R,G,B) on same screen. Have user adjust intensity of RGB until colors are identical: l How closely does this correspond to a color CRT? l Problem: sometimes need to “subtract” R to match

David Luebke3/11/2016 CIE Color Space l The CIE (Commission Internationale d’Eclairage) came up with three hypothetical lights X, Y, and Z with these spectra: l Idea: any wavelength can be matched perceptually by positive combinations of X,Y,Z l Note that: X ~ R Y ~ G Z ~ B

David Luebke3/11/2016 CIE Color Space l The gamut of all colors perceivable is thus a three-dimensional shape in X,Y,Z: l For simplicity, we often project to the 2D plane X+Y+Z=1 X = X / (X+Y+Z) Y = Y / (X+Y+Z) Z = 1 - X - Y

David Luebke3/11/2016 CIE Chromaticity Diagram (1931)

David Luebke3/11/2016 Device Color Gamuts l Since X, Y, and Z are hypothetical light sources, no real device can produce the entire gamut of perceivable color l Example: CRT monitor

David Luebke3/11/2016 Device Color Gamuts l The RGB color cube sits within CIE color space something like this:

David Luebke3/11/2016 Device Color Gamuts l We can use the CIE chromaticity diagram to compare the gamuts of various devices: l Note, for example, that a color printer cannot reproduce all shades available on a color monitor

David Luebke3/11/2016 Converting Color Spaces l Simple matrix operation: The transformation C 2 = M -1 2 M 1 C 1 yields RGB on monitor 2 that is equivalent to a given RGB on monitor 1

David Luebke3/11/2016 Converting Color Spaces l Converting between color models can also be expressed as such a matrix transform: l YIQ is the color model used for color TV in America. Y is luminance, I & Q are color –Note: Y is the same as CIE’s Y –Result: backwards compatibility with B/W TV!

David Luebke3/11/2016 Gamma Correction l We generally assume colors are linear l But most display devices are inherently nonlinear –I.e., brightness(voltage) != 2*brightness(voltage/2) l Common solution: gamma correction –Post-transformation on RGB values to map them to linear range on display device: –Can have separate  for R, G, B