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.

Slides:



Advertisements
Similar presentations
Compositing and Blending Ed Angel Professor Emeritus of Computer Science University of New Mexico 1 E. Angel and D. Shreiner: Interactive Computer Graphics.
Advertisements

Image Data Representations and Standards
Computational Biology, Part 23 Biological Imaging II Robert F. Murphy Copyright  1996, 1999, All rights reserved.
Week 7 - Monday.  What did we talk about last time?  Specular shading  Aliasing and antialiasing.
Point Processing Image Arithmetic. Arithmetic Image Operations (blending) 2  Two source images can be added, multiplied, one subtracted from the other.
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.
Compositing and Blending Mohan Sridharan Based on slides created by Edward Angel 1 CS4395: Computer Graphics.
Compositing and Blending - Chapter 8 modified by Ray Wisman Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Image Compositing Angel 8.11 Angel: Interactive Computer Graphics5E © Addison-Wesley
Advanced Computer Graphics CSE 190 [Spring 2015], Lecture 5 Ravi Ramamoorthi
Image Compositing and Matting. Introduction Matting and compositing are important operations in the production of special effects. These techniques enable.
Prof. Harriet Fell Fall 2012 Lecture 7 – September 19, 2012
School of Computing Science Simon Fraser University
1Notes. 2Atop  The simplest (useful) and most common form of compositing: put one image “atop” another  Image 1 (RGB) on top of image 2 (RGB)  For.
Advanced Computer Graphics (Spring 2005) COMS 4162, Lecture 6: Image Compositing, Morphing Ravi Ramamoorthi
Graphics and Still Images John H. Krantz Hanover College.
1 King ABDUL AZIZ University Faculty Of Computing and Information Technology CS 454 Computer graphicsIntroduction Dr. Eng. Farag Elnagahy
2.01 Understand Digital Raster Graphics
Introduction to Computer Graphics
Vector vs. Bitmap SciVis V
Color of (digital image) Raed S. Rasheed Agenda Color. Color Image. Color Models – RGB color model. – CMYK color model. – HSV and HSL color model.
V Obtained from a summer workshop in Guildford County July, 2014
02/12/02 (c) 2002 University of Wisconsin, CS 559 Filters A filter is something that attenuates or enhances particular frequencies Easiest to visualize.
Data starts with width and height of image Then an array of pixel values (colors) The number of elements in this array is width times height Colors can.
Colour Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman
Digital Images The digital representation of visual information.
COMP Bitmapped and Vector Graphics Pages Using Qwizdom.
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.
Vector vs. Bitmap
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 14 Introduction to Computer Graphics.
CS559: Computer Graphics Lecture 6: Edge Detection, Image Compositing, and Warping Li Zhang Spring 2010.
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
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.
Multimedia Elements: Sound, Animation, and Video.
1 Ethics of Computing MONT 113G, Spring 2012 Session 10 HTML Tables Graphics on the Web.
Digital Image Processing CCS331 Relationships of Pixel 1.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
Real-Time rendering Chapter 4.Visual Appearance 4.4. Aliasing and antialiasing 4.5. Transparency,alpha,and compositing 4.6. Fog 4.7. Gamma correction
Digital Image Compositing. Compositing for volume rendering c1 c2 c3 The initial pixel color = Black opaque Back-to-Front compositing: use ‘under’ operator.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Digital Media Dr. Jim Rowan ITEC Up Next! In the next several lectures we will be covering these topics: –Vector graphics –Bitmapped graphics –Color.
Lecture 7: Intro to Computer Graphics. Remember…… DIGITAL - Digital means discrete. DIGITAL - Digital means discrete. Digital representation is comprised.
CS559: Computer Graphics Lecture 4: Compositing and Resampling Li Zhang Spring 2008.
DIGITAL IMAGE. Basic Image Concepts An image is a spatial representation of an object An image can be thought of as a function with resulting values of.
Compositing and Blending
Computer Graphics Blending CO2409 Computer Graphics Week 14.
9/30/04© University of Wisconsin, CS559 Fall 2004 Last Time Reconstruction Aliasing Compositing Intro.
02/05/2002 (C) University of Wisconsin 2002, CS 559 Last Time Color Quantization Mach Banding –Humans exaggerate sharp boundaries, but not fuzzy ones.
The Digital Revolution Changing information. What is Digital?  Discrete values used for  Input  Processing  Transmission  Storage  Display  Derived.
Graphics Graphics Korea University cgvr.korea.ac.kr Image Processing 고려대학교 컴퓨터 그래픽스 연구실.
UniS CS297 Graphics with Java and OpenGL Blending.
(c) 2002 University of Wisconsin, CS 559
CS559: Computer Graphics Lecture 7: Image Warping and Morphing Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
Graphics and Image Data Representations 1. Q1 How images are represented in a computer system? 2.
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.
Guilford County SciVis V104.03
Compositing and Blending Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
Computer Graphics CC416 Lecture 04: Bresenham Line Algorithm & Mid-point circle algorithm Dr. Manal Helal – Fall 2014.
Computer Graphics I, Fall 2008 Compositing and Blending.
Vector vs. Bitmap. Vector Images Vector images (also called outline images) are images made with lines, text, and shapes. Test type is considered to be.
Introduction to Computer Graphics with WebGL
Vector vs. Bitmap.
Advanced Computer Graphics
Hank Childs, University of Oregon
Computer Vision Lecture 4: Color
© University of Wisconsin, CS559 Spring 2004
(c) 2002 University of Wisconsin, CS 559
Last Time Dithering Introduction to signal processing Filtering
Filtering Images Work in the spatial domain
Computer Graphics Image processing 紀明德
Presentation transcript:

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 a filter at that location, and do the weighted sum of neighboring pixels –Place the filter value in the output image

02/14/02(c) University of Wisconsin 2002, CS 559 Today Enlarging Images Morphing Compositing Project 1: Image Editing Software

02/14/02(c) University of Wisconsin 2002, CS 559 Enlarging Images Warp function: f(x)=kx, k < 1 Problem: Have to create pixel data –More pixels in output than in input Solution: Filter up to larger size –Apply the filter at intermediate pixel locations –eg: To get double image size, apply filter at every pixel and every half pixel New pixels are interpolated from old ones –Filter encodes interpolation function –May want to edge-enhance images after enlarging

02/14/02(c) University of Wisconsin 2002, CS 559 Enlargement

02/14/02(c) University of Wisconsin 2002, CS 559 Ideal Enlargement Reconstruct original function Resample at higher frequency Original function was band-limited, so re-sampling does not add any extra frequency information

02/14/02(c) University of Wisconsin 2002, CS 559 Image Morphing Process to turn one image into another –Also the basis for video effects like cross-dissolve Define path from each point in the original image to its destination in the output image –Color may change along path –Many ways to define paths Animate points along paths –At each time increment, step pixels along their paths and interpolate their colors –Resample the result to get a regular image

02/14/02(c) University of Wisconsin 2002, CS 559 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 each channel separately may change color significantly –Adjusting intensity while keeping hue and saturation may be best, although some loss of saturation is probably OK

02/14/02(c) University of Wisconsin 2002, CS 559 Compositing Compositing combines components from two or more images to make a new image The basis for film special effects (even before computers) –Create digital imagery and composite it into live action Important part of animation – even hand animation –Background change more slowly than foregrounds, so composite foreground elements onto constant background

02/14/02(c) University of Wisconsin 2002, CS 559 Very Simple Example over =

02/14/02(c) University of Wisconsin 2002, CS 559 Mattes A matte is an image that shows which parts of another image are foreground objects Term dates from film editing and cartoon production How would I use a matte to insert an object into a background? How are mattes usually generated for television?

02/14/02(c) University of Wisconsin 2002, CS 559 Working with Mattes To insert an object into a background –Call the image of the object the source –Put the background into the destination –For all the source pixels, if the matte is white, copy the pixel, otherwise leave it unchanged To generate mattes: –Use smart selection tools in Photoshop or similar They outline the object and convert the outline to a matte –Blue Screen: Photograph/film the object in front of a blue background, then consider all the blue pixels in the image to be the background

02/14/02(c) University of Wisconsin 2002, CS 559 Alpha Basic idea: Encode opacity information in the image Add an extra channel, the alpha channel, to each image –For each pixel, store R, G, B and Alpha –alpha = 1 implies full opacity at a pixel –alpha = 0 implies completely clear pixels Images are now in RGBA format, and typically 32 bits per pixel (8 bits for alpha)

02/14/02(c) University of Wisconsin 2002, CS 559 Smoothing Edges Reduce alpha gradually at edges to smooth them

02/14/02(c) University of Wisconsin 2002, CS 559 Pre-Multiplied Alpha Instead of storing (R,G,B,  ), store (  R,  G,  B,  ) The compositing operations in the next several slides are easier with pre-multiplied alpha To display and do color conversions, must extract RGB by dividing out  –  =0 is always black –Some loss of precision as  gets small, but generally not a problem

02/14/02(c) University of Wisconsin 2002, CS 559 Combining Images and Alpha If the image is of a translucent object, then  represents the amount of the background that is blocked If combining two translucent objects: –(1-  a )(1-  b ) of the background shows through both –  a (1-  b ) passes through B but is blocked by A –  b (1-  a ) passes through A but is blocked by B –  a  b of the background is blocked by both Assume a pixel represents the color of a small area –Typically a square, but not necessarily Interpret  to represent the fraction of the pixel area covered by an object –We’ll see ways of deciding how much background shows through when images are combined

02/14/02(c) University of Wisconsin 2002, CS 559 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

02/14/02(c) University of Wisconsin 2002, CS 559 Image Decomposition The composite image can be broken into regions –Parts covered by f only –Parts covered by g only –Parts covered by f and g –Parts covered by neither f nor g Same goes for sub-pixels in places where  1

02/14/02(c) University of Wisconsin 2002, CS 559 Basic Compositing Operation The different compositing operations define which image “wins” in each sub-region of the composite 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

02/14/02(c) University of Wisconsin 2002, CS 559 Sample Images Image Alpha

02/14/02(c) University of Wisconsin 2002, CS 559 “Over” Operator

02/14/02(c) University of Wisconsin 2002, CS 559 “Over” Operator Computes composite with the rule that f covers g

02/14/02(c) University of Wisconsin 2002, CS 559 “Inside” Operator

02/14/02(c) University of Wisconsin 2002, CS 559 “Inside” Operator Computes composite with the rule that only parts of f that are inside g contribute

02/14/02(c) University of Wisconsin 2002, CS 559 “Outside” Operator

02/14/02(c) University of Wisconsin 2002, CS 559 “Outside” Operator Computes composite with the rule that only parts of f that are outside g contribute

02/14/02(c) University of Wisconsin 2002, CS 559 “Atop” Operator

02/14/02(c) University of Wisconsin 2002, CS 559 “Atop” Operator Computes composite with the over rule but restricted to places where there is some g

02/14/02(c) University of Wisconsin 2002, CS 559 “Xor” Operator Computes composite with the rule that f contributes where there is no g, and g contributes where there is no f

02/14/02(c) University of Wisconsin 2002, CS 559 “Xor” Operator

02/14/02(c) University of Wisconsin 2002, CS 559 “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

02/14/02(c) University of Wisconsin 2002, CS 559 “Set” Operator Computes composite by setting it to equal f Copies f into the composite

02/14/02(c) University of Wisconsin 2002, CS 559 Unary Operators Darken: Makes an image darker (or lighter) without affecting its opacity Dissolve: Makes an image transparent without affecting its color

02/14/02(c) University of Wisconsin 2002, CS 559 “PLUS” Operator Computes composite by simply adding f and g, with no overlap rules Useful for defining cross-dissolve in terms of compositing:

02/14/02(c) University of Wisconsin 2002, CS 559 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 is common –Why blue?

02/14/02(c) University of Wisconsin 2002, CS 559 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