image processing basics. what are images? an image is a 2-d rectilinear array of pixels

33
Image Processing Basics

Upload: stephanie-wilson

Post on 04-Jan-2016

224 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Image Processing Basics. What are images? An image is a 2-d rectilinear array of pixels

Image Processing Basics

Page 2: Image Processing Basics. What are images? An image is a 2-d rectilinear array of pixels

What are images?

An image is a 2-d rectilinear array of pixels

Page 3: Image Processing Basics. What are images? An image is a 2-d rectilinear array of pixels

Pixels as samples

A pixel is a sample of a continuous function

Page 4: Image Processing Basics. What are images? An image is a 2-d rectilinear array of pixels

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. What are images? An image is a 2-d rectilinear array of pixels

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. What are images? An image is a 2-d rectilinear array of pixels

Image errors

Spatial aliasing Not enough spatial resolution

Intensity quantization Not enough intensity resolution

Page 7: Image Processing Basics. What are images? An image is a 2-d rectilinear array of pixels

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. What are images? An image is a 2-d rectilinear array of pixels

Sampling and reconstruction

Page 9: Image Processing Basics. What are images? An image is a 2-d rectilinear array of pixels

Aliasing

Artifacts caused by too low sampling frequency (undersampling) or improper reconstruction

Undersampling rate determined by Nyquist limit (Shannon’s sampling theorem)

Page 10: Image Processing Basics. What are images? An image is a 2-d rectilinear array of pixels

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. What are images? An image is a 2-d rectilinear array of pixels

Spatial Aliasing

“Jaggies”

Page 12: Image Processing Basics. What are images? An image is a 2-d rectilinear array of pixels

Spatial aliasing

Ref: SIGGRAPH aliasing tutorial

Page 13: Image Processing Basics. What are images? An image is a 2-d rectilinear array of pixels

Spatial aliasing

Texture disintegration

Ref: SIGGRAPH aliasing tutorial

Page 14: Image Processing Basics. What are images? An image is a 2-d rectilinear array of pixels

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. What are images? An image is a 2-d rectilinear array of pixels

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. What are images? An image is a 2-d rectilinear array of pixels

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. What are images? An image is a 2-d rectilinear array of pixels

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. What are images? An image is a 2-d rectilinear array of pixels

Fourier Transform

Page 19: Image Processing Basics. What are images? An image is a 2-d rectilinear array of pixels

Fourier Transform

Fourier transform:

Inverse Fourier transform:

dxexfuF xui

2)()(

dueuFxf xui

2)()(

Page 20: Image Processing Basics. What are images? An image is a 2-d rectilinear array of pixels

Sampling theorem

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

-Claude Shannon

The minimum sampling rate for a bandlimited signal is called the Nyquist rate

A 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. What are images? An image is a 2-d rectilinear array of pixels

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. What are images? An image is a 2-d rectilinear array of pixels

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. What are images? An image is a 2-d rectilinear array of pixels

Resampling

Consider reducing the image resolution:

Page 24: Image Processing Basics. What are images? An image is a 2-d rectilinear array of pixels

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. What are images? An image is a 2-d rectilinear array of pixels

Ideal low pass filter

Frequency domain:

Spatial (time) domain:

x

xxsync

)sin(

)(

Page 26: Image Processing Basics. What are images? An image is a 2-d rectilinear array of pixels

Image processing in practice

Use finite, discrete filters instead of infinite continous filters

Convolution is a summation of a finite number of terms rather than in integral over an infinite domain

A filter can now be represented as an array of discrete terms (the kernel)

n

nxhfxhxfxg

)()()()()(

Page 27: Image Processing Basics. What are images? An image is a 2-d rectilinear array of pixels

Discrete Convolution

Page 28: Image Processing Basics. What are images? An image is a 2-d rectilinear array of pixels

Finite low pass filters

Triangle filter

Page 29: Image Processing Basics. What are images? An image is a 2-d rectilinear array of pixels

Finite low pass filters

Gaussian filter

Page 30: Image Processing Basics. What are images? An image is a 2-d rectilinear array of pixels

Edge Detection

Convolve image with a filter that finds differences between neighboring pixels

111

181

111

filter

Page 31: Image Processing Basics. What are images? An image is a 2-d rectilinear array of pixels

Scaling

Resample with a gaussian or triangle filter

Page 32: Image Processing Basics. What are images? An image is a 2-d rectilinear array of pixels

Image processing

Some other filters

Page 33: Image Processing Basics. What are images? An image is a 2-d rectilinear array of pixels

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