image processing basics

33
Image Processing Basics

Upload: chun-hui-tan

Post on 19-Feb-2016

216 views

Category:

Documents


0 download

DESCRIPTION

image processing

TRANSCRIPT

Page 1: Image Processing Basics

Image Processing Basics

Page 2: Image Processing Basics

What are images?

An image is a 2-d rectilinear array of pixels

Page 3: Image Processing Basics

Pixels as samples

A pixel is a sample of a continuous function

Page 4: Image Processing Basics

Images are Ubiquitous

Input Optical photoreceptors Digital camera CCD array Rays in virtual camera (why?)

Output TVs Computer monitors Printers

Page 5: Image Processing Basics

Properties of Images

Spatial resolution Width pixels/width cm and height pixels/ height cm

Intensity resolution Intensity bits/intensity range (per channel)

Number of channels RGB is 3 channels, grayscale is one channel

Page 6: Image Processing Basics

Image errors

Spatial aliasing Not enough spatial resolution

Intensity quantization Not enough intensity resolution

Page 7: Image Processing Basics

Two issues

Sampling and reconstruction Creating and displaying images while reducing

spatial aliasing errors

Halftoning techniques Dealing with intensity quantization

Page 8: Image Processing Basics

Sampling and reconstruction

Page 9: Image Processing Basics

Aliasing

Artifacts caused by too low sampling frequency (undersampling) or improper reconstructionUndersampling rate determined by Nyquist limit (Shannon’s sampling theorem)

Page 10: Image Processing Basics

Aliasing in computer graphics

In graphics, two major types Spatial aliasing

Problems in individual images Temporal aliasing

Problems in image sequences (motion)

Page 11: Image Processing Basics

Spatial Aliasing

“Jaggies”

Page 12: Image Processing Basics

Spatial aliasing

Ref: SIGGRAPH aliasing tutorial

Page 13: Image Processing Basics

Spatial aliasing

Texture disintegration

Ref: SIGGRAPH aliasing tutorial

Page 14: Image Processing Basics

Temporal aliasing

Strobing Stagecoach wheels in movies

Flickering Monitor refresh too slow Frame update rate too slow CRTs seen on other video screens

Page 15: Image Processing Basics

Antialiasing

Sample at a higher rate What if the signal isn’t bandlimited? What if we can’t do this, say because the sampling

device has a fixed resolution?

Pre-filter to form bandlimited signal Low pass filter Trades aliasing for blurring

Non-uniform sampling Not always possible, done by your visual system,

suitable for ray tracing Trades aliasing for noise

Page 16: Image Processing Basics

Sampling Theory

Two issues What sampling rate suffices to allow a given

continuous signal to be reconstructed from a discrete sample without loss of information?

What signals can be reconstructed without loss for a given sampling rate?

Page 17: Image Processing Basics

Spectral Analysis

Spatial (time) domain: Frequency domain:

Any (spatial, time) domain signal (function) can be written as a sum of periodic functions (Fourier)

Page 18: Image Processing Basics

Fourier Transform

Page 19: Image Processing Basics

Fourier Transform

Fourier transform:

Inverse Fourier transform:

dxexfuF xui

2)()(

dueuFxf xui

2)()(

Page 20: Image Processing Basics

Sampling theorem

A signal can be reconstructed from its samples if the signal contains no frequencies above ½ the sampling frequency.

-Claude ShannonThe minimum sampling rate for a bandlimited signal is called the Nyquist rateA signal is bandlimited if all frequencies above a given finite bound have 0 coefficients, i.e. it contains no frequencies above this bound.

Page 21: Image Processing Basics

Filtering and convolution

Convolution of two functions (= filtering):

Convolution theorem: Convolution in the frequency domain is the same as

multiplication in the spatial (time) domain, and Convolution in the spatial (time) domain is the same as

multiplication in the frequency domain

dxhfxhxfxg

)()()()()(

Page 22: Image Processing Basics

Filtering, sampling and image processing

Many image processing operations basically involve filtering and resampling. Blurring Edge detection Scaling Rotation Warping

Page 23: Image Processing Basics

Resampling

Consider reducing the image resolution:

Page 24: Image Processing Basics

Resampling

The problem is to resample the image in such a way as to produce a new image, with a lower resolution, without introducing aliasing.Strategy- Low pass filter transformed image by

convolution to form bandlimited signal This will blur the image, but avoid aliasing

Page 25: Image Processing Basics

Ideal low pass filter

Frequency domain:

Spatial (time) domain:

xxxsync

)sin()(

Page 26: Image Processing Basics

Image processing in practice

Use finite, discrete filters instead of infinite continous filtersConvolution is a summation of a finite number of terms rather than in integral over an infinite domainA filter can now be represented as an array of discrete terms (the kernel)

n

nxhfxhxfxg

)()()()()(

Page 27: Image Processing Basics

Discrete Convolution

Page 28: Image Processing Basics

Finite low pass filters

Triangle filter

Page 29: Image Processing Basics

Finite low pass filters

Gaussian filter

Page 30: Image Processing Basics

Edge Detection

Convolve image with a filter that finds differences between neighboring pixels

111181111

filter

Page 31: Image Processing Basics

Scaling

Resample with a gaussian or triangle filter

Page 32: Image Processing Basics

Image processing

Some other filters

Page 33: Image Processing Basics

Summary

Images are discrete objects Pixels are samples Images have limited resolution

Sampling and reconstruction Reduce visual artifacts caused by aliasing Filter to avoid undersampling Blurring (and noise) are preferable to aliasing