+ All Categories
Home > Documents > Image Transforms

Image Transforms

Date post: 06-Jan-2016
Category:
Upload: eliora
View: 51 times
Download: 2 times
Share this document with a friend
Description:
Image Transforms. Transforming images to images. Classification of Image Transforms. Point transforms modify individual pixels modify pixels’ locations Local transforms output derived from neighbourhood Global transforms whole image contributes to each output value. Point Transforms. - PowerPoint PPT Presentation
66
Image Transforms Transforming images to images
Transcript
Page 1: Image Transforms

Image Transforms

Transforming images to images

Page 2: Image Transforms

Image Processing and Computer Vision: 2 2

Classification of Image Transforms Point transforms

modify individual pixels modify pixels’ locations

Local transforms output derived from neighbourhood

Global transforms whole image contributes to each

output value

Page 3: Image Transforms

Image Processing and Computer Vision: 2 3

Point Transforms

Manipulating individual pixel values

Brightness adjustment Contrast adjustment

Histogram manipulation equalisation

Image magnification

Page 4: Image Transforms

Image Processing and Computer Vision: 2 4

Grey Scale Manipulation

Brightness modifications Contrast modifications Histogram manipulation

Page 5: Image Transforms

Image Processing and Computer Vision: 2 5

Brightness Adjustment

Add a constant to all values g’ = g + k(k = 50)

Page 6: Image Transforms

Image Processing and Computer Vision: 2 6

Contrast Adjustment

Scale all values by a constant g’ = g*k(k = 1.5)

Page 7: Image Transforms

Image Processing and Computer Vision: 2 7

Image Histogram

Measure frequency of occurrence of each grey/colour value

Grey Value Histogram

0

2000

4000

6000

8000

10000

12000

1 16 31 46 61 76 91 106

121

136

151

166

181

196

211

226

241

256

Grey Value

Fre

qu

ency

Page 8: Image Transforms

Image Processing and Computer Vision: 2 8

Histogram Manipulation

Modify distribution of grey values to achieve some effect

Page 9: Image Transforms

Image Processing and Computer Vision: 2 9

Equalisation/Adaptive Equalisation

Specifically to make histogram uniform

Grey Value Histogram

0

2000

4000

6000

8000

10000

12000

1 16 31 46 61 76 91 106

121

136

151

166

181

196

211

226

241

256

Grey Value

Fre

qu

ency

Page 10: Image Transforms

Image Processing and Computer Vision: 2 10

Equalisation Transform Equalised image has n x m/l pixels per

grey level Cumulative to level j

jnm/l pixels Equate to a value in input cumulative

histogram C[i] C[i] = jnm/l j = C[i]l/nm Modifications to prevent mapping to –1.

Page 11: Image Transforms

Image Processing and Computer Vision: 2 11

Thresholding

Transform grey/colour image to binary

if f(x, y) > T output = 1 else 0 How to find T?

Page 12: Image Transforms

Image Processing and Computer Vision: 2 12

Threshold Value

Manual User defines a threshold

P-Tile Mode Other automatic methods

Page 13: Image Transforms

Image Processing and Computer Vision: 2 13

P-Tile

If we know the proportion of the image that is object

Threshold the image to select this proportion of pixels

Page 14: Image Transforms

Image Processing and Computer Vision: 2 14

Mode

Threshold at the minimum between the histogram’s peaks.

Page 15: Image Transforms

Image Processing and Computer Vision: 2 15

Automated Methods

Find a threshold such that

(Start at = 0 and work upwards.)

Average l Average h

l

h2

Page 16: Image Transforms

Image Processing and Computer Vision: 2 16

Image Magnification

Reducing new value is weighted sum of nearest

neighbours new value equals nearest neighbour

Enlarging new value is weighted sum of nearest

neighbours add noise to obscure pixelation

Page 17: Image Transforms

Image Processing and Computer Vision: 2 17

Local Transforms

Convolution Applications

smoothing sharpening matching

Page 18: Image Transforms

Image Processing and Computer Vision: 2 18

Convolution Definition

Place template on imageMultiply overlapping values in image

and templateSum products and normalise(Templates usually small)

x yyx,tycx,rgcr,g'

Page 19: Image Transforms

Image Processing and Computer Vision: 2 19

ExampleImage Template Result

1 1 11 2 11 1 1

… . . . . . ...… 3 5 7 4 4 …… 4 5 8 5 4 …… 4 6 9 6 4 …… 4 6 9 5 3 …… 4 5 8 5 4 …… . . . . . ...

… . . . . . ...… . . . . . ...… . 6 6 6 . …… . 6 7 6 . …… . 6 7 6 . …… . . . . . ...… . . . . . ...

Divide by template sum

Page 20: Image Transforms

Image Processing and Computer Vision: 2 20

Separable Templates

Convolve with n x n template n2 multiplications and additions

Convolve with two n x 1 templates 2n multiplications and additions

Page 21: Image Transforms

Image Processing and Computer Vision: 2 21

Example

Laplacian template

Separated kernels

0 –1 0-1 4 –1 0 –1 0

-1 2 -1 -12-1

Page 22: Image Transforms

Image Processing and Computer Vision: 2 22

Composite Filters

Convolution is distributive

Can create a composite filter and do a single convolution

Not convolve image with one filter and convolve result with second.

Efficiency gain

CBACBA

Page 23: Image Transforms

Image Processing and Computer Vision: 2 23

Applications Usefulness of convolution is the

effects generated by changing templates

Smoothing Noise reduction

Sharpening Edge enhancement

Template matching A later lecture

Page 24: Image Transforms

Image Processing and Computer Vision: 2 24

Smoothing

Aim is to reduce noise What is “noise”? How is it reduced

Addition Adaptively Weighted

Page 25: Image Transforms

Image Processing and Computer Vision: 2 25

Noise Definition

Noise is deviation of a value from its expected value

Random changes x x + n

Salt and pepper x {max, min}

Page 26: Image Transforms

Image Processing and Computer Vision: 2 26

Noise Reduction

By smoothing (x + n) = (x) + (n) = (x)

Since noise is random and zero mean Smooth locally or temporally Local smoothing

Removes detail Introduces ringing

Page 27: Image Transforms

Image Processing and Computer Vision: 2 27

Adaptive Smoothing

Compute smoothed value, s Output = s if |s – x| > T x otherwise

Page 28: Image Transforms

Image Processing and Computer Vision: 2 28

Median Smoothing

Median is one value in an ordered set:

1 2 3 4 5 6 7 median = 42 3 4 5 6 7 median = 4.5

evennnn

average

oddnn

2

1,2

2

1

Page 29: Image Transforms

Image Processing and Computer Vision: 2 29

Original Smoothed

Median Smoothing

Page 30: Image Transforms

Image Processing and Computer Vision: 2 30

Gaussian Smoothing

To reduce ringing Weighted smoothing Numbers from Gaussian (normal)

distribution are weights.

Page 31: Image Transforms

Image Processing and Computer Vision: 2 31

Sharpening

What is it? Enhancing discontinuities Edge detection

Why do it? Perceptually important Computationally important

Page 32: Image Transforms

Image Processing and Computer Vision: 2 32

Edge Definition

An edge is a significant local change in image intensity.

Page 33: Image Transforms

Image Processing and Computer Vision: 2 33

Edge Types

Step edge Line edge Roof edge

Real edges

Page 34: Image Transforms

Image Processing and Computer Vision: 2 34

First Derivative, Gradient Edge Detection

If an edge is a discontinuity Can detect it by differencing

Page 35: Image Transforms

Image Processing and Computer Vision: 2 35

Roberts Cross Edge Detector

Simplest edge detector Inaccurate localisation

-1 0

0 1

0 -1

1 0

Page 36: Image Transforms

Image Processing and Computer Vision: 2 36

Prewitt/Sobel Edge Detector-1 -1 -1

0 0 0

1 1 1

-1 0 1

-1 0 1

-1 0 1

Page 37: Image Transforms

Image Processing and Computer Vision: 2 37

Edge Detection

Combine horizontal and vertical edge estimates

h

vandvhMag tan 122

Page 38: Image Transforms

Image Processing and Computer Vision: 2 38

Problems

Enhanced edges are noise sensitive

Scale What is “local”?

Page 39: Image Transforms

Image Processing and Computer Vision: 2 39

Canny/Deriche Edge Detector

Require edges to be detected accurate localisation single response to an edge

Solution Convolve image with Difference of

Gaussian (DoG)

Page 40: Image Transforms

Image Processing and Computer Vision: 2 40

Example Results

Page 41: Image Transforms

Image Processing and Computer Vision: 2 41

Second Derivative Operators Zero Crossing

Model HVS Locate edge to subpixel accuracy Convolve image with Laplacian of

Gaussian (LoG) Edge location at crossing of zero

axis

Page 42: Image Transforms

Image Processing and Computer Vision: 2 42

Example Results

Page 43: Image Transforms

Image Processing and Computer Vision: 2 43

Page 44: Image Transforms

Image Processing and Computer Vision: 2 44

Global Transforms Computing a new value for a pixel

using the whole image as input Cosine and Sine transforms Fourier transform

Frequency domain processing Hough transform Karhunen-Loeve transform Wavelet transform

Page 45: Image Transforms

Image Processing and Computer Vision: 2 45

Cosine/Sine

A halfway solution to the Fourier Transform

Used in image coding

otherwise

xifxC

N

jy

N

ixyxpixeljCiCNjiDCT

Nx

x

Ny

y

1

02

1

2

12cos

2

12cos,2,

1

0

1

0

Page 46: Image Transforms

Image Processing and Computer Vision: 2 46

Fourier All periodic signals can be represented by a

sum of appropriately weighted sine/cosine waves

eW

f

f

WWWW

F

F

N

nij

in

NNNN

N

N

N

and

2

,

1

0

1,10,1

1,00,0

1

0

1

Page 47: Image Transforms

Image Processing and Computer Vision: 2 47

Transformed section of BT Building image.

Page 48: Image Transforms

Image Processing and Computer Vision: 2 48

Frequency Domain Filtering

Convolution Theorem:

Convolution in spatial domainis equivalent to

Multiplication in frequency domain

Page 49: Image Transforms

Image Processing and Computer Vision: 2 49

Smoothing

Suppress high frequency components

Page 50: Image Transforms

Image Processing and Computer Vision: 2 50

Sharpening

Suppress low frequency components

Page 51: Image Transforms

Image Processing and Computer Vision: 2 51

Example

Page 52: Image Transforms

Image Processing and Computer Vision: 2 52

Wavelet

A hierarchical representation

detail

Page 53: Image Transforms

Image Processing and Computer Vision: 2 53

Hough Transform

To detect curves analytically Example

straight lines

Page 54: Image Transforms

Image Processing and Computer Vision: 2 54

Straight Line

y = mx + cgradient m, intercept c

c = -mx + ygradient -x, intercept y

ALL points in (x, y) transform to a straight line in (c, m)

Can therefore detect collinear points

Page 55: Image Transforms

Image Processing and Computer Vision: 2 55

Analytic Curve Finding

Alternative representation to avoid infinities

Other curves higher dimensional accumulators

Page 56: Image Transforms

Image Processing and Computer Vision: 2 56

Performance Improvement Techniques

Look at pairs of points Use edge orientation

Page 57: Image Transforms

Image Processing and Computer Vision: 2 57

Karhunen-Loeve (Principal Component)

A compact method of representing variation in a set of images

PCs define a co-ordinate system 1st PC records most of variation 2nd PC records most of remainder etc

Page 58: Image Transforms

Image Processing and Computer Vision: 2 58

Method Take a set of typical images Compute mean image and subtract

from each sample Transform images into columns Group images into a matrix Compute covariance matrix Compute eigenvectors

these are the PCs eigenvalues show their importance

Page 59: Image Transforms

Image Processing and Computer Vision: 2 59

Uses

Compact representation of variable data

Object recognition

Page 60: Image Transforms

Image Processing and Computer Vision: 2 60

Uses

Hierarchical representation Multiresolution processing Coding

Page 61: Image Transforms

Image Processing and Computer Vision: 2 61

Geometric Transformations

Definitions Affine and non-affine transforms

Applications Manipulating image shapes

Page 62: Image Transforms

Image Processing and Computer Vision: 2 62

Affine TransformsScale, Shear, Rotate, Translate

Change values of transform matrix elements according to desired effect.

a, e scalingb, d shearing

a, b, d, e rotationc, f translation

=x’y’1[ ] a b c

d e fg h i[ ] x

y1[ ]

Length and areas preserved.

Page 63: Image Transforms

Image Processing and Computer Vision: 2 63

Affine Transform Examples

Page 64: Image Transforms

Image Processing and Computer Vision: 2 64

Warping ExampleAnsell Adams’ Aspens

xyxyxyx 22 2.12.1','

Page 65: Image Transforms

Image Processing and Computer Vision: 2 65

Image Resampling Moving source to destination pixels x’ and y’ could be non-integer Round result

can create holes in image Manipulate in reverse

where did warped pixel come from source is non-integer

interpolate nearest neighbours

Page 66: Image Transforms

Image Processing and Computer Vision: 2 66

You Should Know… Point transforms

scaling, histogram manipulation,thresholding

Local transforms edge detection, smoothing

Global transforms Fourier, Hough, Principal Component,

Wavelet Geometrical transforms


Recommended