computer graphics1 antialiasing & filters. computer graphics2 introduction n as seen in class,...

13
Computer Graphics 1 Antialiasing & Filters

Upload: andra-elliott

Post on 18-Dec-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Computer Graphics1 Antialiasing & Filters. Computer Graphics2 Introduction n As seen in class, we have aliasing when high frequencies pop up as low frequencies,

Computer Graphics 1

Antialiasing & Filters

Page 2: Computer Graphics1 Antialiasing & Filters. Computer Graphics2 Introduction n As seen in class, we have aliasing when high frequencies pop up as low frequencies,

Computer Graphics 2

Introduction

As seen in class, we have aliasing when high As seen in class, we have aliasing when high frequencies pop up as low frequencies, resulting in frequencies pop up as low frequencies, resulting in undesired or even strange results.undesired or even strange results.

For example, in a movie, when there is a speeding For example, in a movie, when there is a speeding car, in a certain point the wheels will look as if car, in a certain point the wheels will look as if they are not moving, and when the car keeps they are not moving, and when the car keeps speeding up, the wheels will even appear to rotate speeding up, the wheels will even appear to rotate backwards...backwards...

Page 3: Computer Graphics1 Antialiasing & Filters. Computer Graphics2 Introduction n As seen in class, we have aliasing when high frequencies pop up as low frequencies,

Computer Graphics 3

Introduction - Cont.

This occurs since the camera filming the action This occurs since the camera filming the action can only ‘shoot’ the wheel 24 times per second. If can only ‘shoot’ the wheel 24 times per second. If the wheel of 24 rods is now rotating exactly 24 the wheel of 24 rods is now rotating exactly 24 rotations per second, it will be in exactly the same rotations per second, it will be in exactly the same position every time the camera snaps. We have position every time the camera snaps. We have here a frequency of 24Hz which was transformed here a frequency of 24Hz which was transformed to 0Hzto 0Hz..

We will now see different kinds of filtersWe will now see different kinds of filters

Page 4: Computer Graphics1 Antialiasing & Filters. Computer Graphics2 Introduction n As seen in class, we have aliasing when high frequencies pop up as low frequencies,

Computer Graphics 4

Box

Box trange

( )

1

0

t

else

Triangle

Triangle tt

( )

1

0

1- t < 0

else

Page 5: Computer Graphics1 Antialiasing & Filters. Computer Graphics2 Introduction n As seen in class, we have aliasing when high frequencies pop up as low frequencies,

Computer Graphics 5

quadratic (quadratic B-spline)

else 0

1.5t0.5 1.5-t5.0

0.5t0.5- t-0.75

-0.5t1.5- 1.5+t5.0

)(2

2

2

tQuadratic

cubic (cubic B-spline)

Cubic t

t

t t

t

2

6

4 6 3

61

2

60

3

2

3

- 2 t < -1

t

1 t < 2

else

Page 6: Computer Graphics1 Antialiasing & Filters. Computer Graphics2 Introduction n As seen in class, we have aliasing when high frequencies pop up as low frequencies,

Computer Graphics 6

Catrom

else 0

2<t1 5845.0

1<t0 3525.0

0<t1- 3525.0

-1<t2- 5845.0

)( 2

2

ttt

tt

tt

ttt

tCatrom

Page 7: Computer Graphics1 Antialiasing & Filters. Computer Graphics2 Introduction n As seen in class, we have aliasing when high frequencies pop up as low frequencies,

Computer Graphics 7

Mitchel First, for a chosen constants b,c create the First, for a chosen constants b,c create the

following:following:

p b

p b c

p b c

q b c

q b c

q b c

q b c

0

2

3

0

1

2

3

6 2 6

18 12 6 6

12 9 6 6

8 24 6

12 48 6

6 30 6

6 6

/

/

/

/

/

/

/

Page 8: Computer Graphics1 Antialiasing & Filters. Computer Graphics2 Introduction n As seen in class, we have aliasing when high frequencies pop up as low frequencies,

Computer Graphics 8

Mitchel - Cont.

Mitchel t

q t q t q tq

p t p tp

p t p tp

q t q t q tq

( )

0 1 2 3

02

2 3

02

2 3

0 1 2 3

0

- 2 t < -1

-1 t < 0

0 t < 1

1 t < 2

else

Page 9: Computer Graphics1 Antialiasing & Filters. Computer Graphics2 Introduction n As seen in class, we have aliasing when high frequencies pop up as low frequencies,

Computer Graphics 9

Gaussian (infinite)

Gaussian t e t 2 2 2

Sinc

Sinc t t

t

1 t = 0

elsesin

Page 10: Computer Graphics1 Antialiasing & Filters. Computer Graphics2 Introduction n As seen in class, we have aliasing when high frequencies pop up as low frequencies,

Computer Graphics 10

Hanning

Hanning t t 0 5 1. cos

Ham g t tmin . . cos 0 54 0 46

Hamming

Page 11: Computer Graphics1 Antialiasing & Filters. Computer Graphics2 Introduction n As seen in class, we have aliasing when high frequencies pop up as low frequencies,

Computer Graphics 11

Blackman

Blackman t t t 0 42 0 5 0 08 2. . cos . cos

Page 12: Computer Graphics1 Antialiasing & Filters. Computer Graphics2 Introduction n As seen in class, we have aliasing when high frequencies pop up as low frequencies,

Computer Graphics 12

Kaiser First, for some small First, for some small we need to define Bessel_i0:we need to define Bessel_i0:

double Bessel_i0(double x)double Bessel_i0(double x)

{{

register int i;register int i;

double sum, y, t;double sum, y, t;

sum = 1.;sum = 1.;

y = x*x/4.; y = x*x/4.;

t = y;t = y;

for (i=2; t>for (i=2; t>; i++) {; i++) {

sum += t;sum += t;

t *= (double)y/(i*i); t *= (double)y/(i*i);

} }

return sum;return sum;

}}

First, for a chosen range d and constants b,c create the following:First, for a chosen range d and constants b,c create the following:

Page 13: Computer Graphics1 Antialiasing & Filters. Computer Graphics2 Introduction n As seen in class, we have aliasing when high frequencies pop up as low frequencies,

Computer Graphics 13

Kaiser - Cont.

Initialize the following (for chosen constant a):Initialize the following (for chosen constant a): i0a=1/Bessel_i0(a)i0a=1/Bessel_i0(a)

And now:And now:

Bessel t Bessel i a t i a _ 0 1 02