DOC PREVIEW
MIT 6 837 - Lecture Notes

This preview shows page 1-2-3-18-19-36-37-38 out of 38 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 38 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 38 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 38 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 38 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 38 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 38 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 38 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 38 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 38 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

mit.eduLecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01wLecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '01Lecture 3 --- 6.837 Fall '016.837 LECTURE 31.Topics in Imaging2. No Slide3. No Slide 4. No Slide5.Area Fill Algorithms?6.Parity Fill7.Winding Number8.Boundary Fills9.Let's Watch it in Action10.Serial Recursion is Depth-First11.At Full Speed12.A Flood-Fill13.Flood-Fill in Action14.Self-Starting Fast Flood-Fill Algorithm15.Fill East16.Working Algorithm17.4-Way adn 8-Way Connectedness18.Code for an 8-Way Connected Flood Fill19.More 8-Way Connectedness20.Flood-Fill Embellishments21.Monochrome and Color Dithering21a.Classical Halftoning21b.Halftoning with Pixel Patterns22.When do we need dithering?23.Quantization and Thresholding24.The Secret... Noise25.Dither Noise Patterns26.Ordered Dither27.Error Diffusion28.Lossy Image Compression29.LZW Compression29a.LZW Compression30.Transform Coding31.DCT example31aDCT examples31b.DCT examples31c.DCT examples31d.DCT examples32.Next Time Lecture 3 Outline 6.837 Fall '01Lecture 3 --- 6.837 Fall '01http://www.graphics.lcs.mit.edu/classes/6.837/F01/Lecture03/index.html [9/13/2001 6:42:31 PM]Topics in ImagingA wee bit ofrecursionFilling AlgorithmsDitheringDCTs Lecture 3 Slide 1 6.837 Fall '01Lecture 3 --- 6.837 Fall '01http://www.graphics.lcs.mit.edu/classes/6.837/F01/Lecture03/Slide01.html [9/13/2001 6:43:15 PM]Area Fill Algorithms?Used to fill regions after their boundary or contour has beendetermined.● Handles Irregular boundaries ● Supports freehand drawings● Deferred fills for speed (only fill visible parts)● Allows us to recolor primitives● Can be adapted for other uses (selecting regions) ● Unaware of any other primitivespreviously drawn.● Later we'll discuss filling areasduring rasterization● Lecture 3 Slide 5 6.837 Fall '01Lecture 3 --- 6.837 Fall '01http://www.graphics.lcs.mit.edu/classes/6.837/F01/Lecture03/Slide05.html [9/13/2001 6:43:19 PM]Parity FillProblem:For each pixel determine if it is inside or outside of a given polygon.Approach:from the point being tested cast a ray in an arbitary direction● if the number of crossings is odd then the point is inside● if the number of crossings is even then the point is outside● Very fragile algorithm● What if ray crosses a vertex?● What if ray falls on an edge?● Commonly used in ECAD● Suitable for H/W● Lecture 3 Slide 6 6.837 Fall '01Lecture 3 --- 6.837 Fall '01http://www.graphics.lcs.mit.edu/classes/6.837/F01/Lecture03/Slide06.html [9/13/2001 6:43:21 PM]Winding NumberImagine yourself watching a point traverse the boundary of the polygon in acounter-clockwise direction and pivoting so that you are always facing at it.Your winding number is the number of full revolutions that you complete.If you winding number is 0 then you are outside of the polygon, otherwise you are inside.Lecture 3 Slide 7 6.837 Fall '01Lecture 3 --- 6.837 Fall '01http://www.graphics.lcs.mit.edu/classes/6.837/F01/Lecture03/Slide07.html [9/13/2001 6:43:28 PM]Boundary FillsBoundary fills start from a point known to be inside of a regionand fill the region until a boundry is found.A simple recursive algorithm can be used: public void boundaryFill(int x, int y, int fill, intboundary) { if ((x < 0) || (x >= width)) return; if ((y < 0) || (y >= height)) return; int current = raster.getPixel(x, y); if ((current != boundary) && (current != fill)) { raster.setPixel(fill, x, y); boundaryFill(x+1, y, fill, boundary); boundaryFill(x, y+1, fill, boundary); boundaryFill(x-1, y, fill, boundary); boundaryFill(x, y-1, fill, boundary); } } Lecture 3 Slide 8 6.837 Fall '01Lecture 3 --- 6.837 Fall '01http://www.graphics.lcs.mit.edu/classes/6.837/F01/Lecture03/Slide08.html [9/13/2001 6:43:30 PM]Let's Watch it in ActionFirst, you should guess how you expect the algorithm to behave. Thenselect a point on the figure's interior. Did the algorithm act as youexpected?Lecture 3 Slide 9 6.837 Fall '01Lecture 3 --- 6.837 Fall '01http://www.graphics.lcs.mit.edu/classes/6.837/F01/Lecture03/Slide09.html [9/13/2001 6:43:32 PM]Serial Recursion is Depth-FirstSo the fill algorithm will continuein one direction until a boundary isreached.It will then change directionsmomentarily and attempt tocontinue back in the originaldirection.Will parallel execution of thealgorithm behave the same way?Lecture 3 Slide 10 6.837 Fall '01Lecture 3 --- 6.837 Fall '01http://www.graphics.lcs.mit.edu/classes/6.837/F01/Lecture03/Slide10.html [9/13/2001 6:43:35 PM]At Full SpeedTo the right is the same algorithm operating at full speed.Left-button click inside one of the regions to start the fill process. Click the right button toreset the image to its original stateLecture 3 Slide 11 6.837 Fall '01Lecture 3 --- 6.837 Fall '01http://www.graphics.lcs.mit.edu/classes/6.837/F01/Lecture03/Slide11.html [9/13/2001 6:43:37 PM]A Flood-FillSometimes we'd like a area fill algorithm that replaces all connected pixels of a selectedcolor with a fill color. The flood-fill algorithm does exactly that. public void floodFill(int x, int y, int fill, intold) { if ((x < 0) || (x >= width)) return; if ((y < 0) || (y >= height)) return; if (raster.getPixel(x, y) == old) { raster.setPixel(fill, x, y);


View Full Document

MIT 6 837 - Lecture Notes

Documents in this Course
Shadows

Shadows

64 pages

Animation

Animation

37 pages

Radiosity

Radiosity

25 pages

Color

Color

86 pages

InterArch

InterArch

14 pages

Color

Color

15 pages

Animation

Animation

61 pages

Luxo Jr

Luxo Jr

14 pages

Animation

Animation

52 pages

Radiosity

Radiosity

37 pages

Load more
Download Lecture Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture Notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?