Presentation is loading. Please wait.

Presentation is loading. Please wait.

Aliasing and Anti-Aliasing Copyright Zachary Wartell, University of North Carolina at Charlotte, All Rights Reserved Revision: 10/24/2007 3:38:00 AM ©Zachary.

Similar presentations


Presentation on theme: "Aliasing and Anti-Aliasing Copyright Zachary Wartell, University of North Carolina at Charlotte, All Rights Reserved Revision: 10/24/2007 3:38:00 AM ©Zachary."— Presentation transcript:

1 Aliasing and Anti-Aliasing Copyright Zachary Wartell, University of North Carolina at Charlotte, All Rights Reserved Revision: 10/24/2007 3:38:00 AM ©Zachary Wartell - 1/26/2005

2 Describe what you see! (Hint) Example A Example B ©Zachary Wartell - 1/26/2005

3 Reconstructed Signal (Low Frequency) Describe what you see! Sampling (Lower Frequency) Signal (High Frequency) Reconstruction Reconstructed Signal (Low Frequency) Example A Example B Reconstruction Reconstructed Signal (Low freq.) Sampling (Lower Frequency) Signal (High Frequency) ©Zachary Wartell - 1/26/2005

4 Describe what you see! Sampling (Lower Frequency) Signal (High Frequency) Reconstruction Reconstructed Signal (Low Frequency) Example A Aliasing = a high frequency signal masquarading as a low frequency signal due to a poor sampling frequency. ©Zachary Wartell - 1/26/2005

5 position intensity Recall: frequency, cycle/wavelength Δx cycle A

6 What is a “poor sampling frequency”? Nyquist Sampling Frequency: f s = 2 f max Δx s = Δx cycle / 2 f s : Nyquist Sampling Frequency f max : maximum frequency component in signal Δx s : Nyquist Sampling Interval Δx cycle : Cycle interval “To avoid losing information we need to set sampling frequency to at least twice the highest frequency component of signal.” ©Zachary Wartell - 1/26/2005

7 TADA! highest freq. comp. of S( x ) Example of highest frequency component ● What is highest frequency component of this signal, S( x )? ● What if I tell you the equation is: Sin[x (2 Pi /10)] + Sin[x (2 Pi / 1)]*0.25 = + f = 1/10, a=1 Sin[x (2 Pi / 1)]*0.25Sin[x (2 Pi /10)] f = 1, a=0.25

8 Highest frequency component of general signal Any signal represented as sum of sinusoids: Amplitude vs Space Input Signal S = + + + + … ∑ ©Zachary Wartell - 1/26/2005

9 Fourier Transform Amplitude vs Frequency Input Signal S = + + + + … ∑ Insensity vs Position = ©Zachary Wartell - 1/26/2005 f a f -how much does frequency f contribute to the original signal S sinusoid a frequency f of amplitude a f

10 How does this relate to image capture? -”real” image is a 2D signal of infinite resolution - the sampled image is of finite resolution (finite # of pixels) -the original image contains details that are very much smaller than the pixel sampling rate, result is jagged lines/boundaries - high detail means high frequency components - jagged lines/boundaries is aliasing “real” image - 2D Signal (“Mia”) ©Zachary Wartell - 1/26/2005 sampled image - (“Eye”)

11 Sampling “Mia” signal at too low frequency ©Zachary Wartell → “1D” Slice Signal Sample Reconstruction ( ) ©Zachary Wartell - 1/26/2005

12 Anti-Aliasing Options (Lines)  increase sampling rate with more pixels in framebuffer & display  Use same framebuffer resolution but enable multiple pixels based on pixel coverage  pre-filter image - remove high frequencies before sampling  area sampling – calculate area of overlap of each pixel with displayed primitives  supersampling (post-filter) – use more framebuffer pixels and “average” intensities of groups of super- pixels results to the lower resolution actual pixels ©Zachary Wartell - 1/26/2005

13 -Bresenham's line algorithm can be modified to account for pixel coverage [Gupta-Sproull]. We treat line as 1 pixel thick rectangle which can intersect up to 3 pixels and use a measure of the distance (D?) from line to the upper (P k+1 u ), standard (P k+1 ) and lower pixel (P k+1 l ) to compute the weight each pixels intensity. Use Pixel Coverage Figure 13: Assume case P k+1 =P α. Distances D u,D,D l are functions of decision parameter (p k ). Each distance used to get a intensity weighting from a pre-computed lookup table ©Zachary Wartell - 1/26/2005

14 Supersampling Straight-Line Segments  supersample subpixel positions of zero-width line 2 3 4 2 3 4 Intensity of pixel P is number of sub-pixels turned on in P ©Zachary Wartell - 1/26/2005

15 Supersampling Straight-Line Segments ©Zachary Wartell  supersample subpixel positions of finite-width line 2 3 4 2 3 4 -Intensity of pixel P is number of sub-pixels turned on in P -Use lower left corner rule -Also “pick-up” color of background ©Zachary Wartell - 1/26/2005

16 Subpixel Weighting Masks (Discrete Array) 2 3 4 2 3 4 1 1 1 1 2 2 2 2 4 -Mask (sum to 16) ©Zachary Wartell - 1/26/2005

17 Area Sampling Straight-Line Segments ©Zachary Wartell  Compute pixel to rectangle intersection area (trapezoid) 2 3 4 2 3 4 ©Zachary Wartell - 1/26/2005

18 Filtering Techniques (Continuous Function) Box Cone Gaussian -Integrate over volume -Highest potential accuracy (= slow) Sinc (sin θ/θ) ∞ ©Zachary Wartell - 1/26/2005

19 Line-Intensity and Line Angle √2 * L L ©Zachary Wartell - 1/26/2005

20 Anti-aliasing boundaries: Pixel Coverage -adjust intensity on boundary x x+1 y y+1 ©Zachary Wartell - 1/26/2005

21 Anti-aliasing boundaries: Supersampling 2 3 4 2 3 4 ©Zachary Wartell - 1/26/2005

22 Anti-aliasing boundaries: Pitteway & Watkinson -variant of Bresenham Midpoint decision parameter p (assume m in [0,1]) xkxk ykyk y k +1 x k +1 PβPβ PαPα MkMk L: y=mx+b PkPk y k +1/2 ©Zachary Wartell - 1/26/2005

23 Anti-aliasing boundaries: Pitteway & Watkinson  add 1 – m, p  [0,1] p = [m(x k +1) + b] – (y k + ½) + (1-m)  P α ↔ p 1 – m ©Zachary Wartell - 1/26/2005

24 Anti-aliasing boundaries: Pitteway & Watkinson Insight: p = [m(x k +1) + b] – (y k + ½) + (1-m) = coverage area = m x k + b – y k + ½ x k - 1/2x k + 1/2 xkxk y k +1/2 y k -1/2 ykyk y = m (x k + ½) + b y = m (x k - ½) + b A trap =B H 0 + ½ B (H 1 - H 0 ) ©Zachary Wartell - 1/26/2005

25 Anti-Aliasing: Nvidia -GeForce 4 has Accuview “multi-sampling”: “1. Subpixels are rendered in parallel (thanks to multisampling technology) to a back buffer. This back buffer is a factor that is larger than the final display resolution. 2. The image is filtered and written out to a front frame buffer. 3. The frame buffer is sent to the display.” -GeForce 8800 uses “coverage samples”…, and is Coverage Sampling Antialiasing (CSAA). “CSAA provides higher levels of AA than with current 4x or 8x multisampling AA. CSAA modes include 8x, 16x and 16xQ. CSAA produces antialiased images that rival the quality of 8x or 16x MSAA, while introducing only a minimal performance hit over standard (typically 4x) MSAA. ” ©Zachary Wartell - 1/26/2005

26 Revisions -1.2 – update with 8800 GPU commentary -to tedious s to keep this updated see SVN logs


Download ppt "Aliasing and Anti-Aliasing Copyright Zachary Wartell, University of North Carolina at Charlotte, All Rights Reserved Revision: 10/24/2007 3:38:00 AM ©Zachary."

Similar presentations


Ads by Google