machine vision ent 273 object recognition and feature detection hema c.r. lecture 7

37
Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Upload: elwin-knight

Post on 12-Jan-2016

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Machine Vision

ENT 273Object Recognition

and Feature Detection

Hema C.R.

Lecture 7

Page 2: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Hema ENT 273 Lecture 7

2

Road Map

• Feature Extraction• Contour

• Chain codes• Object Recognition

• Object Representation• Feature Detection• Hough Transform

• Fourier Descriptors

Page 3: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Hema ENT 273 Lecture 7

3

Contour

• Represented as ordered list of edges or a curve

• Criteria for good contour– Efficiency: simple and compact

representation– Accuracy: accurately fit image features

– Effectiveness: suitable for operations to be performed at a later stage

Page 4: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Hema ENT 273 Lecture 7

4

Definitions

• Edge list– Ordered set of edge points or fragments

• Contour– Edge list or a curve that is used to represent the

edge list

• Boundary– Closed contour that surrounds a region

Note: The term edge generally refers to edge points

Page 5: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Hema ENT 273 Lecture 7

5

Object Recognition

• Object recognition systems find objects in the real world from an image of the world.

• Object recognition can be defined as a labeling problem based on models of known objects.

Page 6: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Hema ENT 273 Lecture 7

6

OBJECT RECOGNITION

The next step in Robot Vision is the Object Recognition. This problem is accomplished using the extracted feature information.

The object recognition algorithm is to be powerful and fast so that the required object is uniquely recognized. There are mainly two methods

(a)Template matching technique

A template is provided to computer and the computer is trained to match the object with the template irrespective of object orientation.

Page 7: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Hema ENT 273 Lecture 7

7

(b)Structural technique

Several structural techniques are available. These may take the features also in to account. We discuss a common method known as

Page 8: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Hema ENT 273 Lecture 7

8

Chain Codes• Notation for recording list of edge points along

contour• Chain code specifies the direction of the contour at

each edge• Directions are quantized into one of eight directions• These codes are also known as freeman codes• Are used for the description of pixel border• Local information of the objects can be obtained from

the chain code– E.g. where image border turns 90 degrees etc.

• CHAIN CODE. Here there are two approaches• (a) 4-Directional Chain Code• (b) 8 Directional Chain code

Page 9: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Hema ENT 273 Lecture 7

9

STARTStart with the start point and go along the arrows

Comparing the contour of object with respect to 4-directional chain code converter, we get

Chain code of Object: 03032211

4-directional converter

8-directional converter

0

1

2

3

0

12

3

4

5

67

OBJECT

Page 10: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Hema ENT 273 Lecture 7

10

CHAIN CODE : 03032211

We then get the difference;

Difference between 0 and 3 is 3 (ref 4 direc. converter)

Difference between 3 and 0 is 1

Difference between 0 and 3 is 3 and so on

Difference between 1 and 1 is 0

Difference between 1 and 0 is 3.

Difference Code is : 31330303

Take the minimum (decimal)value of Difference code as

This SHAPE number is for the object, uniquely recognized, independent of rotation (by 900). Normally chosen from Difference Code of smallest order

Page 11: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Hema ENT 273 Lecture 7

11

Another Object

Verify:

Chain Code:

0330011033323333221112111

Difference code:

3010103300310003030013003

Shape Number:

0003030013003301010330031

Page 12: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Hema ENT 273 Lecture 7

12

If the object edges are of slopes 450, 1350 , - 450 and - 1350, then we can use the 8-Directional converter. The procedure of getting the shape number is the same.

This method of object recognition is fast and can be used for different shapes of objects to be recognized if they are coming in a random sequence.

Page 13: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Hema ENT 273 Lecture 7

13

3 5 5 5 5 56

67711111

32

2

2 3 4

1 5

8 7 6

Chain coding example

Page 14: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Hema ENT 273 Lecture 7

14

Components of a object recognition system

• Model database – model base• Feature detector• Hypothesizer• Hypothesis verifier

Feature Detector

Hypothesis Formation

Hypothesis verification

Modelbase

Image FeaturesCandidate

objects

Object Class

Page 15: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Hema ENT 273 Lecture 7

15

Components• Model Database

– Contains all models known to the system for recognition –such as size, color, shape, CAD drawing etc

• Feature Detector– Applies operators to images and identifies location

of features that help the object hypothesis• Hypothesizer

– Assigns likelihood to objects using features detected and selects object with highest likelihood

• Hypothesis Verifier– Uses object models to select most likely object

Note: Depending on the complexity of the problems

one or more modules becomes trivial.

Page 16: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Hema ENT 273 Lecture 7

16

Object Representation• Observer-Centered Representation

– Applied to objects relatively in stable positions w.r. to camera

– Global features of a scene are recognized– Features are selected based on experience of

designer or analyzing features to form object groups

• Object-Centered Representation– Uses description of objects based on usually 3D– Independent of camera parameters– Used in constructive solid geometry e.g. CAD /

CAM

Page 17: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Hema ENT 273 Lecture 7

17

Recognition Strategies• Object recognition is a sequence of steps that is

performed after appropriate features have been detected.

• Not all object recognition techniques require strong hypothesis formation and verification steps

HypothesizerClassifier

VerifierSequential Matching

Hypothesizer Verifier

Features Object

Features

Features

Object

Object

Page 18: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Hema ENT 273 Lecture 7

18

Strategies• Classification

– Nearest neighbor• Similar features in a region are clustered, based on a centroid and distance

– Bayesian Classifier• Used when distribution of objects is not straightforward • When there is an overlap of features of different objects.• Probabilistic knowledge about features and frequency of objects is used

– Neural Nets• Implement a classification approach• Use nonlinear boundary partition of features• Boundaries are used by training a net

– Off-line computations• Computations are done before recognition• Recognition process can be converted to a look-up table

• Matching– Feature Matching

• Known features of the object are matched with unknown objects feature to find matches

– Symbolic Matching• Relation among features are matched• Graph matching

Page 19: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Hema ENT 273 Lecture 7

19

Feature Detection• Global Features

– Characteristic of a region• Area• Perimeter• Fourier Descriptors• Moments

• Local Features– Features on the boundary of an object or a small region

• Curvature• Boundary segment• Corners

• Relational Features– Based on relative positions of different entities like regions,

closed contours etc.• Distance between features• Used in defining composite objects

Page 20: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Hema ENT 273 Lecture 7

20

FEATURE EXTRACTION:In vision, it is often necessary to distinguish

one object from another. This is accomplished by mean of features that uniquely characterize the object.

Some features of objects that can be used in Vision are:

(a) Area (b) Minimum Enclosing rectangle

(c) Diameter (d) center of gravity

(e)Perimeter (f) eccentricity (g) Aspect Ratio

(h) Number of holes (i) Moments

Page 21: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Hema ENT 273 Lecture 7

21

EXAMPLE: Let an original image of an object undergone several image processing techniques and finally available to us as a pixel pattern shown below:

Page 22: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Hema ENT 273 Lecture 7

22

Some of features can be computed as:

(a) Moment ( M00 ) = = 24

(b)Eccentricity = (Max x-length) / (Max y-length) = 9/4

(c) Perimeter = 22

(d)Area = 24

(e) Diameter = 9

(f) Thinness = {Diameter / area }

= ( 9 / 24 ) = 0.375

(g) compactness =

{ (perimeter)2 / area } = ( 22 2 /24 )

(a) No: of holes = 0

Objects having these features belong to one category

yxyx

,

00

Page 23: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Hema ENT 273 Lecture 7

23

Example of Histogram

Page 24: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Hema ENT 273 Lecture 7

24

Page 25: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Hema ENT 273 Lecture 7

25

Page 26: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Hema ENT 273 Lecture 7

26

Page 27: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Hema ENT 273 Lecture 7

27

• Image Area

• Center of Gravity (COG)

Or centroid for xc and yc. The area and COG is used to identify the position of the object

m

x

n

y

yxIA1 1

),(

m

x

n

yc yxxI

Ax

1 1

),(1

m

x

n

yc yxyI

Ay

1 1

),(1

Page 28: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Hema ENT 273 Lecture 7

28

• Moments- A sequence of numbers characterzing the shape of an object

• The sum of power (j+k) is the order of themoment

0,0),(,

kjyxIyxMOyx

kjjk

m

x

n

y

yxIAM1 1

00 ),(

m

x

n

yc yxxI

AxM

1 110 ),(

1

m

x

n

yc yxyI

AyM

1 101 ),(

1

Page 29: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Hema ENT 273 Lecture 7

29

• If the COG is known we can determine the central of moment

• Because object is balanced at COG, the first order moment is zero

0,0),()()(,

kjyxIyyxxOyx

kc

jcjk

m

x

n

yc

m

x

n

yc

yxIyy

yxIxx

1 101

1 110

0),()(

0),()(

Page 30: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Hema ENT 273 Lecture 7

30

• The second order moment give the moment inertia of the image

m

x

n

ycc

m

x

n

yc

m

x

n

yc

yxIyyxx

yxIyy

yxIxx

1 111

1 1

202

1 1

220

),())((

),()(

),()(

Page 31: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Hema ENT 273 Lecture 7

31

• Orientation-the angle of inclination ),2(2tan

2

1022011 A

Page 32: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Hema ENT 273 Lecture 7

32

• Eccentricity- maximum chord length is along the principal axis or major axis of object and minimum chord length is perpendicular to major axis

lengthchordMinimum

lengthchordMaximumtyEccentrici

22

,)()(max ijij

jiyyxx

lengthchordMaximum

Page 33: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Hema ENT 273 Lecture 7

33

• Roundness,

• Aspect Ratio=Length of Rectangle enclosing object» Width of rectangle enclosing Object

A

yxR cc

22

Page 34: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Hema ENT 273 Lecture 7

34

Example of Object Recognition

Page 35: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Hema ENT 273 Lecture 7

35

Page 36: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Hema ENT 273 Lecture 7

36

Page 37: Machine Vision ENT 273 Object Recognition and Feature Detection Hema C.R. Lecture 7

Machine VisionMachine VisionObject Recognition

and

Feature Detection

Hema C.R.

Object Recognition

and

Feature Detection

Hema C.R.

End of Lecture 7