Sampling and Reconstruction - Computer...

72
Sampling and Reconstruction COMP 575/770 Spring 2013

Transcript of Sampling and Reconstruction - Computer...

Page 1: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Sampling and Reconstruction

COMP 575/770 Spring 2013

Page 2: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

What is a pixel?

A little square of color?

Page 3: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

What is a pixel?

A little rectangle of color?

Page 4: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

What is a pixel?

A little blob of color?

Page 5: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

What is a pixel?

Ans: None of the above.

A pixel is not a little square! Alvy Ray Smith, Microsoft Tech Memo, 1995

http://alvyray.com/Memos/CG/Microsoft/6_pixel.pdf

Page 6: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

What is a pixel?

An image is a continuous 2D function 𝑓 𝑥, 𝑦 = color at (𝑥, 𝑦)

𝑥

𝑦

Page 7: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

What is a pixel?

An image is a continuous 2D function 𝑓 𝑥, 𝑦 = color at 𝑥, 𝑦

A pixel is a point sample

– Value of the function at a single point

𝑥

𝑦

Page 8: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Examples of pixel sampling

A ray tracer samples an image along each ray

A digital camera samples an image at each sensor

j

i

i =

–.5

i =

3.5

j = 2.5

j = –.5

Page 9: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Why the misconception?

To understand, we need digital signal processing (DSP) theory

Origins in audio processing

– CDs, MP3s contain sampled sound signals

A signal is any function, typically of time

– Pressure (for sound)

– Voltage (for network communications)

Page 10: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Outline

Introduction

Sampling

Page 11: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Sampling

Computers can’t work with continuous data

– Unless there’s a closed-form representation

Evaluate the function at several points

Which points?

– At regular intervals?

– More on this later

Page 12: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Outline

Introduction

Sampling

Reconstruction

Page 13: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Reconstruction

What’s the function’s value between samples?

Page 14: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Reconstruction

What’s the function’s value between samples?

Assume function is constant between samples?

Page 15: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Reconstruction

What’s the function’s value between samples?

Assume function is linear between samples?

Page 16: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Reconstruction

What’s the function’s value between samples?

Assume some higher-order polynomial?

Page 17: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Reconstruction

What is the best choice?

Ans: It depends.

– Which is easier?

– Which one is more accurate?

– Does the underlying function have special properties?

– What is the application?

To make an informed decision, need to understand properties of filters

Page 18: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Filters

A filter is a kind of function

– Could be continuous or discrete (sampled)

When applied to a signal, transforms it in some way

– Bass/treble controls on an equalizer

– Echo, reverb, distortion effects

– Image blurring

– Reconstruction

Applying a filter to a signal is called convolution

Page 19: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Outline

Introduction

Sampling

Reconstruction

Convolution

Page 20: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Convolution: An Example

1 2 7 4 3

𝑎[0] 𝑎[1] 𝑎[2] 𝑎[3] 𝑎[4]

Suppose we want to replace each element with the average of its neighbors

𝑏 𝑖 =𝑎 𝑖 − 1 + 𝑎 𝑖 + 𝑎[𝑖 + 1]

3

Page 21: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Convolution: An Example

1/3 1/3 1/3

× × ×

1 2 7 4 3

𝑎[0] 𝑎[1] 𝑎[2] 𝑎[3] 𝑎[4]

3.33

𝑏[0] 𝑏[1] 𝑏[2] 𝑏[3] 𝑏[4]

Page 22: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Convolution: An Example

1/3 1/3 1/3

× × ×

1 2 7 4 3

𝑎[0] 𝑎[1] 𝑎[2] 𝑎[3] 𝑎[4]

3.33 4.33

𝑏[0] 𝑏[1] 𝑏[2] 𝑏[3] 𝑏[4]

Page 23: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Convolution: An Example

1/3 1/3 1/3

× × ×

1 2 7 4 3

𝑎[0] 𝑎[1] 𝑎[2] 𝑎[3] 𝑎[4]

3.33 4.33 4.67

𝑏[0] 𝑏[1] 𝑏[2] 𝑏[3] 𝑏[4]

Page 24: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Convolution: An Example

𝑓[1] 𝑓[0] 𝑓[−1]

1/3 1/3 1/3

× × ×

1 2 7 4 3

𝑎[0] 𝑎[1] 𝑎[2] 𝑎[3] 𝑎[4]

3.33 4.33 4.67

𝑏[0] 𝑏[1] 𝑏[2] 𝑏[3] 𝑏[4]

Filter

Page 25: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Convolution: An Example

𝑓[1] 𝑓[0] 𝑓[−1]

1/3 1/3 1/3

× × ×

1 2 7 4 3

𝑎[0] 𝑎[1] 𝑎[2] 𝑎[3] 𝑎[4]

3.33 4.33 4.67

𝑏[0] 𝑏[1] 𝑏[2] 𝑏[3] 𝑏[4]

Filter

𝑏 𝑖 = 𝑎 𝑖 − 1 𝑓 1 + 𝑎 𝑖 𝑓 0 + 𝑎 𝑖 + 1 𝑓 −1

= 𝑎 𝑗 𝑓[𝑖 − 𝑗]

𝑖+1

𝑗=𝑖−1

Page 26: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Convolution: An Example

1/3 1/3 1/3

× × ×

? 1 2 7 4 3

𝑎[−1] 𝑎[0] 𝑎[1] 𝑎[2] 𝑎[3] 𝑎[4]

? 3.33 4.33 4.67

𝑏[0] 𝑏[1] 𝑏[2] 𝑏[3] 𝑏[4]

What happens at the edges of the signal?

Page 27: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Convolution: An Example

1/3 1/3 1/3

× × ×

0 1 2 7 4 3

𝑎[−1] 𝑎[0] 𝑎[1] 𝑎[2] 𝑎[3] 𝑎[4]

1 3.33 4.33 4.67

𝑏[0] 𝑏[1] 𝑏[2] 𝑏[3] 𝑏[4]

Could assume that signal is 0 beyond its edges

Page 28: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Convolution: An Example

1/3 1/3 1/3

× × ×

3 1 2 7 4 3

𝑎[−1] 𝑎[0] 𝑎[1] 𝑎[2] 𝑎[3] 𝑎[4]

2 3.33 4.33 4.67

𝑏[0] 𝑏[1] 𝑏[2] 𝑏[3] 𝑏[4]

Could assume the signal is periodic (𝑎[𝑖] = 𝑎[𝑖 + 5])

Page 29: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Convolution: Another Example

1 2 7 4 3

𝑎[0] 𝑎[1] 𝑎[2] 𝑎[3] 𝑎[4]

Suppose we want to replace each element with the following difference

𝑏 𝑖 = 𝑎 𝑖 − 𝑎[𝑖 − 1]

Rewriting as a convolution:

𝑏 𝑖 = 𝑎 𝑖 𝑓 0 + 𝑎 𝑖 − 1 𝑓[1]

1 -1

𝑓[0] 𝑓[1]

Page 30: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Properties of Filters

Region of support

– Area over which the filter is non-zero

Filters are normalized to sum to 1

– Makes them a weighted average, not just a weighted sum

– Blurring an image shouldn’t make it brighter/darker

Most filters are symmetric about 0

– Don’t want to give preferential treatment to any direction

Page 31: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Properties of Convolution

Commutative 𝑎 ⋆ 𝑏 = 𝑏 ⋆ 𝑎

Associative 𝑎 ⋆ 𝑏 ⋆ 𝑐 = 𝑎 ⋆ 𝑏 ⋆ 𝑐

Distributes over addition 𝑎 ⋆ 𝑏 + 𝑐 = 𝑎 ⋆ 𝑏 + 𝑎 ⋆ 𝑐

Scalars factor out 𝛼𝑎 ⋆ 𝑏 = 𝑎 ⋆ 𝛼𝑏 = 𝛼(𝑎 ⋆ 𝑏)

Identity: unit impulse e = […, 0, 0, 0, 1, 0, 0, 0, …] 𝑎 ⋆ 𝑒 = 𝑎

Page 32: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Properties of Convolution

This makes filtering a linear operation:

𝑓𝑖𝑙𝑡𝑒𝑟 𝑎 + 𝑏 = 𝑓𝑖𝑙𝑡𝑒𝑟 𝑎 + 𝑓𝑖𝑙𝑡𝑒𝑟 𝑏 𝑓𝑖𝑙𝑡𝑒𝑟 𝛼𝑎 = 𝛼𝑓𝑖𝑙𝑡𝑒𝑟 𝑎

Filtering is also shift invariant

– Delaying an audio signal doesn’t change the filter’s effect

– Moving an image doesn’t make blurring work differently

Page 33: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Convolution: Continuous Filters

Convolution with a discrete filter:

𝑎 ⋆ 𝑓 𝑖 = 𝑎 𝑗 𝑓[𝑖 − 𝑗]

𝑗

Convolution with a continuous filter:

𝑎 ⋆ 𝑓 𝑥 = 𝑎 𝑗 𝑓(𝑥 − 𝑗)

𝑗

Continuous filters are used for reconstruction

Page 34: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Examples of Filters

Box Filter Simple, often useful

Page 35: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Examples of Filters

Tent filter Performs linear interpolation

Page 36: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Examples of Filters

Gaussian filter Smooth filter, often used for blurring

Page 37: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Examples of Filters

Cubic B-spline filter Smooth filter

Page 38: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Examples of Filters

Catmull-Rom cubic filter Smooth interpolating filter

Page 39: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Examples of Filters

Mitchell-Netravali filter Good for image upsampling

Page 40: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

2D Convolution

Straightforward extension of 1D convolution

Convolution with a 2D discrete filter:

Convolution with a 2D continuous filter:

𝑎 ⋆ 𝑓 𝑥, 𝑦 = 𝑎 𝑖, 𝑗 𝑓(𝑥 − 𝑖, 𝑦 − 𝑗)

𝑖,𝑗

Page 41: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

2D Convolution Example

1 1 2 3 1 1 2 1

4 3 7 2 4 2 4 2

5 6 1 2 3 1 2 1

9 1 3 5 8 𝑓

1 6 1 0 2

𝑎 𝑏

Page 42: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

2D Convolution Example

1 1 2 3 1 1 2 1

4 3 7 2 4 × 2 4 2 = 57

5 6 1 2 3 1 2 1

9 1 3 5 8 𝑓

1 6 1 0 2

𝑎 𝑏

Page 43: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Example of 2D Filtering

Gaussian blur

Page 44: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

2D Convolution Complexity

1 1 2 3 1 1 2 1

4 3 7 2 4 × 2 4 2 = 57

5 6 1 2 3 1 2 1

9 1 3 5 8 𝑓

1 6 1 0 2

𝑎 𝑏

𝑂 𝑟2 multiplications per output sample

Page 45: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Separable Filters

We can do better with special kinds of filters

A filter is separable if:

Page 46: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Separable Filters

Separable filters allow factoring:

2D filtering expressed as repeated 1D filtering

Page 47: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

2D Convolution Example

1 1 2 3 1 × 1 2 1 5

4 3 7 2 4 × 1 2 1 = 17

5 6 1 2 3 × 1 2 1 18

9 1 3 5 8 𝑓𝑥

1 6 1 0 2

𝑎 𝑏

Page 48: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

2D Convolution Example

5 1

17 × 2 = 57

18 1

𝑓𝑦

𝑎 𝑏

𝑂 𝑟 multiplications per output sample

Page 49: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Outline

Introduction

Sampling

Reconstruction

Convolution

Image Reconstruction

Page 50: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Why the misconception?

So, why do we mistake pixels for little squares?

Ans: Shoddy reconstruction

– Use a simple box filter

– With just one sample in its support j

i

i =

–.5

i =

3.5

j = 2.5

j = –.5

Page 51: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Reconstruction Example

Original image

Page 52: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Reconstruction Example

Magnified image, box filter

Page 53: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Reconstruction Example

Magnified image, cubic filter

Page 54: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Reconstruction Example

Page 55: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Outline

Introduction

Sampling

Reconstruction

Convolution

Image Reconstruction

Anti-Aliasing

Page 56: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Aliasing

Undesirable artifacts that occur when enough samples are not taken

Example: “Jaggies” on the boundaries of objects

Page 57: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Aliasing

Indistinguishable after sampling

Hence the term “aliasing”

Page 58: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Anti-Aliasing

Or, how to get rid of aliasing artifacts

Use information from multiple samples per pixel: 1. Generate multiple

samples of the image for each pixel

2. Apply a reconstruction filter

3. Evaluate the reconstructed function at the pixel

j

i

i =

–.5

i =

3.5

j = 2.5

j = –.5

Page 59: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Anti-Aliasing

Aliased Anti-Aliased

Page 60: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Anti-Aliasing

Page 61: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Outline

Introduction

Sampling

Reconstruction

Convolution

Image Reconstruction

Anti-Aliasing

Sampling Strategies

Page 62: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Sampling Strategies

Final detail: Where to place the additional samples?

Can have a surprising impact on results

– Good sampling strategies give better images with fewer samples (i.e., less time!)

Page 63: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Sampling Strategies

Regular sampling Place samples at regular intervals

Page 64: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Sampling Strategies

Uniform sampling Sample positions chosen based on a uniform probability distribution

Page 65: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Sampling Strategies

Stratified sampling Divide into subdomains, use uniform sampling within each

Page 66: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple
Page 67: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple
Page 68: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

BACKUP

Page 69: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Convolution: An Example

Want to replace each sample with an average of nearby samples

Straightforward:

Page 70: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Convolution: An Example

Convolution just replaces a simple average with a weighted average:

The sequence 𝑎[𝑗] is the (discrete) filter

Page 71: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Complexity of 2D Convolution

𝑂(𝑟2) Too slow for large filters!

Page 72: Sampling and Reconstruction - Computer Sciencegamma.cs.unc.edu/.../06_sampling_and_reconstruction.pdfAnti-Aliasing Or, how to get rid of aliasing artifacts Use information from multiple

Separable Filtering

first, convolve with this

second, convolve with this