cs 551 / cs 645 antialiasing. what is a pixel? a pixel is not… –a box –a disk –a teeny tiny...
TRANSCRIPT
![Page 1: 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](https://reader030.vdocuments.net/reader030/viewer/2022032722/56649cec5503460f949b8c1c/html5/thumbnails/1.jpg)
CS 551 / CS 645
Antialiasing
![Page 2: 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](https://reader030.vdocuments.net/reader030/viewer/2022032722/56649cec5503460f949b8c1c/html5/thumbnails/2.jpg)
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 no area– It cannot be seen– It can have a coordinate
A pixel is more than a point, it is a sample
![Page 3: 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](https://reader030.vdocuments.net/reader030/viewer/2022032722/56649cec5503460f949b8c1c/html5/thumbnails/3.jpg)
Samples
• Most things in the real world are continuous• Everything in a computer is discrete• The process of mapping a continuous function
to a discrete one is called sampling• The process of mapping a continuous variable
to a discrete one is called quantization• Rendering an image requires sampling and
quantization
![Page 4: 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](https://reader030.vdocuments.net/reader030/viewer/2022032722/56649cec5503460f949b8c1c/html5/thumbnails/4.jpg)
Line Segments
• We tried to sample a line segment so it would map to a 2D raster display
• We quantized the pixel values to 0 or 1
• We saw stair steps, or jaggies
![Page 5: 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](https://reader030.vdocuments.net/reader030/viewer/2022032722/56649cec5503460f949b8c1c/html5/thumbnails/5.jpg)
Line Segments
• Instead, quantize to many shades
• But what sampling algorithms is used?
![Page 6: 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](https://reader030.vdocuments.net/reader030/viewer/2022032722/56649cec5503460f949b8c1c/html5/thumbnails/6.jpg)
Area Sampling• Shade pixels according to the area covered by
thickened line
• This is unweighted area sampling
• A rough approximation formulated by dividing each pixel into a finer grid of pixels
![Page 7: 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](https://reader030.vdocuments.net/reader030/viewer/2022032722/56649cec5503460f949b8c1c/html5/thumbnails/7.jpg)
Unweighted Area Sampling
• Pixel intensity decreases as distance betewen the pixel center and edge increases
• Primitive cannot affect intensity of pixel if it does no intersect the pixel
• Equal areas cause equal intensity, regardless of distance from pixel center to area
![Page 8: 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](https://reader030.vdocuments.net/reader030/viewer/2022032722/56649cec5503460f949b8c1c/html5/thumbnails/8.jpg)
Weighted Area Sampling
• Unweighted sampling colors two pixels identically when the primitive cuts the same area through the two pixels
• Intuitively, pixel cut through the center should be more heavily weighted than one cut along corner
![Page 9: 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](https://reader030.vdocuments.net/reader030/viewer/2022032722/56649cec5503460f949b8c1c/html5/thumbnails/9.jpg)
Weighted Area Sampling
• Weighting function, W(x,y)– specifies the contribution of primitive passing
through the point (x, y) from pixel center
x
IntensityW(x,y)
![Page 10: 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](https://reader030.vdocuments.net/reader030/viewer/2022032722/56649cec5503460f949b8c1c/html5/thumbnails/10.jpg)
Images
• An image is a 2D function I(x, y) that specifies intensity for each point (x, y)
![Page 11: 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](https://reader030.vdocuments.net/reader030/viewer/2022032722/56649cec5503460f949b8c1c/html5/thumbnails/11.jpg)
Sampling and Image
• Our goal is to convert the continuous image to a discrete set of samples
• The graphics system’s display hardware will attempt to reconvert the samples into a continuous image: reconstruction
![Page 12: 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](https://reader030.vdocuments.net/reader030/viewer/2022032722/56649cec5503460f949b8c1c/html5/thumbnails/12.jpg)
Point Sampling an Image
• Simplest sampling is on a grid
• Sample dependssolely on valueat grid points
![Page 13: 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](https://reader030.vdocuments.net/reader030/viewer/2022032722/56649cec5503460f949b8c1c/html5/thumbnails/13.jpg)
Point Sampling
• Multiply sample grid by image intensity to obtain a discrete set of points, or samples.
Sampling Geometry
![Page 14: 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](https://reader030.vdocuments.net/reader030/viewer/2022032722/56649cec5503460f949b8c1c/html5/thumbnails/14.jpg)
• Some objects missed entirely, others poorly sampled
Sampling Errors
![Page 15: 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](https://reader030.vdocuments.net/reader030/viewer/2022032722/56649cec5503460f949b8c1c/html5/thumbnails/15.jpg)
Fixing Sampling Errors
• Supersampling– Take more than one sample for each pixel
and combine them• How many samples is enough?• How do we know no features are lost?
![Page 16: 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](https://reader030.vdocuments.net/reader030/viewer/2022032722/56649cec5503460f949b8c1c/html5/thumbnails/16.jpg)
Unweighted Area Sampling
• Average supersampled points
• All points are weighted equally
![Page 17: 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](https://reader030.vdocuments.net/reader030/viewer/2022032722/56649cec5503460f949b8c1c/html5/thumbnails/17.jpg)
Weighted Area Sampling
• Points in pixel are weighted differently– Flickering occurs as object moves
across display
• Overlapping regions eliminates flicker
![Page 18: 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](https://reader030.vdocuments.net/reader030/viewer/2022032722/56649cec5503460f949b8c1c/html5/thumbnails/18.jpg)
Frequency Domain
• Fourier Transform– Convert signal, f(x), from spatial domain to
frequency domain, F (u)– F (u) indicates how much of u frequency is
in image
![Page 19: 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](https://reader030.vdocuments.net/reader030/viewer/2022032722/56649cec5503460f949b8c1c/html5/thumbnails/19.jpg)
Sampling in the Frequency Domain
• Remember, sampling was defined as multiplying a grid of delta functions by the continuous image
• This is called a convolution in frequency domain
The sampling grid
The function beingsampled
![Page 20: 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](https://reader030.vdocuments.net/reader030/viewer/2022032722/56649cec5503460f949b8c1c/html5/thumbnails/20.jpg)
Convolution
• This amounts to accumulating copies of the function’s spectrum sampled at the delta functions of the sampling grid
![Page 21: 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](https://reader030.vdocuments.net/reader030/viewer/2022032722/56649cec5503460f949b8c1c/html5/thumbnails/21.jpg)
Nyquist Rate
• The lower bound on an image’s sample rate is the Nyquist Rate
• The Nyquist rate is twice the highest frequency component in the spectrum
• Actually, sampling greater than Nyquist is usually required– Draw special case
![Page 22: 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](https://reader030.vdocuments.net/reader030/viewer/2022032722/56649cec5503460f949b8c1c/html5/thumbnails/22.jpg)
Aliasing
• Sampling below Nyquist rate can result in loss of high-frequencies– Draw picture
• May also result in adding high frequency– Texture map of brick wall (seen on DVD’s)
![Page 23: 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](https://reader030.vdocuments.net/reader030/viewer/2022032722/56649cec5503460f949b8c1c/html5/thumbnails/23.jpg)
Filtering
• To lower Nyquist rate, remove high frequencies from image: low-pass filter– Only low frequencies remain
• Sinc function is common filter:– sinc(x) = sin (x)/x
Spatial Domain Frequency Domain
![Page 24: 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](https://reader030.vdocuments.net/reader030/viewer/2022032722/56649cec5503460f949b8c1c/html5/thumbnails/24.jpg)
Sinc function
• Value of 1 at sample point and 0 at other integer values
• Exactly matches values at sample points
• But has infinite extent
• But has negative values
• But assumes sample repeats infinitely
• Truncated version introduces high frequencies again
![Page 25: 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](https://reader030.vdocuments.net/reader030/viewer/2022032722/56649cec5503460f949b8c1c/html5/thumbnails/25.jpg)
Bilinear Filter
• Sometimes called a tent filter
• Easy to compute– just linearly interpolate between samples
• Finite extent and no negative values
• Still has artifacts
![Page 26: 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](https://reader030.vdocuments.net/reader030/viewer/2022032722/56649cec5503460f949b8c1c/html5/thumbnails/26.jpg)
Supersampling Techniques
• Adaptive supersampling– store more points when necesssary
• Stochastic supersampling– Place sample points at stochastically
determined points• Eye has harder time detecting aliasing when
combined with the noise generated by stochastics