9/30/04© University of Wisconsin, CS559 Fall 2004 Last Time Reconstruction Aliasing Compositing Intro.

Slides:



Advertisements
Similar presentations
Today Composing transformations 3D Transformations
Advertisements

Lecture 8 Transparency, Mirroring
Transformations We want to be able to make changes to the image larger/smaller rotate move This can be efficiently achieved through mathematical operations.
Graphics Pipeline.
Week 7 - Monday.  What did we talk about last time?  Specular shading  Aliasing and antialiasing.
3D Graphics Rendering and Terrain Modeling
CS 551 / CS 645 Antialiasing. What is a pixel? A pixel is not… –A box –A disk –A teeny tiny little light A pixel is a point –It has no dimension –It occupies.
Informationsteknologi Wednesday, November 7, 2007Computer Graphics - Class 51 Today’s class Geometric objects and transformations.
Computational Photography Prof. Feng Liu Spring /06/2015.
Math for CSLecture 11 Mathematical Methods for Computer Science Lecture 1.
CHAPTER 7 Viewing and Transformations © 2008 Cengage Learning EMEA.
3D Graphics Goal: To produce 2D images of a mathematically described 3D environment Issues: –Describing the environment: Modeling (mostly later) –Computing.
Painterly Rendering with Curved Brush Strokes of Multiple Sizes Aaron Hertzman, NYU Presented by: Shreeganesh Ramanan.
02/14/02(c) University of Wisconsin 2002, CS 559 Last Time Filtering Image size reduction –Take the pixel you need in the output –Map it to the input –Place.
10/5/04© University of Wisconsin, CS559 Fall 2004 Last Time Compositing Painterly Rendering Intro to 3D Graphics Homework 3 due Oct 12 in class.
CS324e - Elements of Graphics and Visualization Java2D Graphics.
10/13/200© NTUST Last Time Compositing Painterly Rendering Intro to 3D Graphics Homework 2, 3 due Oct 13 in class.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Geometric Transformation. So far…. We have been discussing the basic elements of geometric programming. We have discussed points, vectors and their operations.
01/28/05© 2005 University of Wisconsin Last Time Improving Monte Carlo Efficiency.
Tools for Raster Displays CVGLab Goals of the Chapter To describe pixmaps and useful operations on them. To develop tools for copying, scaling, and rotating.
CS559: Computer Graphics Lecture 6: Edge Detection, Image Compositing, and Warping Li Zhang Spring 2010.
Week 2 - Wednesday CS361.
2D Graphics: Rendering Details
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
Transformations Jehee Lee Seoul National University.
CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS – PART 2 SPRING 2015 DR. MICHAEL J. REALE.
Geometric Transformations
Filtering and Color To filter a color image, simply filter each of R,G and B separately Re-scaling and truncating are more difficult to implement: –Adjusting.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
CS-378: Game Technology Lecture #4: Texture and Other Maps Prof. Okan Arikan University of Texas, Austin V Lecture #4: Texture and Other Maps.
10/3/02 (c) 2002 University of Wisconsin, CS 559 Last Time 2D Coordinate systems and transformations.
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
03/28/03© 2005 University of Wisconsin NPR Today “Comprehensible Rendering of 3-D Shapes”, Takafumi Saito and Tokiichiro Takahashi, SIGGRAPH 1990 “Painterly.
CS559: Computer Graphics Lecture 8: 3D Transforms Li Zhang Spring 2008 Most Slides from Stephen Chenney.
CS559: Computer Graphics Lecture 4: Compositing and Resampling Li Zhang Spring 2008.
CS559: Computer Graphics Lecture 8: Warping, Morphing, 3D Transformation Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
2/17/04© University of Wisconsin, CS559 Spring 2004 Last Time Resampling –Ideal reconstruction –You can only ideally reconstruct band-limited functions.
Basic Perspective Projection Watt Section 5.2, some typos Define a focal distance, d, and shift the origin to be at that distance (note d is negative)
Geometric Transformations
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 17, 2015 TRANSFORMATIONS AFFINE TRANSFORMATIONS QUATERNIONS.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
In the name of God Computer Graphics.
UniS CS297 Graphics with Java and OpenGL Blending.
CISC 110 Day 3 Introduction to Computer Graphics.
Computer Graphics I, Fall 2010 Implementation II.
CS559: Computer Graphics Lecture 12: Antialiasing & Visibility Li Zhang Spring 2008.
Painterly Rendering with Curved Brush Strokes of Multiple Sizes Aaron Hertzmann Siggraph98 資工所碩一 R 蔡銘宏.
CS559: Computer Graphics Lecture 9: 3D Transformation and Projection Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
9/28/04© University of Wisconsin, CS559 Fall 2004 Last Time Filtering –Box –Bartlett –Gaussian –Edge Detect (High-Pass) –Edge Enhance –How to apply filters.
Geometric Transformations Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
Processing Images and Video for An Impressionist Effect Automatic production of “painterly” animations from video clips. Extending existing algorithms.
Transformations. Transformations Introduce standard transformations ◦ Rotation ◦ Translation ◦ Scaling ◦ Shear Derive homogeneous coordinate transformation.
Forward Projection Pipeline and Transformations CENG 477 Introduction to Computer Graphics.
- Introduction - Graphics Pipeline
In the name of God Computer Graphics.
Week 7 - Monday CS361.
Computer Graphics CC416 Week 15 3D Graphics.
3D Transformations Source & Courtesy: University of Wisconsin,
3D Graphics Rendering PPT By Ricardo Veguilla.
CS451Real-time Rendering Pipeline
3D Rendering Pipeline Hidden Surface Removal 3D Primitives
CSC4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University Transformations.
Painterly Rendering with Curved Brush Strokes of Multiple Sizes
Digital Media Dr. Jim Rowan ITEC 2110.
© University of Wisconsin, CS559 Spring 2004
(c) 2002 University of Wisconsin, CS 559
(c) University of Wisconsin, CS559
Lecture 8: 3D Transforms Li Zhang Spring 2008
Last Time Dithering Introduction to signal processing Filtering
Presentation transcript:

9/30/04© University of Wisconsin, CS559 Fall 2004 Last Time Reconstruction Aliasing Compositing Intro

9/30/04© University of Wisconsin, CS559 Fall 2004 Today Compositing Painterly Rendering Intro to 3D Graphics Homework 3 due Oct 12 in class

9/30/04© University of Wisconsin, CS559 Fall 2004 Compositing Assumptions We will combine two images, f and g, to get a third composite image –Not necessary that one be foreground and background –Background can remain unspecified Both images are the same size and use the same color representation Multiple images can be combined in stages, operating on two at a time

9/30/04© University of Wisconsin, CS559 Fall 2004 Basic Compositing Operation At each pixel, combine the pixel data from f and the pixel data from g with the equation: F and G describe how much of each input image survives, and c f and c g are pre-multiplied pixels, and all four channels are calculated To define a compositing operation, define F and G

9/30/04© University of Wisconsin, CS559 Fall 2004 “Inside” Operator Get f to the extent that g is there, otherwise nothing inside=

9/30/04© University of Wisconsin, CS559 Fall 2004 “Inside” Operator Computes composite with the rule that only parts of f that are inside g contribute

9/30/04© University of Wisconsin, CS559 Fall 2004 “Outside” Operator Get f to the extent that g is not there, otherwise nothing outside=

9/30/04© University of Wisconsin, CS559 Fall 2004 “Outside” Operator Computes composite with the rule that only parts of f that are outside g contribute

9/30/04© University of Wisconsin, CS559 Fall 2004 “Atop” Operator Get f to the extent that g is there, otherwise g inside=

9/30/04© University of Wisconsin, CS559 Fall 2004 “Atop” Operator Computes composite with the over rule but restricted to places where there is some g

9/30/04© University of Wisconsin, CS559 Fall 2004 “Xor” Operator Get f to the extent that g is not there, and g to extent of no f xor=

9/30/04© University of Wisconsin, CS559 Fall 2004 “Xor” Operator Computes composite with the rule that f contributes where there is no g, and g contributes where there is no f

9/30/04© University of Wisconsin, CS559 Fall 2004 “Clear” Operator Computes a clear composite Note that (0,0,0,  >0) is a partially opaque black pixel, whereas (0,0,0,0) is fully transparent, and hence has no color

9/30/04© University of Wisconsin, CS559 Fall 2004 “Set” Operator Computes composite by setting it to equal f Copies f into the composite

9/30/04© University of Wisconsin, CS559 Fall 2004 Compositing Operations F and G describe how much of each input image survives, and c f and c g are pre-multiplied pixels, and all four channels are calculated OperationFG Over Inside Outside Atop Xor Clear Set

9/30/04© University of Wisconsin, CS559 Fall 2004 Unary Operators Darken: Makes an image darker (or lighter) without affecting its opacity Dissolve: Makes an image transparent without affecting its color

9/30/04© University of Wisconsin, CS559 Fall 2004 “PLUS” Operator Computes composite by simply adding f and g, with no overlap rules Useful for defining cross-dissolve in terms of compositing:

9/30/04© University of Wisconsin, CS559 Fall 2004 Obtaining  Values Hand generate (paint a grayscale image) Automatically create by segmenting an image into foreground background: –Blue-screening is the analog method Remarkably complex to get right –“Lasso” is the Photoshop operation With synthetic imagery, use a special background color that does not occur in the foreground –Brightest blue or green is common

9/30/04© University of Wisconsin, CS559 Fall 2004 Compositing With Depth Can store pixel “depth” instead of alpha Then, compositing can truly take into account foreground and background Generally only possible with synthetic imagery –Image Based Rendering is an area of graphics that, in part, tries to composite photographs taking into account depth

9/30/04© University of Wisconsin, CS559 Fall 2004 Painterly Filters Many methods have been proposed to make a photo look like a painting Today we look at one: Painterly-Rendering with Brushes of Multiple Sizes Basic ideas: –Build painting one layer at a time, from biggest to smallest brushes –At each layer, add detail missing from previous layer

9/30/04© University of Wisconsin, CS559 Fall 2004 Algorithm 1 function paint(sourceImage,R 1... R n ) // take source and several brush sizes { canvas := a new constant color image // paint the canvas with decreasing sized brushes for each brush radius R i, from largest to smallest do { // Apply Gaussian smoothing with a filter of size const * radius // Brush is intended to catch features at this scale referenceImage = sourceImage * G(fs R i ) // Paint a layer paintLayer(canvas, referenceImage, Ri) } return canvas }

9/30/04© University of Wisconsin, CS559 Fall 2004 Algorithm 2 procedure paintLayer(canvas,referenceImage, R) // Add a layer of strokes { S := a new set of strokes, initially empty D := difference(canvas,referenceImage) // euclidean distance at every pixel for x=0 to imageWidth stepsize grid do // step in size that depends on brush radius for y=0 to imageHeight stepsize grid do { // sum the error near (x,y) M := the region (x-grid/2..x+grid/2, y-grid/2..y+grid/2) areaError := sum(D i,j for i,j in M) / grid 2 if (areaError > T) then { // find the largest error point (x1,y1) := max D i,j in M s :=makeStroke(R,x1,y1,referenceImage) add s to S } paint all strokes in S on the canvas, in random order }

9/30/04© University of Wisconsin, CS559 Fall 2004 Results OriginalBiggest brush Medium brush addedFinest brush added

9/30/04© University of Wisconsin, CS559 Fall 2004 Point Style Uses round brushes We provide a routine to “paint” round brush strokes into an image for the project

9/30/04© University of Wisconsin, CS559 Fall 2004 Where to now… We are now done with images We will spend several weeks on the mechanics of 3D graphics –Coordinate systems and Viewing –Clipping –Drawing lines and polygons –Lighting and shading We will finish the semester with modeling and some additional topics

9/30/04© University of Wisconsin, CS559 Fall 2004 Graphics Toolkits Graphics toolkits typically take care of the details of producing images from geometry Input (via API functions): –Where the objects are located and what they look like –Where the camera is and how it behaves –Parameters for controlling the rendering Functions (via API): –Perform well defined operations based on the input environment Output: Pixel data in a framebuffer – an image in a special part of memory –Data can be put on the screen –Data can be read back for processing (part of toolkit)

9/30/04© University of Wisconsin, CS559 Fall 2004 OpenGL OpenGL is an open standard graphics toolkit –Derived from SGI’s GL toolkit Provides a range of functions for modeling, rendering and manipulating the framebuffer What makes a good toolkit? Alternatives: Direct3D, Java3D - more complex and less well supported

9/30/04© University of Wisconsin, CS559 Fall 2004 A Good Toolkit… Everything is a trade-off Functionality –Compact: a minimalist set of commands –Orthogonal: commands do different things and can be combined in a consistent way –Speed Ease-of-Use and Documentation Portability Extensibility Standards and ownership Not an exhaustive list …

9/30/04© University of Wisconsin, CS559 Fall 2004 Coordinate Systems The use of coordinate systems is fundamental to computer graphics Coordinate systems are used to describe the locations of points in space, and directions in space Multiple coordinate systems make graphics algorithms easier to understand and implement

9/30/04© University of Wisconsin, CS559 Fall 2004 Coordinate Systems (2) Different coordinate systems represent the same point in different ways Some operations are easier in one coordinate system than in another –For instance, it’s easier to determine what you can see if one axis of your coordinate system points away from you x y (2,3) u v x y (1,2) u v

9/30/04© University of Wisconsin, CS559 Fall 2004 Transformations Transformations convert points between coordinate systems x y (2,3) v x y (1,2) u v u u=x-1 v=y-1 x=u+1 y=v+1

9/30/04© University of Wisconsin, CS559 Fall 2004 Transformations (Alternate Interpretation) Transformations modify an object’s shape and location in one coordinate system The previous interpretation is better for some problems, this one is better for others x y (2,3) (1,2) x y x’=x-1 y’=y-1 x=x’+1 y=y’+1

9/30/04© University of Wisconsin, CS559 Fall D Affine Transformations An affine transformation is one that can be written in the form:

9/30/04© University of Wisconsin, CS559 Fall 2004 Why Affine Transformations? Affine transformations are linear –Transforming all the individual points on a line gives the same set of points as transforming the endpoints and joining them –Interpolation is the same in either space: Find the halfway point in one space, and transform it. Will get the same result if the endpoints are transformed and then find the halfway point

9/30/04© University of Wisconsin, CS559 Fall 2004 Composition of Affine Transforms Any affine transformation can be composed as a sequence of simple transformations: –Translation –Scaling (possibly with negative values) –Rotation See Shirley 1.3.6

9/30/04© University of Wisconsin, CS559 Fall D Translation Moves an object x y x y bxbx byby

9/30/04© University of Wisconsin, CS559 Fall D Translation Moves an object x y x y bxbx byby

9/30/04© University of Wisconsin, CS559 Fall D Scaling Resizes an object in each dimension x y x y x y sxxsxx syysyy

9/30/04© University of Wisconsin, CS559 Fall D Scaling Resizes an object in each dimension x y x y x y sxxsxx syysyy

9/30/04© University of Wisconsin, CS559 Fall D Rotation Rotate counter-clockwise about the origin by an angle  x y x y 

9/30/04© University of Wisconsin, CS559 Fall D Rotation Rotate counter-clockwise about the origin by an angle  x y x y 

9/30/04© University of Wisconsin, CS559 Fall 2004 X-Axis Shear Shear along x axis (What is the matrix for y axis shear?) x y x y

9/30/04© University of Wisconsin, CS559 Fall 2004 X-Axis Shear Shear along x axis (What is the matrix for y axis shear?) x y x y

9/30/04© University of Wisconsin, CS559 Fall 2004 Reflect About X Axis What is the matrix for reflect about Y axis? x x

9/30/04© University of Wisconsin, CS559 Fall 2004 Reflect About X Axis What is the matrix for reflect about Y axis? x x

9/30/04© University of Wisconsin, CS559 Fall 2004 Next time More complicated transformations Homogeneous coordinates