Image Compositing Angel 8.11 Angel: Interactive Computer Graphics5E © Addison-Wesley 2009 1.
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Marching Squares Ed Angel Professor...
-
Upload
eustacia-goodwin -
Category
Documents
-
view
215 -
download
1
Transcript of 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Marching Squares Ed Angel Professor...
![Page 1: 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Marching Squares Ed Angel Professor of Computer Science, Electrical and Computer Engineering,](https://reader036.fdocuments.in/reader036/viewer/2022082818/56649ed45503460f94be4d76/html5/thumbnails/1.jpg)
1Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
Marching Squares
Ed Angel
Professor of Computer Science, Electrical and Computer
Engineering, and Media Arts
University of New Mexico
![Page 2: 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Marching Squares Ed Angel Professor of Computer Science, Electrical and Computer Engineering,](https://reader036.fdocuments.in/reader036/viewer/2022082818/56649ed45503460f94be4d76/html5/thumbnails/2.jpg)
2Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
Objectives
•Nontrivial two-dimensional application• Important method for
Contour plots Implicit function visualization
•Extends to important method for volume visualization
•This lecture is optional•Material not needed to continue to Chapter 3
![Page 3: 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Marching Squares Ed Angel Professor of Computer Science, Electrical and Computer Engineering,](https://reader036.fdocuments.in/reader036/viewer/2022082818/56649ed45503460f94be4d76/html5/thumbnails/3.jpg)
3Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
Displaying Implicit Functions
•Consider the implicit function
g(x,y)=0
•Given an x, we cannot in general find a corresponding y
•Given an x and a y, we can test if they are on the curve
![Page 4: 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Marching Squares Ed Angel Professor of Computer Science, Electrical and Computer Engineering,](https://reader036.fdocuments.in/reader036/viewer/2022082818/56649ed45503460f94be4d76/html5/thumbnails/4.jpg)
4Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
Height Fields and Contours
• In many applications, we have the heights given by a function of the form z=f(x,y)
•To find all the points that have a given height c, we have to solve the implicit equation g(x,y)=f(x,y)-c=0
•Such a function determines the isosurfaces or contours of f for the isosurface value c
![Page 5: 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Marching Squares Ed Angel Professor of Computer Science, Electrical and Computer Engineering,](https://reader036.fdocuments.in/reader036/viewer/2022082818/56649ed45503460f94be4d76/html5/thumbnails/5.jpg)
5Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
Marching Squares
• Displays isocurves or contours for functions f(x,y) = t
• Sample f(x,y) on a regular grid yielding samples {fij(x,y)}
• These samples can be greater than, less than, or equal to t
• Consider four samples fij(x,y), fi+1,j(x,y), fi+1,j+1(x,y), fi,j+1(x,y)
• These samples correspond to the corners of a cell
• Color the corners by whether than exceed or are less than the contour value t
![Page 6: 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Marching Squares Ed Angel Professor of Computer Science, Electrical and Computer Engineering,](https://reader036.fdocuments.in/reader036/viewer/2022082818/56649ed45503460f94be4d76/html5/thumbnails/6.jpg)
6Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
Cells and Coloring
![Page 7: 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Marching Squares Ed Angel Professor of Computer Science, Electrical and Computer Engineering,](https://reader036.fdocuments.in/reader036/viewer/2022082818/56649ed45503460f94be4d76/html5/thumbnails/7.jpg)
7Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
Occum’s Razor
•Contour must intersect edge between a black and white vertex an odd number of times
•Pick simplest interpretation: one crossing
![Page 8: 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Marching Squares Ed Angel Professor of Computer Science, Electrical and Computer Engineering,](https://reader036.fdocuments.in/reader036/viewer/2022082818/56649ed45503460f94be4d76/html5/thumbnails/8.jpg)
8Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
16 Cases
![Page 9: 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Marching Squares Ed Angel Professor of Computer Science, Electrical and Computer Engineering,](https://reader036.fdocuments.in/reader036/viewer/2022082818/56649ed45503460f94be4d76/html5/thumbnails/9.jpg)
9Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
Unique Cases
•Taking out rotational and color swapping symmetries leaves four unique cases
•First three have a simple interpretation
![Page 10: 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Marching Squares Ed Angel Professor of Computer Science, Electrical and Computer Engineering,](https://reader036.fdocuments.in/reader036/viewer/2022082818/56649ed45503460f94be4d76/html5/thumbnails/10.jpg)
10Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
Ambiguity Problem
•Diagonally opposite cases have two equally simple possible interpretations
![Page 11: 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Marching Squares Ed Angel Professor of Computer Science, Electrical and Computer Engineering,](https://reader036.fdocuments.in/reader036/viewer/2022082818/56649ed45503460f94be4d76/html5/thumbnails/11.jpg)
11Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
Ambiguity Example
•Two different possibilities below•More possibilities on next slide
![Page 12: 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Marching Squares Ed Angel Professor of Computer Science, Electrical and Computer Engineering,](https://reader036.fdocuments.in/reader036/viewer/2022082818/56649ed45503460f94be4d76/html5/thumbnails/12.jpg)
12Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
Ambiguity Problem
![Page 13: 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Marching Squares Ed Angel Professor of Computer Science, Electrical and Computer Engineering,](https://reader036.fdocuments.in/reader036/viewer/2022082818/56649ed45503460f94be4d76/html5/thumbnails/13.jpg)
13Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
Is Problem Resolvable?
• Problem is a sampling problem Not enough samples to know the local detail
No solution in a mathematical sense without extra information
• More of a problem with volume extension (marching cubes) where selecting “wrong” interpretation can leave a hole in a surface
• Multiple methods in literature to give better appearance
Supersampling
Look at larger area before deciding
![Page 14: 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Marching Squares Ed Angel Professor of Computer Science, Electrical and Computer Engineering,](https://reader036.fdocuments.in/reader036/viewer/2022082818/56649ed45503460f94be4d76/html5/thumbnails/14.jpg)
14Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
Interpolating Edges
•We can compute where contour intersects edge in multiple ways
Halfway between vertics
Interpolated based on difference between contour value and value at vertices
![Page 15: 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Marching Squares Ed Angel Professor of Computer Science, Electrical and Computer Engineering,](https://reader036.fdocuments.in/reader036/viewer/2022082818/56649ed45503460f94be4d76/html5/thumbnails/15.jpg)
15Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
Example: Oval of Cassini
f(x,y)=(x2+y2+a2)2-4a2x2-b4
midpoint intersections
interpolating intersections
Depending on a and b we can have 0, 1, or 2 curves
![Page 16: 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Marching Squares Ed Angel Professor of Computer Science, Electrical and Computer Engineering,](https://reader036.fdocuments.in/reader036/viewer/2022082818/56649ed45503460f94be4d76/html5/thumbnails/16.jpg)
16Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
Contour Map
• Diamond Head, Oahu Hawaii
• Shows contours for many contour values
![Page 17: 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Marching Squares Ed Angel Professor of Computer Science, Electrical and Computer Engineering,](https://reader036.fdocuments.in/reader036/viewer/2022082818/56649ed45503460f94be4d76/html5/thumbnails/17.jpg)
17Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
Marching Cubes
• Isosurface: solution of g(x,y,z)=c•Same argument to derive method but use cubic cell (8 vertices, 256 colorings)
•Standard method of volume visualization •Suggested by Lorensen and Kline before marching squares