Region labelling Giving a region a name. Image Processing and Computer Vision: 62 Introduction...

Post on 19-Dec-2015

224 views 2 download

Tags:

transcript

Region labelling

Giving a region a name

Image Processing and Computer Vision: 6 2

Introduction

Region detection isolated regions

Region description properties of regions

Region labelling identity of regions

Image Processing and Computer Vision: 6 3

Contents

Template matching Rigid Non-rigid templates

Graphical methods Eigenimages Statistical matching Syntactical matching

Image Processing and Computer Vision: 6 4

Template matching

Define a template a model of the object to be

recognised Define a measure of similarity

between template and similar sized image region

Image Processing and Computer Vision: 6 5

Measure dissimilarity between image f[i,j] and template g[i,j]

Place template on image and compare corresponding intensities

Need a measure of dissimilarity

Last is best....

i, j Rmax f g f g

i, j R 2

f g i, j R

Similarity

Image Processing and Computer Vision: 6 6

Expanding

If f and g fixed-fg a good measure of mismatch

fg a good measure of match

Compute match between template and image with cross-correlation

2

f g i, j R 2

f i, j R 2

g 2i , j R fg

i , j R

M i, j g k, l l n

ln

k m

km

f i k, j l

Image Processing and Computer Vision: 6 7

g is constant, f varies and so influences MNormalisation

C is maximum where f and g are same.Limitations

number of templates required rotation and size changes partial views

C i, j g k, l

l n

ln

k m

k m

f i k, j l

2fl n

ln

k m

km

i k, j l

Image Processing and Computer Vision: 6 8

0

20

40

60

80

100

1201

26

51

76

10

1

12

6

15

1

17

6

20

1

22

6

25

1

27

6

30

1

32

6

35

1

37

6

40

1

42

6

Position

No

n-N

orm

alis

ed

Co

rre

lati

on

Template

Input Output

Image Processing and Computer Vision: 6 9

Flexible Templates

Shapes are seldom constant Variation

in shape itself in image of same shape viewpoint

Non-rigid representations capture variability

Image Processing and Computer Vision: 6 10

Structure

Flexible image structures Linked by virtual springs

Image Processing and Computer Vision: 6 11

Recognition Deform image structure

To equate model and image Move image structures

To colocate model and image Matching

externalexternalinternalinternal EWEWEtotal

Image Processing and Computer Vision: 6 12

Learning the model Accuracy of model determines

success Model

For each control point average, variance of location

To be learnt with minimum external variation

size, orientation, inconsistency of location

Image Processing and Computer Vision: 6 13

Parametric Models

Parametrically define the shape straight line, circle, parabola, …

Update parameters to match model and object

Image Processing and Computer Vision: 6 14

Example – Face tracking

Eyes and mouth circles and parabolas locations, sizes, orientations

Templates define image structures

Image Processing and Computer Vision: 6 15

Flexible templates, EigenImages

Attempt to capture intrinsic variability of data

Mathematical representation of variation

Image Processing and Computer Vision: 6 16

Take samples from a population plot values of parameters on a

scatter diagram

Mathematical Foundation

Image Processing and Computer Vision: 6 17

Rotate axes: one axis encodes most of information other axis encodes remainder

Generalise to multiple dimensions

Image Processing and Computer Vision: 6 18

Images

Use outline co-ordinates image values

As the variables Normalise as much variability

Image Processing and Computer Vision: 6 19

Hand Eigenimages

Image Processing and Computer Vision: 6 20

Hand Gestures

Image Processing and Computer Vision: 6 21

Range of Eigenimages

Image Processing and Computer Vision: 6 22

Face Eigenimages

Image Processing and Computer Vision: 6 23

Recognition

Retain n eigenvectors with largest eigenvalues

Form dot product of these with image data

Find nearest neighbour from training set

Image Processing and Computer Vision: 6 24

Statistical Classification Methods

Derive characteristic feature measurements from image

Form a feature vector that identifies object as belonging to a predefined class

Need decision rules to make classification

Image Processing and Computer Vision: 6 25

Linear Discriminant Analysis

Samples from different classes occupy different regions of feature space

Can define a line separating them

Image Processing and Computer Vision: 6 26

Feature 1

Featu

re 2

Class A

Class B

Image Processing and Computer Vision: 6 27

Decision

d(X) = F2 - mF1 - c

d(X) > 0 for points in class Ad(X) = 0 for points on lined(X) < 0 for points in class B

Image Processing and Computer Vision: 6 28

height

weight

jockeys

basketball players?

jd 2

iu ijf i1

N

Rd minj1

N

jd

Nearest Neighbour Classifier

Assign the new sample to the population whose centroid is closest.

Image Processing and Computer Vision: 6 29

Most Likely

Incorporate range of possible class values

2

2

xxCp

A

A

Image Processing and Computer Vision: 6 30

Take population variation into account

Assume prior probability of observing class j is P(j)

e.g. 10% of population are jockeys

Assume a conditional probability distribution for each feature, x, of each population p(x|j).

height

weight

jockeys

basketball players?

Bayesian Classifiers

Image Processing and Computer Vision: 6 31

P j | x p x|

j P j p x|

j P j j1

N

Multiply these curves by P(j) to give probability of a measurement belonging to each class.

Divide by total probability of measuring x, to normalise.

This gives the probability of the sample being from each class.

x

p

p(x|1)

p(x|2)

Image Processing and Computer Vision: 6 32

Syntactic Recognition

Objects’ structure (outline) can be described linguistically Primitive shape elements = words Grammatically correct sentences = a

valid shape

Image Processing and Computer Vision: 6 33

Shape Grammar A set of pattern primitives

terminal symbols A set of rules that define combinations

of primitives (sentences) the grammar

A start symbol represents a valid object

Non-terminal symbols represent substructures in the shape

Image Processing and Computer Vision: 6 34

Recognition

Grammar is generative Recognition is degenerative

Recognition uses rules in reverse Terminal symbols are rewritten until a

valid start symbol is attained

Image Processing and Computer Vision: 6 35

Chromosome Grammar

armpartright

armpartleft

armpartleft pair arm

partright armpair arm

sidepair armpair arm

pair armsidepair arm

pair armpair armchromosomesubmedian

c

c

Image Processing and Computer Vision: 6 36

Chromosome Grammar

d

b

b

b

a

b

b

side

side

sideside

sideside

arm

armarm

armarm

Image Processing and Computer Vision: 6 37

The Primitives

a b c d

a bc

b

ab

bb

b

b

b

a

ad

d

c

Image Processing and Computer Vision: 6 38

Example

a bc

b

ab

bb

b

b

b

a

ad

d

c

Image Processing and Computer Vision: 6 39

<submedian chromosome>

d b a b c b a b d b a b c b a b

<side><side> <arm><arm> <arm>c <arm>c

<side><side> <arm><arm> <arm>c <arm>cb b

<side><side> <arm> <right part><arm> <right part>

<side> <arm pair><side> <arm pair>

<arm pair><arm pair>

Image Processing and Computer Vision: 6 40

Evaluation Classification rate Confusion matrix

Image Processing and Computer Vision: 6 41

Classification Rate How often does the

classifier get the correct answer?

Selection of training and test data must be carefully done.

Image Processing and Computer Vision: 6 42

Confusion matrix C(i,j) = number of times

pattern i was recognised as class j.

Want off-diagonal elements to be zero.

Image Processing and Computer Vision: 6 43

Summary

Template matching Deformable templates Flexible templates Statistical classification