0% found this document useful (0 votes)
13 views39 pages

Pattern

Uploaded by

sotify249
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views39 pages

Pattern

Uploaded by

sotify249
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 39

Digital Image Processing, 2nd ed. www.imageprocessingbook.

com

Chapter 12
Object Recognition

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Patterns and Pattern Classes

• Patterns and features


• Pattern classes: a pattern class is a family of patterns
that share some common properties
• Pattern recognition: to assign patterns to their
respective classes
• Three common pattern arrangements used in practices
are
– Vectors
– Strings
– Trees

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Patterns and Pattern Classes


Vector Example

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Patterns and Pattern Classes


Another Vector Example
• Here is another example of pattern vector generation.
• In this case, we are interested in different types of noisy
shapes.

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Patterns and Pattern Classes


String Example
• String descriptions adequately generate patterns of objects and
other entities whose structure is based on relatively simple
connectivity of primitives, usually associated with boundary
shape.

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Patterns and Pattern Classes


Tree Example
• Tree descriptions is more powerful than string ones.
• Most hierarchical ordering schemes lead to tree structure.

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Patterns and Pattern Classes


Tree Example

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Recognition Based on
Decision-Theoretic Methods

• Decision-theoretic approaches to recognition are based on the


use decision functions.
• Let x ( x1 , x2 ,..., xn )Trepresent an n-dimensional pattern vector.
For W pattern classes 1 , 2 ,..., W , we want to find W decision
functions d1 (x), d 2 (x),..., dW (x) with the property that, if a pattern x
belongs to class i , then
d i ( x)  d j ( x) j 1,2,...,W ; j i
• The decision boundary separating class i and  j is given by
d i (x) d j (x) or d i (x)  d j (x) 0

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Recognition Based on Decision-Theoretic Methods


Matching

• Minimum distance classifier

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Recognition Based on Decision-Theoretic Methods


Matching by Correlation

• The correlation between f(x,y) and w(x,y) is


c( x, y )   f ( s, t ) w( x  s, y  t )
s t

for x 0,1,2,..., M  1,
y 0,1,2,..., N  1

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Recognition Based on Decision-Theoretic Methods


Matching by Correlation

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Recognition Based on Decision-Theoretic Methods


Optimum Statistical Classifiers

• Bayes classifier for Gaussian pattern classes


( x m j )2

1 2 2j
d j ( x)  p ( x |  j ) p ( j )  e p ( j )
2  j

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Recognition Based on Decision-Theoretic Methods


Optimum Statistical Classifiers

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Recognition Based on Decision-Theoretic Methods


Optimum Statistical Classifiers

• Classification of multi-spectral data using the Bayes classifier

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Recognition Based on Decision-Theoretic Methods


Optimum Statistical Classifiers

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Recognition Based on Decision-Theoretic Methods


Neural Networks

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Recognition Based on Decision-Theoretic Methods


Neural Networks

• Illustration of the perceptron algorithms

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Recognition Based on Decision-Theoretic Methods


Multilayer Feedforward Neural Networks

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Recognition Based on Decision-Theoretic Methods


Multilayer Feedforward Neural Networks

• The activation function: a sigmoid function

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Recognition Based on Decision-Theoretic Methods


Multilayer Feedforward Neural Networks

Pattern vectors were generated by computing the normalized


signatures of the shapes (see Section 11.1.3)
© 2002 R. C. Gonzalez & R. E. Woods
Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Recognition Based on Decision-Theoretic Methods


Multilayer Feedforward Neural Networks

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Recognition Based on Decision-Theoretic Methods


Multilayer Feedforward Neural Networks

Rt denote a value of R
used to generate
training data.
Rt =0 implies noise-free
training.

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Recognition Based on Decision-Theoretic Methods


Multilayer Feedforward Neural Networks

N: the number of
training patterns

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Recognition Based on Decision-Theoretic Methods


Multilayer Feedforward Neural Networks

• Complexity of decision surface


– Two input, tow-layer, feedforward neural networks

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Recognition Based on Decision-Theoretic Methods


Multilayer Feedforward Neural Networks

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Structural Methods
Matching Shape Number

• Let a and b denote shape numbers of closed boundaries


represented by 4-directional chain codes. There two shapes
have a degree of similarity k if
s j (a ) s j (b), for j 4,6,8,..., k
s j (a ) s j (b), for j k  2, k  4,...

where s indicates shape number and the subscript indicates


order (see Section 11.2.2)
• The distance between two shapes a and b defined as
1
D ( a, b) 
k

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Structural Methods
Matching Shape Number

Shape no. order

Similarity tree
© 2002 R. C. Gonzalez & R. E. Woods
Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Structural Methods
Matching Shape Number

Similarity tree Similarity matrix

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Structural Methods
String Matching

• Suppose that two region boundaries, a and b, are coded into


strings (see Section 11.5) denoted a1, a2, …, an and b1, b2,
…,bm, respectively.
• Let  represent the number of matches between the two
strings, where a match occurs in the kth position if ak = bk .
• The number of symbols that do not match is
 max( a , b )  
• A simple measure of similarity between a and b is the ratio
 
R 
 max( a , b )  

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Structural Methods
String Matching

• Strings were formed from the polygons by


computing the interior angle,  , between segments
as each polygon was traversed clockwise.
• Angles were coded into one of eight possible
symbols, corresponding to 45o increments.
1 : 0   45o ;  2 : 45o   90o ;...
© 2002 R. C. Gonzalez & R. E. Woods
Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Structural Methods
String Matching

• Figure 12.25(e) shows the results of computing the measure R


for six samples of object 1 against themselves.
• The notation 1.c refers to the third string from object class 1.

Figure 12.25 (e) Figure 12.25 (f)


© 2002 R. C. Gonzalez & R. E. Woods
Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Structural Methods
String Matching

• Figure 12.25(g) shows a tabulation of R values obtained by


comparing strings of one class against the other.
• Note that all R values are considerable smaller than any entry in
the two preceding tabulations.
• The R measure achieved a
high degree of discrimination
between the two classes of
objects.

Figure 12.25 (g)


© 2002 R. C. Gonzalez & R. E. Woods
Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Structural Methods
Syntactic Recognition of Strings

• String grammars
– Step1: Object class
generation using a
regular string
grammar
– For example:
the srting of Fig.
12.26(c) is abbbbbc.

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Structural Methods
Syntactic Recognition of Strings

• String grammars
– Step 2: use of semantics (production rules)

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Structural Methods
Syntactic Recognition of Strings

• String grammars
– Step 3: automata as string recognizers

String: abbbbbc

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Structural Methods
Syntactic Recognition of Trees

• Tree grammars
• Production rules
– Example
S→a
|
X1

X1 → c
/ \
X2 X3
• Tree automata

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Structural Methods
Syntactic Recognition of Trees

• Processing stages of a tree automata

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Structural Methods
Syntactic Recognition of Trees

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Structural Methods
Syntactic Recognition of Trees

© 2002 R. C. Gonzalez & R. E. Woods

You might also like