# image resampling

Post on 22-Jan-2016

65 views

Embed Size (px)

DESCRIPTION

CS4670: Computer Vision. Noah Snavely. Image Resampling. Image Scaling. This image is too big to fit on the screen. How can we generate a half-sized version?. Source: S. Seitz. Image sub-sampling. 1/8. 1/4. Throw away every other row and column to create a 1/2 size image - PowerPoint PPT PresentationTRANSCRIPT

Image ResamplingCS4670: Computer VisionNoah Snavely

Image ScalingThis image is too big to fit on the screen. How can we generate a half-sized version?

Source: S. Seitz

Image sub-samplingThrow away every other row and column to create a 1/2 size image- called image sub-sampling1/41/8Source: S. Seitz

Image sub-sampling1/4 (2x zoom)1/8 (4x zoom)Why does this look so crufty?1/2Source: S. Seitz

Image sub-samplingSource: F. Durand

Even worse for synthetic imagesSource: L. Zhang

AliasingOccurs when your sampling rate is not high enough to capture the amount of detail in your imageCan give you the wrong signal/imagean alias

To do sampling right, need to understand the structure of your signal/imageEnter Monsieur Fourier

To avoid aliasing:sampling rate 2 * max frequency in the imagesaid another way: two samples per cycleThis minimum sampling rate is called the Nyquist rate

Source: L. Zhang

Wagon-wheel effect(See http://www.michaelbach.de/ot/mot_wagonWheel/index.html)Source: L. Zhang

Alias: n., an assumed namePicket fence recedingInto the distance willproduce aliasing

Nyquist limit 2D exampleGood sampling

Bad sampling

AliasingWhen downsampling by a factor of twoOriginal image has frequencies that are too high

How can we fix this?

Gaussian pre-filteringG 1/4G 1/8Gaussian 1/2Solution: filter the image, then subsample

Source: S. Seitz

Subsampling with Gaussian pre-filteringG 1/4 G 1/8Gaussian 1/2Solution: filter the image, then subsampleSource: S. Seitz

Compare with...1/4 (2x zoom)1/8 (4x zoom)1/2Source: S. Seitz

Gaussian pre-filteringSolution: filter the image, then subsample

{Gaussian pyramid

{Gaussian pyramid

The Gaussian PyramidHigh resolutionLow resolution

Gaussian pyramids [Burt and Adelson, 1983]

In computer graphics, a mip map [Williams, 1983]A precursor to wavelet transform

Gaussian Pyramids have all sorts of applications in computer visionSource: S. Seitz

Gaussian pyramids [Burt and Adelson, 1983]

How much space does a Gaussian pyramid take compared to the original image?Source: S. Seitz

Gaussian Pyramid

Gaussian PyramidLaplacian PyramidThe Laplacian Pyramid

Questions?

UpsamplingThis image is too small for this screen:How can we make it 10 times as big?Simplest approach: repeat each row and column 10 times(Nearest neighbor interpolation)

Image interpolationRecall how a digital image is formed

It is a discrete point-sampling of a continuous functionIf we could somehow reconstruct the original function, any new image could be generated, at any resolution and scale 12345Adapted from: S. Seitzd = 1 in this example

Image interpolation12345d = 1 in this exampleRecall how a digital image is formed

It is a discrete point-sampling of a continuous functionIf we could somehow reconstruct the original function, any new image could be generated, at any resolution and scale Adapted from: S. Seitz

Image interpolation123452.51

Convert to a continuous function:

Reconstruct by convolution with a reconstruction filter, hWhat if we dont know ?d = 1 in this exampleAdapted from: S. Seitz

Image interpolationIdeal reconstructionNearest-neighbor interpolationLinear interpolationGaussian reconstructionSource: B. Curless

Reconstruction filtersWhat does the 2D version of this hat function look like?Often implemented without cross-correlationE.g., http://en.wikipedia.org/wiki/Bilinear_interpolation Better filters give better resampled imagesBicubic is common choiceperforms linear interpolation(tent function) performs bilinear interpolationCubic reconstruction filter

Image interpolationNearest-neighbor interpolationBilinear interpolationBicubic interpolationOriginal image: x 10

Image interpolationAlso used for resampling

Questions?

********

Recommended