Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Aliasing
Aliasing definition: Distortion of information due to undersampling To avoid aliasing, sampling frequency has to be greater than twice the highest frequency occurring in the object. This minimum sampling frequency to avoid aliasing is also called the Nyquist Sampling Frequency. In other words, sample at least twice every period.
True Object period
period
Example of Aliasing
Suppose we have a pattern of alternating red and green stripes.
Suppose we have show this pattern with pixels matching the stripes. This is equal to the Nyquist Frequency. For each pixel, we sample the middle of the pixel and color the entire pixel that color. We get the correct image.
Suppose now we move the pattern further back, so that each pixel is now relatively bigger. Note: This is now below the Nyquist frequency. Once again, we sample the middle of the pixel
And we color the entire pixel the sampled color. We would get this picture
Anti-Aliasing
Since were representing real-world objects with a finite number of pixels, aliasing occurs frequently. Therefore, we need to implement techniques to cancel the undesirable effects of aliasing. These techniques are called anti-aliasing techniques. One common anti-aliasing method is super-sampling
Antialiasing Examples
Super-Sampling
Split single pixel into sub-pixels. Pixels final color is a mixture of sub-pixels colors. Simple method: Sample at the middle of each sub-pixel. Then, pixels color is the average of the sub-pixels color.
Pixels
1.0 0.0
Assign color
0 2 2
0 4 0
0 4 0
4 0 0
0.0
A line that is one-pixel wide. For every pixel: Maximum number of sub-pixels inside line = 16
0 10/16
0 15/16
5/16 13/16
9/16 7/16
8/16
2/16
Fraction of sub-pixels are in = fraction of color of the pixel should be line color
Example weight for each sub-pixel Total weight = 32 Final color of pixel = Sum of each (sub-pixel colors x sub-pixel weight) / total weight
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 2 3 2 1
2 4 5 4 2
3 5 6 5 3
2 4 5 4 2
1 2 3 2 1
1 2 3 2 1
2 5 6 5 2
3 6 8 6 3
2 5 6 5 2
1 2 3 2 1
( x m )2 1 Gaussian function = exp ( 2s2 ) s 2p where s is the standard deviation and m is the mean