Learning Object Representation Andrej Lúčny Department of Applied Informatics

47
Learning Object Representation Andrej Lúčny Department of Applied Informatics Faculty of Mathematics, Physics and Informatics Comenius University, Bratislava [email protected] www.microstep-mis.com/~andy

description

Learning Object Representation Andrej Lúčny Department of Applied Informatics Faculty of Mathematics, Physics and Informatics Comenius University, Bratislava andy @microstep-mis.com www.microstep-mis.com/~andy. Regular objects. few parameters fully describe the object - PowerPoint PPT Presentation

Transcript of Learning Object Representation Andrej Lúčny Department of Applied Informatics

Page 1: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Learning Object Representation

Andrej Lúčny

Department of Applied Informatics

Faculty of Mathematics, Physics and Informatics

Comenius University, Bratislava

[email protected]

www.microstep-mis.com/~andy

Page 2: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Regular objects

few parameters fully describe the object

recognize object = specify its parameters

Page 3: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Regular objects

e.g. Hough transformConversion of image to parameters

Page 4: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Image

Three arrays r[h,w], g[h,w], b[h,w], values 0..255 corresponding to color ingredients

Page 5: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Red ingredient

Page 6: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Green ingredient

Page 7: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Blue ingredient

Page 8: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Intensity map

bw[i,j] = 0.3*r[i,j] + 0.59*g[i,j] + 0.11*b[i,j]

Page 9: Learning Object Representation Andrej Lúčny Department of Applied Informatics

• Looking for edges:one line can be represented as a function

Page 10: Learning Object Representation Andrej Lúčny Department of Applied Informatics

column

inte

nsit

y

• Edges corresponds to sharp sectors

Page 11: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Sobel operator

ai-1,j-1 ai-1,j ai-1,j+1

ai,j-1 ai,j ai,j+1

ai+1,j-1 ai+1,j ai+1,j+1

bi,j

-1 0 1

-2 0 2

-1 0 1

º =

dxi,j = ai-1,j+1 + 2ai,j+1 + ai+1,j+1 - ai-1,j-1 - 2ai,j-1 - ai+1,j-1

ai-1,j-1 ai-1,j ai-1,j+1

ai,j-1 ai,j ai,j+1

ai+1,j-1 ai+1,j ai+1,j+1

bi,j

-1 -2 -1

0 0 0

1 2 1

º =

dyi,j = ai+1,j-1 + 2ai+1,j + ai+1,j+1 - ai-1,j-1 - 2ai-1,j – ai-1,j+1

Page 12: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Sobel operator approximated image derivation (gradient)Concerning a threshold Sobel operator indicates us edges

threshold

Page 13: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Sobel operator

|dx| |dy|

Page 14: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Sobel operator

|grad| = √ (dx + dy )2 2

Page 15: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Binary image

Page 16: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Thinning

? ??

?? ?

?

?

?

? ? ?

? ?

?

??

?

? ?

Page 17: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Thinning

Page 18: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Hough transform

Example: Circle

Task: how to turn thinned image to circle parameters

Paramaters:• center x-coordinate • center y-coordinate• radius

x

y

r

Page 19: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Hough transform

Each parameter has a particular range

E.g. for image with resolution 320 x 240 :• Range of center x-coordinate is 0..319• Range of center y-coordinate is 0..239• Range of radius is 10..200

We evaluate probability of each tupple (x,y,r)

from the given range

Page 20: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Hough transform

x

y

• The probability P[x,y,r] is given by number of witnesses, i.e. white pixels on thinned image which would be white if one draws circle with parameters x,y,r.

r

Page 21: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Hough transform

Circle is recognized !

Page 22: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Irregular objects

Parameters of irregular objects are not clear !

It is better look an universal method how to learn their representation

Page 23: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Irregularobjects

e.g. Dominant orientation templates

How such objects are

represented?

Page 24: Learning Object Representation Andrej Lúčny Department of Applied Informatics

• Simple but fast and efficient method

Dominant orientation templates (DOT)

Page 25: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Motivation

template

image dealing with thinned edges

Page 26: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Edges detector Canny

intensity

|gradient| orientations

|dx|

thinned edges

|dy|

Page 27: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Orientations

(dx, dy)

01

23456

7

Page 28: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Template

• based on the orientations

Page 29: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Template

• object is covered by non-overlapping regions

Page 30: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Template• We concern orientation of any pixel in region,

which lies on edge

Page 31: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Template• We select set of dominant (prevailing)

orientations

Page 32: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Template• We have such set of few dominant

templates for each region

Page 33: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Template• The sets of dominant orientations form the

representation of the object

Page 34: Learning Object Representation Andrej Lúčny Department of Applied Informatics

How to use the template• We cover image by regions and select one most

dominant orientation for each region

template

image

Page 35: Learning Object Representation Andrej Lúčny Department of Applied Informatics

How to use template• Object is found if for the most of regions the dominant

orientation from image is an element of the set of dominant orientations in template

template image

Page 36: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Basic formal expression

I – current imageO – image from which the template is createdc – position on the image IR – region c + R – corresponding region put to position cDO(O,R) : set of (maximally k) dominant orientations in region R in template, i.e. on the image Odo(I,R) : dominant orientation in region R in the current image I do(X, R ) = DO(X, R ) for k = 1 δ(x) = x ? 1 : 0 where x is true or false

Page 37: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Does it work ?• Yes, if we put region R to proper position c• No, otherwise

Therefore we will need more templates for various positioning of regions

templates

positions…

Page 38: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Advanced formal expression

I – current imageO – image from which the template is createdw(O,M) – image O shifted by Mc – position on the image IR – region, c + R – corresponding region put to position cDO(O,R) : set of (maximally k) dominant orientations in region R in template, i.e. on the image Odo(I,R) : dominant orientation in region R in the current image Iδ(x) = x ? 1 : 0 where x is true or false

Page 39: Learning Object Representation Andrej Lúčny Department of Applied Informatics

More effective but less precise approach• We can summarize more overlapping templates to one.• We simply add orientations from overlapping regions.• Such template must fit regardless shifting, but can detect also phantoms

integrated templatetemplates

Page 40: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Formalism of the efficient approach

I – current imageO – image from which the template is createdw(O,M) – image O shifted by Mc – position on the image IR – region, c + R – corresponding region put to position cDO(O,R) : set of (maximally k) dominant orientations in region R in template, i.e. on the image Odo(I,R) : dominant orientation in region R in the current image Iδ(x) = x ? 1 : 0 where x is true or false

=

Page 41: Learning Object Representation Andrej Lúčny Department of Applied Informatics

More viewpoints• Still one template represents the object from one viewpoint only• Therefore we need to create more templates from various viewpoints• Again we can integrate more templates which are similar enough to one (in

the same way as shifted templates)

Page 42: Learning Object Representation Andrej Lúčny Department of Applied Informatics

DOT efficiency• Belonging of orientation to a template can be represented by bits

0 or 1 and all DOT can be expressed in form of bit operations • Therefore DOT is very fast and running in real time

Page 43: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Object border• DOT can provide also approximate border of the object.• It is created by those edge pixels for which we have found

their orientation in the template

Page 44: Learning Object Representation Andrej Lúčny Department of Applied Informatics

How to get template?

• Scan object put to contrast scene by camera from various viewpoints (i.e. not in the natural scene but under specific conditions)

or• separate object from scene by another method (e.g. by movement detector)

Page 45: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Failure of recognition

pattern

1.

2.

Failure or creativity ?

phantom

Page 46: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Further study

Hinterstoisser, S. - Lepetit, V. - Ilic, S. - Fua, P. - Navab, N.: Dominant Orientation Templates for Real-Time Detection of Texture-Less Objects. IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR), San Francisco, California (USA), June 2010

Page 47: Learning Object Representation Andrej Lúčny Department of Applied Informatics

Thank you !

Andrej LúčnyDepartment of Applied Informatics

Faculty of Mathematics, Physics and Informatics

Comenius University, Bratislava

[email protected]

www.microstep-mis.com/~andy