Top Banner
Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes
102

Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Dec 30, 2015

Download

Documents

Reynard Preston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Shape-Representation

and

Shape Similarity

Dr. Rolf LakaemperPart 1: Shapes

Page 2: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

May I introduce myself…

• Rolf Lakaemper

• PhD (Doctorate Degree) 2000Hamburg University, Germany

• Currently Assist. Professor at Departmentof Computer and Information Sciences,Temple University, Philadelphia, USA

• Main Research Area: Computer Vision

Page 3: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Motivation

WHY SHAPE ?

Page 4: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Motivation

These objects are recognized by…

Page 5: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Motivation

These objects are recognized by…

Texture Color Context Shape

X X

X X

X

X

X

X X

Page 6: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Why Shape ?

Several applications in computer vision use shape processing:

• Object recognition• Image retrieval

• Processing of pictorial information• Video compression (eg. MPEG-7)

This presentation focuses on object recognition and image retrieval.

Page 7: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Motivation

Typical Application: Multimedia: Image Database

Query by Shape / Texture / …(Color / Keyword)

Page 9: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Blobworld

Blobworld: Query by Shape / Texture / Location / Color

Selected Blob

Query:

by Color and Texture of Blob

Result:

Blobs with similar Color and Texture

Satisfying ?

Page 10: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Blobworld

Blobworld: Query by Shape / Texture / Location / Color

Selected Blob

Query:

by Shape of Blob

Result:

…are these shapes similar ?

Satisfying ?

Page 11: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Blobworld

Result:

SHAPE recognition seems to be necessary but not easy !

Page 13: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

The Interface (JAVA – Applet)

Page 14: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

The Sketchpad: Query by Shape

Page 15: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

The First Guess: Different Shape - Classes

Page 16: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Selected shape defines query by shape – class

Page 17: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Result

Page 18: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

ISS Database

ISS: Query by Shape / Texture

Sketch of Shape

Query:

by Shape only

Result:

Satisfying ?

Page 19: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

ISS Database

SHAPE recognition seems tobe possible and leads to satisfying results !

Page 20: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

ISS Database

The ISS-Database will be topic of part IV of this tutorial

…so stay alert !

Page 21: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Overview

Overview Part 1

• Why shape ?• What is shape ?• Shape similarity• Metrices• Classes of similarity measures• Feature Based Coding• Examples for global similarity

Page 22: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Why Shape ?

Why Shape ?

• Shape is probably the most important property that is perceived about objects. It allows to predict more facts about an object than other features, e.g. color (Palmer 1999)

• Thus, recognizing shape is crucial for object recognition. In some applications it may be the only feature present, e.g. logo recognition

Page 23: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Why Shape ?

Shape is not only perceived by visual means:

• tactical sensors can also provide shape information that are processed in a similar way.

• robots’ range sensor provide shape information, too.

Page 24: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Shape

Typical problems:

• How to describe shape ? • What is the matching

transformation?• No one-to-one correspondence• Occlusion• Noise

Page 25: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Shape

• Partial match: only part of query appears in part of database shape

Page 26: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

What is Shape ?

What is Shape ?

Plato, "Meno", 380 BC:

• "figure is the only existing thing that is found always following color“

• "figure is limit of solid"

Page 27: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

What is Shape ?

… let’s start with some properties easier to agree on:

• Shape describes a spatial regionShape is a (the ?) specific part of spatial cognition

• Typically addresses 2D spacewhy ?

Page 28: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

What is Shape ?

• 3D => 2D projection

Page 29: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

What is Shape ?

• the original 3D (?) object

Page 30: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

What is Shape ?

Moving on from the naive understanding, some questions arise:

• Is there a maximum size for a shape to be a shape?

• Can a shape have holes?• Does shape always describe a connected

region?• How to deal with/represent partial shapes

(occlusion / partial match) ?

Page 31: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

What is Shape ?

Shape or Not ?

Continuous transformation from shape to no shape: Is there a point when it stops being a shape?

Page 32: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

What is Shape ?

Shape or Not ?

Continuous transformation from shape to two shapes: Is there a point when it stops being a single shape?

Page 33: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

What is Shape ?

But there’s no doubt that

a single, connected region

is a shape.

Right ?

Page 34: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

What is Shape ?

A single, connected region.But a shape ?

A question of scale !

Page 35: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

What is Shape ?

• There’s no easy, single definition of shape• In difference to geometry, arbitrary shape is not

covered by an axiomatic system

• Different applications in object recognition focus on different shape related features• Special shapes can be handled

• Typically, applications in object recognition employ a similarity measure to determine a plausibility that two shapes correspond to each other

Page 36: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Similarity

So the new question is:

What is Shape Similarity ?

or

How to Define a Similarity Measure

Page 37: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Similarity

Again: it’s not so simple (sorry).

There’s nothing like

THE

similarity measure

Page 38: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Similarity

which similarity measure,

depends onwhich required properties,

depends onwhich particular matching problem,

depends onwhich application

Page 39: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Similarity

... robustness

... invariance to basic transformations

Simple Recognition (yes / no)

Common Rating (best of ...)

Analytical Rating (best of, but...)

…which application

Page 40: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Similarity

…which problem

• computation problem: d(A,B)

• decision problem: d(A,B) <e ?

• decision problem: is there g: d(g(A),B) <e ?

• optimization problem: find g: min d(g(A),B)

Page 41: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Similarity

…which properties:

We concentrate here on the computational problem d(A,B)

Page 42: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Similarity Measure

Requirements to a similarity measure

• Should not incorporate context knowledge (no AI), thus computes generic shape similarity

Page 43: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Similarity Measure

Requirements to a similarity measure

• Must be able to deal with noise• Must be invariant with respect to basic

transformations

Next:StrategyScaling (or resolution)

Rotation

Rigid / non-rigid deformation

Page 44: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Similarity Measure

Requirements to a similarity measure

• Must be able to deal with noise

• Must be invariant with respect to basic transformations

• Must be in accord with human perception

Page 45: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Similarity Measure

Some other aspects worth consideration:

• Similarity of structure• Similarity of area

Can all these aspects be expressed by a single number?

Page 46: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Similarity Measure

Desired Properties of a Similarity Function C(Basri et al. 1998)

• C should be a metric• C should be continous• C should be invariant (to…)

Page 47: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Properties

Metric Properties

S set of patternsMetric: d: S S R satisfying1. Self-identity: xS, d(x,x)=02. Positivity: x yS, d(x,y)>03. Symmetry: x, yS, d(x,y)= d(y,x)4. Triangle inequality: x, y, zS, d(x,z)d(x,y)

+d(y,z)

• Semi-metric: 1, 2, 3• Pseudo-metric: 1, 3, 4• S with fixed metric d is called metric space

Page 48: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Properties

1. Self-identity: xS, d(x,x)=02. Positivity: x yS, d(x,y)>0

…surely makes sense

Page 49: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Properties

Page 50: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Properties

Page 51: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Properties

In general:

• a similarity measure in accordance with human perception is NOT a metric. This leads to deep problems in further processing, e.g. clustering, since most of these algorithms need metric spaces !

Page 52: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Properties

Continuity:

“usually useful”, although sometimes not in accordance with principles of Gestalt properties, e.g. symmetry,

collinearity.

Page 53: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Properties

Page 54: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Properties

Page 55: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Properties

Some more properties:

• One major difference should cause a greater dissimilarity than some minor ones.

• S must not diverge for curves that are not smooth (e.g. polygons).

However, these demands are contradictory (proof is left as an exercise)

Page 56: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Similarity Measures

Classes of Similarity Measures:

Similarity Measure depends on

• Shape Representation

• Boundary

• Area (discrete: = point set)

• Structural (e.g. Skeleton)

• Comparison Model

• feature vector

• direct

Page 57: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Similarity Measures

direct feature based

Boundary Spring model, Cum. Angular Function, Chaincode, Arc Decomposition (ASR-Algorithm)

Central Dist. Fourier

Distance histogram

Area (point set) Hausdorff

Moments

Zernike Moments

Structure Skeleton

---

Page 58: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Feature Based Coding

Feature Based Coding

This category defines all approaches that determine a feature-vector for a given shape.

Two operations need to be defined: a mapping of shape into the feature space and a similarity of feature vectors.

Representation Feature Extraction Vector Comparison

Page 59: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Vector Comparison

Vector Comparison

,

Page 60: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Vector Comparison

Page 61: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Vector Comparison

Page 62: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Vector Comparison

Page 63: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Vector Comparison

More Vector Distances:

• Quadratic Form Distance

• Earth Movers Distance

• Proportional Transportation Distance

• …

Page 64: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Vector Comparison

Histogram Comparison

• Vector Comparison

• Histogram Intersection

• …

Page 65: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Vector Comparison

Page 66: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Feature Based Coding

Again:

Two operations need to be defined: a mapping of shape into the feature space and a similarity of feature vectors.

We hence have TWO TIMES an information reduction of the basic representation, which by itself is already a mapping of the ‘reality’.

Representation Feature Extraction Vector Comparison

Page 67: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Vector Comparison

Example 1

Elementary Descriptors

Shape A,B given as

• Area (continous) or

• Point Sets (discrete)(Elementary Descriptors are 1dimensional feature

vectors)

Page 68: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Vector Comparison

Page 69: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Vector Comparison

Boundary Box (area):

These shapes are equal…

Page 70: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Vector Comparison

Boundary Box (area):

…these shapes differ

Page 71: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Vector Comparison

Example 2

(Discrete) Moments

Shape A,B given as

• Area (continous) or

• Point Sets (discrete)

Page 72: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Moments

Discrete Point Sets

Page 73: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Moments

Page 74: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Moments

Page 75: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Moments

Page 76: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Discrete Moments

Exercise:

Please compute all 7 moments for the following shapes, compare the vectors using different comparison techniques

Page 77: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Discrete Moments

Result: each shape is transformed to a 7-dimensional vector. To compare the shapes, compare the vectors (how ?).

Page 78: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Vector Comparison

Example 3

Central Distance Fourier

Shape A,B given as

Contour (Boundary)

Page 79: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Vector Comparison

Contour is given as list of euclidean coordinates:

0,0; 1,0; 2,0; 2,1; 2,2; 3,3; 4,3; 5,2; …

0 1 2

3

4

5 6

7 ...

...

Page 80: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Central Distance Fourier

(MATLAB DEMO)

Page 81: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

3D Distance Histogram

Example 4

3D Distance Histogram

Shape A,B given as 3D point set

Page 82: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

3D Distance Histogram

(MATLAB DEMO)

Page 83: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Vector Comparison

All Feature Vector approaches have similar properties:

• Provide a compact representation

• this is especially interesting for database indexing !

• Works for any shape

• Requires complete shapes (global comparison)

• Sensible to noise (except Zernike moments which are computationally demanding)

• Map dissimilar shapes to similar feature vectors (!)• They can be used as a prefilter for database applications !

• Make the choice of a similarity function difficult

Page 84: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Direct Comparison

End of Feature Based Coding !

Next:

Direct Comparison

Page 85: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Vector ComparisonDirect Comparison

Example 1

Hausdorff Distance

Shape A,B given as point sets

A={a1,a2,…}

B={b1,b2,…}

Page 86: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Vector ComparisonFeature Based Coding

Page 87: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Vector ComparisonHausdorff Distance

Page 88: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Vector ComparisonBoundary Representation

Hausdorff:

Unstable with respect to noise(This is easy to fix ! How ?)

Problem: Invariance !Nevertheless: Hausdorff is the motor behind many applications in specific fields (e.g. character recognition)

Page 89: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Vector ComparisonBoundary Representation

Example 2

Chaincode Comparison

Shape A,B given as chaincode

Page 90: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Vector ComparisonBoundary Representation

Page 91: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Vector ComparisonBoundary Representation

A binary image can be converted into a ‘chain code’ representing the boundary. The boundary is traversed and a string representing the curvature is constructed.

0

123

4

5 6 7

C

5,6,6,3,3,4,3,2,3,4,5,3,…

Page 92: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Vector ComparisonBoundary Representation

For curvature classes, a similarity can be defined:

Page 93: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Vector ComparisonBoundary Representation

To extend this measure to strings, two steps are carried out.

1. Extend the measure to character against string, for example by summing up individual similarity measures.

2. Employing a matching to compute a correspondence of sub-strings. Hereby, the matching constitutes from 1-to-1, 1-to-many, and many-to-1-matchings. It is computed as string matching by means of dynamic programming.

Page 94: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Vector ComparisonBoundary Representation

Digital curves suffer from effects caused by digitalization, e.g. rotation:

Page 95: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Vector ComparisonBoundary Representation

Compare chaincodes by string matchingAs string-matching is not able to model a matching of digital curves adequately, more sophisticated matching algorithms are employed in “real applications” using chain codes:

Weighted Levensthein DistanceDefines an edit distance for transforming one string into another.

Costs are defined for altering, deleting, or inserting a character.

Extended DistanceFormal translation system with costs assigned to individual production rules.

Page 96: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Vector ComparisonStructural Representation

Example 3

Skeletons

Shape A,B primarily given as area or boundary, structure is derived from

representation

Page 97: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Vector ComparisonStructural Representation

Structural approaches capture the structure of a shape, typically by rep-resenting shape as a graph.

Typical example: skeletons

Page 98: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Vector ComparisonStructural Representation

The computation can be described as a medial axis transform, a kind of discrete generalized voronoi.

Page 99: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Vector ComparisonStructural Representation

The graph is constructed mirroring the adjacency of the skeleton’s parts. Edges are labeled according to the qualitative classes.

Matching two shapes requires matching two usually different graphs against each other.

Page 100: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Vector ComparisonStructural Representation

Problems of skeletons:

- Pruning

Page 101: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Vector ComparisonStructural Representation

-Robustness

(MATLAB Demo)

Page 102: Shape-Representation and Shape Similarity Dr. Rolf Lakaemper Part 1: Shapes.

Vector ComparisonShape similarity

All similarity measures shown can not deal with occlusions or partial matching (except skeletons ?) !

They are useful (and used) for specific applications, but are not sufficient to deal with arbitrary shapes

Solution: Part – based similarity !