Sampling and reconstruction CS 4620 Lecture 3 Lecture 3 Cornell - - PowerPoint PPT Presentation

sampling and reconstruction
SMART_READER_LITE
LIVE PREVIEW

Sampling and reconstruction CS 4620 Lecture 3 Lecture 3 Cornell - - PowerPoint PPT Presentation

Sampling and reconstruction CS 4620 Lecture 3 Lecture 3 Cornell CS4620 Fall 2019 1 Sampled representations How to store and compute with continuous functions? Common scheme for representation: samples write down the


slide-1
SLIDE 1

Lecture 3 • Cornell CS4620 Fall 2019

Sampling and reconstruction

CS 4620 Lecture 3

1

slide-2
SLIDE 2

Lecture 3 • Cornell CS4620 Fall 2019

Sampled representations

  • How to store and compute with continuous functions?
  • Common scheme for representation: samples

write down the function’s values at many points

[FvDFH fig.14.14b / Wolberg] 2

slide-3
SLIDE 3

Lecture 3 • Cornell CS4620 Fall 2019

Reconstruction

  • Making samples back into a continuous function

for output (need realizable method) for analysis or processing (need mathematical method) amounts to “guessing” what the function did in between

[FvDFH fig.14.14b / Wolberg] 3

slide-4
SLIDE 4

Lecture 3 • Cornell CS4620 Fall 2019

Filtering

  • Processing done on a function

can be executed in continuous form (e.g. analog circuit) but can also be executed using sampled representation

  • Simple example: smoothing by averaging

4

slide-5
SLIDE 5

Lecture 3 • Cornell CS4620 Fall 2019

Roots of sampling

  • Nyquist 1928; Shannon 1949

famous results in information theory

  • 1940s: fjrst practical uses in telecommunications
  • 1960s: fjrst digital audio systems
  • 1970s: commercialization of digital audio
  • 1982: introduction of the Compact Disc

the fjrst high-profjle consumer application

  • This is why all the terminology has a communications or audio

“fmavor”

early applications are 1D; for us 2D (images) is important

5

slide-6
SLIDE 6

Lecture 3 • Cornell CS4620 Fall 2019

Sampling in digital audio

  • Recording: sound to analog to samples to disc
  • Playback: disc to samples to analog to sound again

how can we be sure we are fjlling in the gaps correctly?

6

slide-7
SLIDE 7

Lecture 3 • Cornell CS4620 Fall 2019

Undersampling

  • What if we “missed” things between the samples?
  • Simple example: undersampling a sine wave

unsurprising result: information is lost surprising result: indistinguishable from lower frequency also was always indistinguishable from higher frequencies aliasing: signals “traveling in disguise” as other frequencies

7

slide-8
SLIDE 8

Lecture 3 • Cornell CS4620 Fall 2019

Undersampling

  • What if we “missed” things between the samples?
  • Simple example: undersampling a sine wave

unsurprising result: information is lost surprising result: indistinguishable from lower frequency also was always indistinguishable from higher frequencies aliasing: signals “traveling in disguise” as other frequencies

7

slide-9
SLIDE 9

Lecture 3 • Cornell CS4620 Fall 2019

Undersampling

  • What if we “missed” things between the samples?
  • Simple example: undersampling a sine wave

unsurprising result: information is lost surprising result: indistinguishable from lower frequency also was always indistinguishable from higher frequencies aliasing: signals “traveling in disguise” as other frequencies

7

slide-10
SLIDE 10

Lecture 3 • Cornell CS4620 Fall 2019

Undersampling

  • What if we “missed” things between the samples?
  • Simple example: undersampling a sine wave

unsurprising result: information is lost surprising result: indistinguishable from lower frequency also was always indistinguishable from higher frequencies aliasing: signals “traveling in disguise” as other frequencies

7

slide-11
SLIDE 11

Lecture 3 • Cornell CS4620 Fall 2019

Undersampling

  • What if we “missed” things between the samples?
  • Simple example: undersampling a sine wave

unsurprising result: information is lost surprising result: indistinguishable from lower frequency also was always indistinguishable from higher frequencies aliasing: signals “traveling in disguise” as other frequencies

7

slide-12
SLIDE 12

Lecture 3 • Cornell CS4620 Fall 2019

Undersampling

  • What if we “missed” things between the samples?
  • Simple example: undersampling a sine wave

unsurprising result: information is lost surprising result: indistinguishable from lower frequency also was always indistinguishable from higher frequencies aliasing: signals “traveling in disguise” as other frequencies

7

slide-13
SLIDE 13

Lecture 3 • Cornell CS4620 Fall 2019

Preventing aliasing

  • Introduce lowpass fjlters:

remove high frequencies leaving only safe, low frequencies choose lowest frequency in reconstruction (disambiguate)

8

slide-14
SLIDE 14

Lecture 3 • Cornell CS4620 Fall 2019

Preventing aliasing

  • Introduce lowpass fjlters:

remove high frequencies leaving only safe, low frequencies choose lowest frequency in reconstruction (disambiguate)

8

slide-15
SLIDE 15

Lecture 3 • Cornell CS4620 Fall 2019

Linear fjltering: a key idea

  • Transformations on signals; e.g.:

bass/treble controls on stereo blurring/sharpening operations in image editing smoothing/noise reduction in tracking

  • Key properties

linearity: fjlter(f + g) = fjlter(f) + fjlter(g) shift invariance: behavior invariant to shifting the input

  • delaying an audio signal
  • sliding an image around
  • Can be modeled mathematically by convolution

9

slide-16
SLIDE 16

Lecture 3 • Cornell CS4620 Fall 2019

Convolution warm-up

  • basic idea: defjne a new function by averaging over a sliding window
  • a simple example to start off: smoothing

10

slide-17
SLIDE 17

Lecture 3 • Cornell CS4620 Fall 2019

Convolution warm-up

  • basic idea: defjne a new function by averaging over a sliding window
  • a simple example to start off: smoothing

10

slide-18
SLIDE 18

Lecture 3 • Cornell CS4620 Fall 2019

Convolution warm-up

  • basic idea: defjne a new function by averaging over a sliding window
  • a simple example to start off: smoothing

10

slide-19
SLIDE 19

Lecture 3 • Cornell CS4620 Fall 2019

Convolution warm-up

  • basic idea: defjne a new function by averaging over a sliding window
  • a simple example to start off: smoothing

10

slide-20
SLIDE 20

Lecture 3 • Cornell CS4620 Fall 2019

Convolution warm-up

  • basic idea: defjne a new function by averaging over a sliding window
  • a simple example to start off: smoothing

10

slide-21
SLIDE 21

Lecture 3 • Cornell CS4620 Fall 2019

Convolution warm-up

  • Same moving average operation, expressed mathematically:

11

c[i] = 1 2r + 1

i+r

X

j=i−r

a[j].

slide-22
SLIDE 22

Lecture 3 • Cornell CS4620 Fall 2019

Discrete convolution

  • Simple averaging:

every sample gets the same weight

  • Convolution: same idea but with weighted average

each sample gets its own weight (normally zero far away)

  • This is all convolution is: it is a moving weighted average

12

c[i] = 1 2r + 1

i+r

X

j=i−r

a[j].

Σ

(a ? b)[i] = X

j

a[j]b[i − j].

slide-23
SLIDE 23

Lecture 3 • Cornell CS4620 Fall 2019

Filters

  • Sequence of weights b is called a filter
  • Filter is nonzero over its region of support

usually centered on zero: support radius r

  • Filter is normalized so that it sums to 1.0

this makes for a weighted average, not just any


  • ld weighted sum
  • Most fjlters are symmetric about 0

since for images we usually want to treat
 left and right the same a box fjlter

13

slide-24
SLIDE 24

Lecture 3 • Cornell CS4620 Fall 2019

Convolution and fjltering

  • Can express sliding average as convolution with a box filter
  • bbox = […, 0, 1, 1, 1, 1, 1, 0, …]/5

14

slide-25
SLIDE 25

Lecture 3 • Cornell CS4620 Fall 2019

1 1 0.6

1 5

/

1 5

/

1 5

/

.2 .2 .2 .2 .2 .2 .2 .2 a[j] b[i – j] a[j]b[i – j] b[i – j] a[j]b[i – j] (a b)[i]

× = × = = ×

Σ Σ Σ

6 –7 j i i – j i – j i – j

Example: box and step

15

slide-26
SLIDE 26

Lecture 3 • Cornell CS4620 Fall 2019

1 1 0.6

1 5

/

1 5

/

1 5

/

.2 .2 .2 .2 .2 .2 .2 .2 a[j] b[i – j] a[j]b[i – j] b[i – j] a[j]b[i – j] (a b)[i]

× = × = = ×

Σ Σ Σ

6 –7 j i i – j i – j i – j

Example: box and step

15

slide-27
SLIDE 27

Lecture 3 • Cornell CS4620 Fall 2019

1 1 0.6

1 5

/

1 5

/

1 5

/

.2 .2 .2 .2 .2 .2 .2 .2 a[j] b[i – j] a[j]b[i – j] b[i – j] a[j]b[i – j] (a b)[i]

× = × = = ×

Σ Σ Σ

6 –7 j i i – j i – j i – j

Example: box and step

15

slide-28
SLIDE 28

Lecture 3 • Cornell CS4620 Fall 2019

1 1 0.6

1 5

/

1 5

/

1 5

/

.2 .2 .2 .2 .2 .2 .2 .2 a[j] b[i – j] a[j]b[i – j] b[i – j] a[j]b[i – j] (a b)[i]

× = × = = ×

Σ Σ Σ

6 –7 j i i – j i – j i – j

Example: box and step

15

slide-29
SLIDE 29

Lecture 3 • Cornell CS4620 Fall 2019

1 1 0.6

1 5

/

1 5

/

1 5

/

.2 .2 .2 .2 .2 .2 .2 .2 a[j] b[i – j] a[j]b[i – j] b[i – j] a[j]b[i – j] (a b)[i]

× = × = = ×

Σ Σ Σ

6 –7 j i i – j i – j i – j

Example: box and step

15

slide-30
SLIDE 30

Lecture 3 • Cornell CS4620 Fall 2019

Convolution and fjltering

  • Convolution applies with any sequence of weights
  • Example: bell curve (gaussian-like) […, 1, 4, 6, 4, 1, …]/16

16

slide-31
SLIDE 31

Lecture 3 • Cornell CS4620 Fall 2019

Convolution and fjltering

  • Convolution applies with any sequence of weights
  • Example: bell curve (gaussian-like) […, 1, 4, 6, 4, 1, …]/16

16

slide-32
SLIDE 32

Lecture 3 • Cornell CS4620 Fall 2019

Discrete convolution

  • Notation:
  • Convolution is a multiplication-like operation

commutative associative distributes over addition scalars factor out identity: unit impulse e = […, 0, 0, 1, 0, 0, …]

  • Conceptually no distinction between fjlter and signal

17

slide-33
SLIDE 33

Lecture 3 • Cornell CS4620 Fall 2019

Discrete fjltering in 2D

  • Same equation, one more index

now the fjlter is a rectangle you slide around over a grid of numbers

  • Commonly applied to images

blurring (using box, using gaussian, …) sharpening (impulse minus blur)

  • Usefulness of associativity
  • ften apply several fjlters one after another: (((a * b1) * b2) * b3)

this is equivalent to applying one fjlter: a * (b1 * b2 * b3)

18

slide-34
SLIDE 34

Lecture 3 • Cornell CS4620 Fall 2019

And in pseudocode…

19

slide-35
SLIDE 35

Lecture 3 • Cornell CS4620 Fall 2019

  • riginal | box blur

sharpened | gaussian blur

[Philip Greenspun] 20

slide-36
SLIDE 36

Lecture 3 • Cornell CS4620 Fall 2019

  • riginal | box blur

sharpened | gaussian blur

[Philip Greenspun] 20

slide-37
SLIDE 37

Lecture 3 • Cornell CS4620 Fall 2019

Optimization: separable fjlters

  • basic alg. is O(r2): large fjlters get expensive fast!
  • defjnition: a2(x,y) is separable if it can be written as:

this is a useful property for fjlters because it allows factoring:

21

slide-38
SLIDE 38

Lecture 3 • Cornell CS4620 Fall 2019

Separable fjltering

first, convolve with this

22

= *

slide-39
SLIDE 39

Lecture 3 • Cornell CS4620 Fall 2019

Separable fjltering

first, convolve with this second, convolve with this

22

= *

slide-40
SLIDE 40

Lecture 3 • Cornell CS4620 Fall 2019

Continuous convolution: warm-up

  • Can apply sliding-window average to a continuous function just as

well

  • utput is continuous

integration replaces summation

23

slide-41
SLIDE 41

Lecture 3 • Cornell CS4620 Fall 2019

Continuous convolution: warm-up

  • Can apply sliding-window average to a continuous function just as

well

  • utput is continuous

integration replaces summation

23

slide-42
SLIDE 42

Lecture 3 • Cornell CS4620 Fall 2019

Continuous convolution: warm-up

  • Can apply sliding-window average to a continuous function just as

well

  • utput is continuous

integration replaces summation

23

slide-43
SLIDE 43

Lecture 3 • Cornell CS4620 Fall 2019

Continuous convolution: warm-up

  • Can apply sliding-window average to a continuous function just as

well

  • utput is continuous

integration replaces summation

23

slide-44
SLIDE 44

Lecture 3 • Cornell CS4620 Fall 2019

Continuous convolution: warm-up

  • Can apply sliding-window average to a continuous function just as

well

  • utput is continuous

integration replaces summation

23

slide-45
SLIDE 45

Lecture 3 • Cornell CS4620 Fall 2019

Continuous convolution

  • Sliding average expressed mathematically:

note difference in normalization (only for box)

  • Convolution just introduces weights

weighting is now by a function weighted integral is like weighted average again bounds are set by support of f(x)

24

slide-46
SLIDE 46

Lecture 3 • Cornell CS4620 Fall 2019

One more convolution

  • Continuous–discrete convolution

input: a sequence and a continuous function

  • utput: a continuous function

used for reconstruction and resampling

25

slide-47
SLIDE 47

Lecture 3 • Cornell CS4620 Fall 2019

Continuous-discrete convolution

26

slide-48
SLIDE 48

Lecture 3 • Cornell CS4620 Fall 2019

Continuous-discrete convolution

26

slide-49
SLIDE 49

Lecture 3 • Cornell CS4620 Fall 2019

Continuous-discrete convolution

26

slide-50
SLIDE 50

Lecture 3 • Cornell CS4620 Fall 2019

Continuous-discrete convolution

26

slide-51
SLIDE 51

Lecture 3 • Cornell CS4620 Fall 2019

Continuous-discrete convolution

26

slide-52
SLIDE 52

Lecture 3 • Cornell CS4620 Fall 2019

And in pseudocode…

27

function reconstruct(sequence a, filter f, real x) s = 0 r = f.radius for i = dx re to bx + rc do s = s + a[i]f(x i) return s

<latexit sha1_base64="akNUJ/jhcF245tZsLuKpMhj2Do=">AC6nicbVFLb9NAEF6bVzGvFI5cRsRIqYDIeUjkUqjEhWORSFspG1Xr9TpdZb02+0CNrPwELhxAiCu/iBv/gp/A2EkrXmNZ+81838zszqSVktYlyY8gvHL12vUbOzejW7fv3L3X2b1/ZEtvuJjyUpXmJGVWKnF1EmnxElBCtSJY7T5auGP34vjJWlfutWlZgXbKFlLjlzGDrdDQhNxULq2rE0lXqxjihsv326lEpFNU1zyL3mTcIajOClts547npWvPNCcwExi59CLpUTBuIcMV5BQXwe71EaWdiHBE+DZ943LJPeorupW5o1xBIZqriQCs7hGRigpnFiaDWuRAlVuSpLg/yTlm+9rSAr1iPvoibThYFbCbnkPeaWnIvuhlhPMGX2AjKnR2+eDTjfpJ63Bv2CwBd2XP0lrh6ed7zQruS+Edlwxa2eDpHLzmhknuRI4QG9FxfiSLcQMoWaFsPO6XdUaHmMka56Nv3bQRn/PqFlh7apIUVkwd2b/5prg/7iZd/lkXktdeYcr2TKvcLpQbN3yCRuzqkVAsaNxLsCP2OGcdyZjdohjIfDyXgEGzAaXIDJ5RCOhv3BqJ+8GXYPxptpkB3ykDwiPTIgz8kBeU0OyZTwYBF8CD4Fn0MVfgy/hF830jDY5jwgf1j47Rf/BOH9</latexit>
slide-53
SLIDE 53

Lecture 3 • Cornell CS4620 Fall 2019

Resampling

  • Changing the sample rate

in images, this is enlarging and reducing

  • Creating more samples:

increasing the sample rate “upsampling” “enlarging”

  • Ending up with fewer samples:

decreasing the sample rate “downsampling” “reducing”

28

slide-54
SLIDE 54

Lecture 3 • Cornell CS4620 Fall 2019

Resampling

  • Reconstruction creates a continuous function

forget its origins, go ahead and sample it

29

slide-55
SLIDE 55

Lecture 3 • Cornell CS4620 Fall 2019

Resampling

  • Reconstruction creates a continuous function

forget its origins, go ahead and sample it

29

slide-56
SLIDE 56

Lecture 3 • Cornell CS4620 Fall 2019

Resampling

  • Reconstruction creates a continuous function

forget its origins, go ahead and sample it

29

slide-57
SLIDE 57

Lecture 3 • Cornell CS4620 Fall 2019

Resampling

  • Reconstruction creates a continuous function

forget its origins, go ahead and sample it

29

slide-58
SLIDE 58

Lecture 3 • Cornell CS4620 Fall 2019

Resampling

  • Reconstruction creates a continuous function

forget its origins, go ahead and sample it

29

slide-59
SLIDE 59

Lecture 3 • Cornell CS4620 Fall 2019

And in pseudocode…

30

function resample(sequence a, filter f, real x0, real ∆x, int N) allocate output sequence b of length N for j = 0 to N − 1 do b[j] = reconstruct(a, f, x + j∆x) return b

<latexit sha1_base64="PeblT5ZoTgtQ5r360qZWax1qm34=">AD3icbVLjtMwFHXCawiP6cCSzRXNSB0BVfqQ6GZgJFiwGg0SnRmpqSrHvWndOk6wHdQq6h+w4VfYsAhtmzZ8Rd8Ak7aKc8bRTo591z7+DhRJrg2QfDdcS9dvnL12s5178bNW7d3a3t3TnWaK4Z9lopUnUdUo+AS+4YbgeZQpEAs+i+bOyf/YGleapfGWGQ4TOpE85owaS432nP0wgmXhaFRxOVk5YWweQ7DORfCK8IohjiXrBxYgUJNk0xgQ+PrHCVD8Kn/EGIuDCrwY4vt/gL8xSjY4vA5CkNhYQkuDfjH/kEYelSI1PpASHOT5QZ+rRj5kMYgUE7MtFRb8dpGqlbgz+AQAh8qxqSWOH7U2nyO05XVhk/8aDAb+lankKVSG5Uz06iMVg79BTyA2dbVwcX6Ck2u7CGtAS9EOd6mMqrVg2ZQFfwLWhtQf/qDVHUyqn0LxynLE5SGCar1oBVkZlhQZTgTaFPONWaUzekEBxZKmqAeFtV9rmDfMuPysPa1cVXs7xMFTbReJpFVJtRM9d+9kvxfb5CbuDcsuLRp26DXG8W5sClC+XPAmNu8jFhaQJni1iuwKVWU2bvVXhVCt93udTuwBp3WBehtQzhtN1udZvCyXT/qrtMgO+QeuU8apEUekyPygpyQPmHOW+e989H5L5zP7if3S9rqetsZu6SP8r9+hMk3+4Q</latexit>

1 x0 x0 + (N – 1)Δx Δx

slide-60
SLIDE 60

Lecture 3 • Cornell CS4620 Fall 2019

Defjning the source interval

  • Convenient: defjne samples using an interval to be resampled, and N
  • Exactly how to fjll an interval with N samples? Desiderata:

sample pattern should be centered in the interval (prevents shifting of content as you change resolution) sample patterns of adjacent intervals should tile (makes it meaningful to break up a signal into pieces) N all the way down to 1 should work

  • Solution: think of breaking into N subintervals and centering a

sample in each one

sample i goes at

31

xl + i + 0.5 N (xr − xl)

<latexit sha1_base64="b2dGCo2hUQhuoGOUSjq0y3mhCoA=">AC3icbZDLSgMxGIX/8VrerSTWgRFLHMtBW7s+DGlVSwtdAOQybN1GDmQpIRy9C9G1/FjQtF3PoC7nwLH8F0poq3A4GPc/6fJMeNOJPKN+MqemZ2bn53EJ+cWl5ZbWwt6WYSwIbZGQh6LjYk5C2hLMcVpJxIU+y6n5+7l0Tg/v6JCsjA4U8OI2j4eBMxjBCtOYXitcPRLup5ApOEaTL+6PkZLR97Qi0h3S64xRKZtlMhf6CNYHS4TukajqF14/JLFPA0U4lrJrmZGyEywUI5yO8r1Y0giTSzygXY0B9qm0k/QvI7SlnT7yQqFPoFDqft9IsC/l0Hf1pI/Vhfydjc3/sm6svLqdsCKFQ1IdpEXc6RCNC4G9ZmgRPGhBkwE029F5ALrWpSuL5+WUKtU6rUqyqBqfUL9q4R2pWxVy+ZprdSoZW1ADjahCNtgwQE04Bia0AICN3AHD/Bo3Br3xpPxnI1OGZOdDfgh4+UD346Z+g=</latexit>

1 x0 x4 xl xr x0 + (N – 1)Δx

x0 = xl + 1

2∆x

<latexit sha1_base64="Ks2qsgK/oX2RvcGBu23J/wiY2p4=">ACXicbZDLSgMxFIYzXmu9jbp0YbAIglBmpgW7EQq6cFnBXqBTSibNtKGZC0lGLMNs3fgqLnShiAs3PoDgzncRMZ2p4u1Awsf/n8NJfidkVEjDeNWmpmdm5+ZzC/nFpeWVX1tvSGCiGNSxwELeMtBgjDqk7qkpFWyAnyHEazvBw7DfPCBc08E/lKCQdD/V96lKMpJK6OjzvGvBA3QzuQdvlCMdmElsJtI8Ik0gZesEoGmnBv2BOoFDdentEz+/Xta7+YvcCHnEl5ghIdqmEcpOjLikmJEkb0eChAgPUZ+0FfrI6ITpz9J4I5SetANuDq+hKn6fSJGnhAjz1GdHpID8dsbi/957Ui6lU5M/TCSxMfZIjdiUAZwHAvsU6wZCMFCHOq3grxAKk4pAovn4ZQtqxKuQzKJmfUPkKoWEVzVLRODEL1TLIKgc2wTbYBSbYB1VwDGqgDjC4AFfgFtxpl9qNdq89ZK1T2mRmA/wo7ekDZwKdkQ=</latexit>

xl + (N − 1

2)∆x

<latexit sha1_base64="4yva7FlTt6O9AUnEyFDv6DtnOI=">ACXicbZDLSgMxGIUz9VbrbdSlC4NFqIhlZlqwy4IuXEkFe4G2lEyaUMzF5KMWIbZuvFVXOhCERdufADBne8iYjqt4u1A4Oc/yfJsQNGhTSMVy01NT0zO5ezywsLi2v6KtrNeGHJMq9pnPGzYShFGPVCWVjDQCTpBrM1K3BwejvH5GuKC+dyqHAWm7qOdRh2IkldXR4XmHwV2YO4Z7sOVwhCMzjqx4B7YOCZNIxXrWyBuJ4F8wJ5Atb749ouf360pHf2l1fRy6xJOYISGaphHIdoS4pJiRONMKBQkQHqAeaSr0kEtEO0p+EsNt5XSh43N1PAkT9/tGhFwhq6tJl0k+J3NjL/y5qhdErtiHpBKImHxc5IYPSh6NaYJdygiUbKkCYU/VWiPtI9SFVeZmkhKJlYoFOIaC+QmlrxJqVt4s5I0TM1sugrHSYANsgRwT4ogyNQAVWAwQW4ArfgTrvUbrR7WE8mtImO+vgh7SnD6kwnRk=</latexit>

e.g. fjrst sample at e.g. last sample at

slide-61
SLIDE 61

Lecture 3 • Cornell CS4620 Fall 2019

And in pseudocode…

32

1 x0 x4 xl xr x0 + (N – 1)Δx

function resample(sequence a, filter f, real xl, real xr, int N) allocate output sequence b of length N for j = 0 to N − 1 do b[j] = reconstruct(a, f, xl + (j + 1

2)(xr − xl)/N)

return b

<latexit sha1_base64="QvdnVZgK+LdPnNZw8uX+z+hiE=">ADJHicbVLbtNAFB2bVwmvFpZsroiRUkFTO6lEhVSoxIZVST6kOIoGk+u02nHYzMzRlSWP4YNv8KGBQ+xYM38AlcO6GUx1i2js89d+b4XCeFktaF4TfPv3Dx0uUrS1c7167fuHlreX2vs1LI3BP5Co3hwm3qKTGPSedwsPCIM8ShQfJybOmfvAajZW5fulOCxnfKZlKgV3RE1WvMdxgjOpK8eTROpZ3YlhcW3FJ1KpThUnKaSlFk1DQYtzwqFPYuvStQCIeDBQ0ilcmgSAnT+QqCNxN1DhvCUjsIdoLVO5wpXKygJCXrigd/N4sCSBPQaGeuaNGTeK5g9zUEBzDFoQBtIzLidhZixav07wmbfwkSEbH4B0BkWurTOlcL3WY2u8QUPoHdMjzg1XFRXQ3qVeiRSVgDKq/COsxthsbdKWhLydrnRj19CyqyXI37Iftgn9BtADdpz9Yu3Yny5/jaS7KDLUTils7isLCjStunBQKfrSYsHFCZ/hiKDmGdpx1Q65hvETJsY6KYgW/Z8R8Uza0+zhJQZd0f271pD/q82Kl26Oa6kpjnQCOYHpaWifKH5Y2AqKUmnTglwYSR5BXHEKTkauO20IWwMBpsbQ5iDYfQLbJ6FsD/oR8N+GLQ3d6Yp8GW2F12j/VYxB6xbfac7bI9Jry3nvo/fJf+d/8L/4X+dS31v03GF/LP/7T+tY9KQ=</latexit>

Note that this expands into a double loop

slide-62
SLIDE 62

Lecture 3 • Cornell CS4620 Fall 2019

Cont.–disc. convolution in 2D

  • same convolution—just two variables now

loop over nearby pixels, 
 average using fjlter weight looks like discrete fjlter,
 but offsets are not integers
 and fjlter is continuous remember placement of fjlter
 relative to grid is variable

33

pixel locations support of reconstruction fjlter sample point for reconstruction

slide-63
SLIDE 63

Lecture 3 • Cornell CS4620 Fall 2019

Cont.–disc. convolution in 2D

34

Example showing
 fjlter weights used
 to compute a
 reconstructed value
 at a single point.

slide-64
SLIDE 64

Lecture 3 • Cornell CS4620 Fall 2019

And in pseudocode…

35

function reconstruct(sequence a, filter f, real x, real y) s = 0 for j = dy f.rye to by + f.ryc do for i = dx f.rxe to bx + f.rxc do s = s + a[i, j]f(x i, y j) return s

<latexit sha1_base64="5QK4Mv1lfG6UQM0mMrF5KyCf+bs=">ADYHicfVLjtMwFHUbHiXMC3sYHNFg9QRQ5U+JLqZYSQ2LAeJzoxUV5XjOh23jhNsZ9Qo6k+yY8GL+ATcNJQytNRpKNz25Ob5BIrg2v+5Vnfu3L13v/HAfXhw+Oio2Xp8qeNUTamsYjVdUA0E1yseFGsOtEMRIFgl0Fq7dF/eqWKc1j+cFkCZtGZCF5yCkxlpq1arc4YAsuc0OCgMvFxsVQPad7aMWFcHMchBCmkhatG1CMxlIblVLT0exjyiRl4BHvBEIuDFPghRbYQR46x3KvGOMXU/DKfieRVvTWG3AW1oOC8q4gAxeQdhVswywKgPSp2JrQyLUMSxspqXO03JVKJ5vLG+GzPmf90XlfO6/84ryvn9T+c8Vk5v7YyMuEnymEncKXn5SDL493P6aYSZXNytOei5mc72KeNdt+1y8P/Al6FWi/+YbKczFrfsLzmKYRk4YKovWk5ydmhNlOBXMXluqWULoizYxEJIqanebkgG3hmXmRhX2lgZLd78hJpHUWBVYZEXOjf68V5N9qk9SEo2nOZIae/3bD4WpsHFCsW0w53ZLjMgsIFRxOyvQG6Itfuh3TKEYb8/Gg5gCwa9H2C0C+Gy3+0Nuv7fvt8uE0DNdAz9Bx1UA+9RufoHbpAY0RrX+pO/aB+WP/qNJwjp7WV1mtVzxP0y3GefgcSeAQi</latexit>
slide-65
SLIDE 65

Lecture 3 • Cornell CS4620 Fall 2019

Defjning the source rectangle

  • exactly the same way we defjned the source interval in 1D
  • except now there is


an interval (l, r) in x
 and an interval (b, t)
 in y

  • intervals in x and y


constitute a rectangle

  • sample points are


positioned with the
 same considerations
 (at centers of a grid


  • f sub-rectangles)

36

(l, b) (r, t)

slide-66
SLIDE 66

Lecture 3 • Cornell CS4620 Fall 2019

And in pseudocode…

37

Note that this expands into a quadruple loop

function resample(image a, filter f, rectangle r, int w, int h) allocate output image b of size (w, h) for j = 0 to h − 1 do y = r.b + (j + 1

2)(r.t − r.b)/h

for i = 0 to w − 1 do x = r.l + (i + 1

2)(r.r − r.l)/w

b[i, j] = reconstruct(a, f, x, y) return b

<latexit sha1_base64="J4cXop21yLJpCB828rpkvKUs=">ADonicbVJb9MwFPZaLqNctsEjDxwxI7ViK0k3ib0MJiEkxANsgl2kpoc12m9OU5kO3Qlyv/id/DGv+AncOJ21djmKPbnc/us75w4V9K6IPiz1GjeuXv/vKD1sNHj5+srK49PbJZYbg45JnKzEnMrFBSi0MnRInuREsjZU4js8/1P7jH8JYmenvbpqLQcpGWiaSM4em07WlX1EsRlKXjsWx1KOqFcH8212c51KpKGqVUZxAUmhep1ZghGVprkRbYk0BlNENSKRywgBNEBvBHdMjhS6DV6kd0MklGNMOVmRKZfgSAVnh8sLBvFJMIUvAyp+I25MNGHfogj4zFdAz2IWAgre4DA3jzXB+HWYVxkbv6BRjTDeG19A+wy1KDONlWJW9qgNt03WwWbs78AbG1GdcqS+v15/cqI8MF5B1QzyFgbjGVTNMKGXOXFfbpwNaJ0peKatMwV3ba+dF41e1NvUq+P5jHCFQbVRlFYk9HDRqNPV9aAb+AU3QTgH6+/Er/2T1d/R8OMF6nQjitmbT8McjcomXGSK4GNL6zIGT/HFvQRapYKOyj9iFXwCi3DWh38sX/ejWjZKm10zTGyJS5sb3uq423+fqFS3YGpdTYfqH5jCgpFMoO9bzCUNZzpKYIGDcS3wp8zFBpnDPb8iJs93o721swA1vhJdhZiHDU64Zb3eCgt763PVODLJPn5CVpk5C8JXvkE9knh4Q3XjQ+Nr40vjZp83PzoPltFtpYmuc8I/+tZvQPK5cSJg=</latexit>
slide-67
SLIDE 67

Lecture 3 • Cornell CS4620 Fall 2019

Separable fjlters for resampling

  • just as in fjltering, separable fjlters are useful

separability in this context is a statement about a continuous fjlter, rather than a discrete one:

  • with a separable fjlter the region of support is rectangular
  • all widely used resampling fjlters 


are separable

there are good reasons best explained 
 with frequency domain arguments (it’s easiest to design separable fjlters 
 to suppress grid artifacts)

38

(x, y)

<latexit sha1_base64="aGR+GLzjVCTU21uEnQWLtdlsVJo=">AB7HicbZDLSsNAFIZP6q3W9Wlm8EiVJCStAG7s+DGZQVTC20ok+mkHTqZhJmJGEKfwY0LRdz6QO58Cx/BNK3i7YeBj/+cwznzexFnSpvm1FYWl5ZXSulzY2t7Z3yrt7HRXGklCHhDyUXQ8rypmgjma024kKQ48Tq+9yfmsfn1DpWKhuNJRN0AjwTzGcE6s5zq7UlyPChXzJqZC/0FawGVs3fI1R6UX/vDkMQBFZpwrFTPMiPtplhqRjidlvqxohEmEzyivQwFDqhy0/zYKTrKnCHyQ5k9oVHufp9IcaBUEnhZ4D1WP2uzcz/ar1Y+03ZSKNRVkvsiPOdIhmv0cDZmkRPMkA0wky25FZIwlJjrLp5SHYNfrTbuB5tCwPqH5FUKnXrMaNfPSrTseRpQhAM4hCpYcAotuIA2OECAwR08wKMhjHvjyXietxaMxcw+/JDx8gGlko+A</latexit>

[i, j]

<latexit sha1_base64="K+lfoJOS9nSwJe0ZcE70FEFEi0g=">AB7HicbZDLSsNAFIZPvNZ6q7p0M1gEF1KSNmB3Fty4rGDaQhrKZDpx04mYWYilNBncONCEbc+kDvfwkcwTap4+2Hg4z/ncM78fsyZ0qb5Ziwtr6yurZc2yptb2zu7lb39joSahDIh7Jno8V5UxQRzPNaS+WFIc+p1/cjGvd2+pVCwS13oaUy/EI8ECRrDOLMdlpzfeoFI1a2Yu9BesBVTP3yFXe1B57Q8jkoRUaMKxUq5lxtpLsdSMcDor9xNFY0wmeETdDAUOqfLS/NgZOs6cIQoimT2hUe5+n0hxqNQ09LPOEOux+l2bm/V3EQHTS9lIk40FaRYFCQc6QjNf46GTFKi+TQDTCTLbkVkjCUmOsunIdg1+tNu4EKaFif0PwKoVOvWY2aeWVXW3aRBpTgEI7gBCw4gxZcQhscIMDgDh7g0RDGvfFkPBetS8Zi5gB+yHj5ABTVj8k=</latexit>

|y − j|

<latexit sha1_base64="9ZETbBKW/qX7fUYMYQgOk81h7M=">AB7HicbZDLSsNAFIZPvNZ6q7p0M1gEN5akDdidBTcuK5i20IYymU7asZNJmJkIoe0zuHGhiFsfyJ1v4SOYJlW8/TDw8Z9zOGd+L+JMadN8M5aWV1bX1gsbxc2t7Z3d0t5+S4WxJNQhIQ9lx8OKciao5nmtBNJigOP07Y3vpjX27dUKhaKa51E1A3wUDCfEaxTy5kmpzfTfqlsVsxM6C9YCyifv0OmZr/02huEJA6o0IRjpbqWGWl3gqVmhNZsRcrGmEyxkPaTVHgCp3kh07Q8epM0B+KNMnNMrc7xMTHCiVBF7aGWA9Ur9rc/O/WjfWft2dMBHFmgqSL/JjnSI5j9HAyYp0TxJARPJ0lsRGWGJiU7zKWYh2NVq3a6hHGrWJ9S/QmhVK1atYl7Z5YadpwEFOIQjOAELzqABl9AEBwgwuIMHeDSEcW8Gc9565KxmDmAHzJePgCQT5Aa</latexit>

|x − i|

<latexit sha1_base64="SbWzCKrM1Pz5uOEGkhVFWFTj2WI=">AB7HicbZDLSsNAFIZP6q3W9Wlm8EiuLEkbcDuLhxWcG0QhvKZDph04mYWYilrTP4MaFIm59IHe+hY9gmlTx9sPAx3/O4Zz5vYgzpU3zSgsLa+srhXSxubW9s75d29tgpjSahDQh7Kaw8rypmgjma0+tIUhx4nHa8fm83rmhUrFQXOlJRN0ADwXzGcE6tZzp7Qmb9sVs2pmQn/BWkDl7B0ytfrl194gJHFAhSYcK9W1zEi7CZaEU5npV6saITJGA9pN0WBA6rcJDt2ho5SZ4D8UKZPaJS53ycSHCg1Cby0M8B6pH7X5uZ/tW6s/YabMBHFmgqSL/JjnSI5j9HAyYp0XySAiaSpbciMsISE53mU8pCsGu1hl1HOdStT2h8hdCuVa161by0K07TwOKcACHcAwWnEITLqAFDhBgcAcP8GgI4954Mp7z1oKxmNmHzJePgCNQ5AY</latexit>
slide-68
SLIDE 68

Lecture 3 • Cornell CS4620 Fall 2019

Optimized separable resampling

  • for larger fjlters, separability provides an opportunity for an
  • ptimization
  • resample in two passes, one resampling each row and one

resampling each column

  • intermediate storage required: product of one dimension of source

and the other dimension of destination

39

slide-69
SLIDE 69

Lecture 3 • Cornell CS4620 Fall 2019

two-stage resampling using a
 separable fjlter

[Philip Greenspun] 40

O(rNsrcMdst)

<latexit sha1_base64="0xCvQSYbm7FDGJhnNsBrIeMA=">ACBXicbZC7SgNBFIbPxluMt6ilFoNBiE3YTQKmM2Bjo0YwF0hCmJ1MkiGzF2bOimFJY+Or2FgoYus72PkWPoKbTRvPwx8/P85zMxv+1JoNM03IzE3v7C4lFxOrayurW+kN7dq2gsU41XmSU81bKq5FC6vokDJG7i1LElr9vD40lev+JKC8+9xJHP2w7tu6InGMXI6qR3z7PqrNCfo2hVmx8OuOuxvFBJ50xc2Ys8hesGWSO3iFWpZN+bXU9FjcRSap1k3L9LEdUoWCST5OtQLNfcqGtM+bEbrU4bodxr8Yk/3I6ZKep6LjIond7xshdbQeOXY06VAc6N/ZxPwvawbYK7VD4foBcpdNL+oFkqBHJpWQrlCcoRxFQJkS0VsJG1BFGUbFpeISivl8qVgUyhYn1D6KqGWz1mFnHlRzJSL0zYgCTuwB1mw4BDKcAIVqAKDG7iDB3g0bo1748l4no4mjNnONvyQ8fIBzRqaWQ=</latexit>

O(rNdstMdst)

<latexit sha1_base64="i94oKk1Fhg/6KMdClQOS4bpyO3w=">ACBXicbZC7SgNBFIbPeo3xFrXUYjAIsQm7ScB0Bmxs1AjmAkIs5NJMmT2wsxZMSxpbHwVGwtFbH0HO9/CR3CziRIvPwx8/P85zMxv+1JoNM13Y25+YXFpObGSXF1b39hMbW1XtRcoxivMk56q21RzKVxeQYGS13FqWNLXrMHJ+O8ds2VFp57hUOftxzac0VXMIqR1U7tXWTUebuJ/AbDjsbR2QwftlNpM2vGIn/BmkL6+ANildupt2bHY4HDXWSat2wTB9bIVUomOSjZDPQ3KdsQHu8EaFLHa5bYfyLETmInA7peio6LpLYnd0IqaP10LGjSYdiX/OxuZ/WSPAbrEVCtcPkLtsclE3kAQ9Mq6EdITiDOUwAsqUiN5KWJ8qyjAqLhmXUMjlioU8mUDe+oLidwnVXNbKZ83LQrpUmLQBCdiFfciABUdQglMoQwUY3MI9PMKTcWc8GM/Gy2R0zpju7MAPGa+f0bOaXA=</latexit>

O(r2NdstMdst)

<latexit sha1_base64="VQEX6BGf+q8wLAL3pXoDs6pW7Q0=">ACB3icbZDLSsNAFIZP6r3eqi4FGSyCbkqSFuxOwY0b2Ct0MYymU516OTCzIlYQndufBU3LhRx6yu48y18BNOkSr38MPDx/+cwM78bSqHRN+N3Nj4xOTU9Ex+dm5+YbGwtHymg0gxXmOBDNS5SzWXwuc1FCj5eag49VzJ6253b5DXr7nSIvBPsRdyx6OXvugIRjGxWoW1o01YR+2mshvMG5r7B+M8FarUDRLZiryF6whFHc+INVxq/DWbAcs8riPTFKtG5YZohNThYJ3s83I81Dyr0kjcS9KnHtROn/+iTjcRpk06gkuMjSd3RjZh6Wvc8N5n0KF7p39nA/C9rRNipOrHwi5z7KLOpEkGJBKaQtFGcoewlQpkTyVsKuqKIMk+ryaQkV265WyiSDsvUF1e8SzuySVS6ZJ5XibiVrA6ZhFdZhEyzYhl3Yh2OoAYNbuIdHeDLujAfj2XjJRnPGcGcFfsh4/QGxZsA</latexit>
slide-70
SLIDE 70

Lecture 3 • Cornell CS4620 Fall 2019

A gallery of fjlters

  • Box fjlter

Simple and cheap

  • Tent fjlter

Linear interpolation

  • Gaussian fjlter

Very smooth antialiasing fjlter

  • B-spline cubic

Very smooth

  • Catmull-rom cubic

Interpolating

  • Mitchell-Netravali cubic

Good for image upsampling

41

slide-71
SLIDE 71

Lecture 3 • Cornell CS4620 Fall 2019

Box fjlter

42

slide-72
SLIDE 72

Lecture 3 • Cornell CS4620 Fall 2019

Tent fjlter

43

slide-73
SLIDE 73

Lecture 3 • Cornell CS4620 Fall 2019

Gaussian fjlter

44

slide-74
SLIDE 74

Lecture 3 • Cornell CS4620 Fall 2019

B-Spline cubic

45

fB(x) = 1 6      −3(1 − |x|)3 + 3(1 − |x|)2 + 3(1 − |x|) + 1 −1 ≤ x ≤ 1, (2 − |x|)3 1 ≤ |x| ≤ 2,

  • therwise.
slide-75
SLIDE 75

Lecture 3 • Cornell CS4620 Fall 2019

Catmull-Rom cubic

46

fC(x) = 1 2      −3(1 − |x|)3 + 4(1 − |x|)2 + (1 − |x|) −1 ≤ x ≤ 1, (2 − |x|)3 − (2 − |x|)2 1 ≤ |x| ≤ 2,

  • therwise.
slide-76
SLIDE 76

Lecture 3 • Cornell CS4620 Fall 2019

Michell-Netravali cubic

47

fM(x) = 1 3fB(x) + 2 3fC(x) = 1 18      −21(1 − |x|)3 + 27(1 − |x|)2 + 9(1 − |x|) + 1 −1 ≤ x ≤ 1, 7(2 − |x|)3 − 6(2 − |x|)2 1 ≤ |x| ≤ 2,

  • therwise.
slide-77
SLIDE 77

Lecture 3 • Cornell CS4620 Fall 2019

Lanczos

48

1

  • 2
  • 1

1 2 1

  • 3
  • 2
  • 1

1 2 3

fL2(x) = ( sinc(x) sinc(x/2) |x| < 2

  • therwise

fL3(x) = ( sinc(x) sinc(x/3) |x| < 3

  • therwise

sinc(x) = sin(πx) πx

slide-78
SLIDE 78

Lecture 3 • Cornell CS4620 Fall 2019

Effects of reconstruction fjlters

  • For some fjlters, the reconstruction process winds up implementing a

simple algorithm

  • Box fjlter (radius 0.5): nearest neighbor sampling

box always catches exactly one input point it is the input point nearest the output point so output[i, j] = input[round(x(i)), round(y(j))]
 x(i) computes the position of the output coordinate i on the input grid

  • Tent fjlter (radius 1): linear interpolation

tent catches exactly 2 input points weights are a and (1 – a) result is straight-line interpolation from one point to the next

49

slide-79
SLIDE 79

Lecture 3 • Cornell CS4620 Fall 2019

Properties of fjlters

  • Degree of continuity
  • Impulse response
  • Interpolating or no
  • Ringing, or overshoot

interpolating filter used for reconstruction

50

slide-80
SLIDE 80

Lecture 3 • Cornell CS4620 Fall 2019

Ringing, overshoot, ripples

  • Overshoot

caused by
 negative fjlter
 values

  • Ripples

constant in, 
 non-const. out ripple free when:

51

slide-81
SLIDE 81

Lecture 3 • Cornell CS4620 Fall 2019

Constructing 2D fjlters

  • Separable fjlters (most common approach)

52

slide-82
SLIDE 82

Lecture 3 • Cornell CS4620 Fall 2019

Yucky details

  • What about near the edge?

the fjlter window falls off the edge of the image need to extrapolate methods:

  • clip fjlter (black)
  • wrap around
  • copy edge
  • refmect across edge
  • vary fjlter near edge

53 [Philip Greenspun]

slide-83
SLIDE 83

Lecture 3 • Cornell CS4620 Fall 2019

Yucky details

  • What about near the edge?

the fjlter window falls off the edge of the image need to extrapolate methods:

  • clip fjlter (black)
  • wrap around
  • copy edge
  • refmect across edge
  • vary fjlter near edge

53 [Philip Greenspun]

slide-84
SLIDE 84

Lecture 3 • Cornell CS4620 Fall 2019

Yucky details

  • What about near the edge?

the fjlter window falls off the edge of the image need to extrapolate methods:

  • clip fjlter (black)
  • wrap around
  • copy edge
  • refmect across edge
  • vary fjlter near edge

53 [Philip Greenspun]

slide-85
SLIDE 85

Lecture 3 • Cornell CS4620 Fall 2019

Yucky details

  • What about near the edge?

the fjlter window falls off the edge of the image need to extrapolate methods:

  • clip fjlter (black)
  • wrap around
  • copy edge
  • refmect across edge
  • vary fjlter near edge

53 [Philip Greenspun]

slide-86
SLIDE 86

Lecture 3 • Cornell CS4620 Fall 2019

Yucky details

  • What about near the edge?

the fjlter window falls off the edge of the image need to extrapolate methods:

  • clip fjlter (black)
  • wrap around
  • copy edge
  • refmect across edge
  • vary fjlter near edge

53 [Philip Greenspun]

slide-87
SLIDE 87

Lecture 3 • Cornell CS4620 Fall 2019

Yucky details

  • What about near the edge?

the fjlter window falls off the edge of the image need to extrapolate methods:

  • clip fjlter (black)
  • wrap around
  • copy edge
  • refmect across edge
  • vary fjlter near edge

53 [Philip Greenspun]

slide-88
SLIDE 88

Lecture 3 • Cornell CS4620 Fall 2019

Yucky details

  • What about near the edge?

the fjlter window falls off the edge of the image need to extrapolate methods:

  • clip fjlter (black)
  • wrap around
  • copy edge
  • refmect across edge
  • vary fjlter near edge

53 [Philip Greenspun]

slide-89
SLIDE 89

Lecture 3 • Cornell CS4620 Fall 2019

Yucky details

  • What about near the edge?

the fjlter window falls off the edge of the image need to extrapolate methods:

  • clip fjlter (black)
  • wrap around
  • copy edge
  • refmect across edge
  • vary fjlter near edge

53 [Philip Greenspun]

slide-90
SLIDE 90

Lecture 3 • Cornell CS4620 Fall 2019

Yucky details

  • What about near the edge?

the fjlter window falls off the edge of the image need to extrapolate methods:

  • clip fjlter (black)
  • wrap around
  • copy edge
  • refmect across edge
  • vary fjlter near edge

53 [Philip Greenspun]

slide-91
SLIDE 91

Lecture 3 • Cornell CS4620 Fall 2019

Yucky details

  • What about near the edge?

the fjlter window falls off the edge of the image need to extrapolate methods:

  • clip fjlter (black)
  • wrap around
  • copy edge
  • refmect across edge
  • vary fjlter near edge

53 [Philip Greenspun]

slide-92
SLIDE 92

Lecture 3 • Cornell CS4620 Fall 2019

Yucky details

  • What about near the edge?

the fjlter window falls off the edge of the image need to extrapolate methods:

  • clip fjlter (black)
  • wrap around
  • copy edge
  • refmect across edge
  • vary fjlter near edge

53 [Philip Greenspun]

slide-93
SLIDE 93

Lecture 3 • Cornell CS4620 Fall 2019

Yucky details

  • What about near the edge?

the fjlter window falls off the edge of the image need to extrapolate methods:

  • clip fjlter (black)
  • wrap around
  • copy edge
  • refmect across edge
  • vary fjlter near edge

53 [Philip Greenspun]

slide-94
SLIDE 94

Lecture 3 • Cornell CS4620 Fall 2019

Yucky details

  • What about near the edge?

the fjlter window falls off the edge of the image need to extrapolate methods:

  • clip fjlter (black)
  • wrap around
  • copy edge
  • refmect across edge
  • vary fjlter near edge

53 [Philip Greenspun]

slide-95
SLIDE 95

Lecture 3 • Cornell CS4620 Fall 2019

Reducing and enlarging

  • Very common operation

devices have differing resolutions applications have different memory/quality tradeoffs

  • Also very commonly done poorly
  • Simple approach: drop/replicate pixels
  • Correct approach: use resampling

54

slide-96
SLIDE 96

Lecture 3 • Cornell CS4620 Fall 2019

1000 pixel width

[Philip Greenspun] 55

slide-97
SLIDE 97

Lecture 3 • Cornell CS4620 Fall 2019

250 pixel width by dropping pixels gaussian fjlter

[Philip Greenspun] 56

slide-98
SLIDE 98

Lecture 3 • Cornell CS4620 Fall 2019

4000 pixel width box reconstruction fjlter bicubic reconstruction fjlter

[Philip Greenspun] 57

slide-99
SLIDE 99

Lecture 3 • Cornell CS4620 Fall 2019

Types of artifacts

  • Garden variety

what we saw in this natural image fjne features become jagged or sparkle

  • Moiré patterns

58

slide-100
SLIDE 100

Lecture 3 • Cornell CS4620 Fall 2019

600ppi scan of a color halftone image

[Hearn & Baker cover] 59

slide-101
SLIDE 101

Lecture 3 • Cornell CS4620 Fall 2019

downsampling a high resolution scan by dropping pixels gaussian fjlter

[Hearn & Baker cover] 60

slide-102
SLIDE 102

Lecture 3 • Cornell CS4620 Fall 2019

Types of artifacts

  • Garden variety

what we saw in this natural image fjne features become jagged or sparkle

  • Moiré patterns

caused by repetitive patterns in input produce large-scale artifacts; highly visible

  • These artifacts are aliasing just like in the audio example earlier
  • How do I know what fjlter is best at preventing aliasing?

practical answer: experience theoretical answer: there is another layer of cool math behind all this

  • based on Fourier transforms
  • provides much insight into aliasing, fjltering, sampling, and reconstruction

61