46
© 2011 Frank Nielsen . Lecture 1 INF555 Fundamentals of 3D Lecture 1: Abstract Data Structures Stacks, queues and hashing with... ...applications in visual computing Mercredi 14 Septembre 2011

(slides 1) Visual Computing: Geometry, Graphics, and Vision

Embed Size (px)

DESCRIPTION

Those are the slides for the book: Visual Computing: Geometry, Graphics, and Vision. by Frank Nielsen (2005) http://www.sonycsl.co.jp/person/nielsen/visualcomputing/ http://www.amazon.com/Visual-Computing-Geometry-Graphics-Charles/dp/1584504277

Citation preview

Page 1: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

INF555

Fundamentals of 3D

Lecture 1 Abstract Data Structures

Stacks queues and hashing withapplications in visual computing

Mercredi 14 Septembre 2011

copy 2011 Frank Nielsen Lecture 1

INF555 Fundamentals of 3D

L1 Abstract data structures L2 Transformations and coordinate pipelines L3 Advanced transformations L4 Images and colors L5 Meshes L6 Animation L7 Randomized algorithms L8 High-dimensions for 3D L9 Robustness

rarr Examen 20 min oral en Deacutecembre

copy 2011 Frank Nielsen Lecture 1

Deacuteboucheacutes de la filiegravere Image (4A)middotmiddotFormation complementaire inteacutegreacutee (FCI) avec lmiddotmiddotEacutecole des Ponts ParisTech

Master II middotmiddotMatheacutematiques Vision Apprentissage (MVA)

Master II agrave lmiddotmiddotEacutecole Polytechnique Feacutedeacuterale de Lausanne (EPFL) Suisse Master II dinformatique Master II de robotique et systegravemes autonomes

middotmiddotTeacuteleacutecom ParisTech (ENST) + Master middotmiddotspeacutecialiteacute imagerie du vivant (IMA) + Master middotmiddotIntelligence Artificielle et Deacutecision (IAD) agrave UPMC

Cadre du Corps de lArmement (filiegravere recherche) middotmiddotRoyal Institute of Technology (KTH Stockholm Sueacutede )

Master agrave leacutetranger (notamment aux Etats-Unis et au Japon) Master agrave Columbia University USA en infographieMaster en Electrical and Computer Engineering Cornell University USA

Master II middotmiddotMaster Parisien de Recherche en Informatique (MPRI) Master II middotmiddotMatheacutematiques Vision Apprentissage (MVA) middotmiddotENSIMAG middotmiddotENSTA Masters europeacuteens

Master middotmiddotETH Zuumlrich middotmiddotTU Munchen Computer Science Dept Master in middotmiddotBiomedical Engineering agrave Oxford

middot Masters internationaux Eacutetats-Unis Japon middot etc

httpwwwlixpolytechniquefr~nielsenINF555devenirhtml

copy 2011 Frank Nielsen Lecture 1

Notations et projets

httpwwwlixpolytechniquefrLaboFrankNielsenINF555HallFamePj2008HF2008-Pjhtmlhttpwwwlixpolytechniquefr~nielsenINF555indexhtml

bull 30 rendus des programmes TDs bull 20 controle de connaissance par questions orales (lors de la soutenance

du projet) bull 50 soutenance de projet

copy 2011 Frank Nielsen Lecture 1

httpwwwlixpolytechniquefrLaboFrankNielsenINF555HallFamePj2009

Dehazing(anti-brouillard)

Stippling(pointillisme)

TextureShop(retextureacute les photos)

Face recognitioncompression(algorithmique du visage)

Out of bound photo(effet photo 3D)

copy 2011 Frank Nielsen Lecture 1

Reference textbook

httpwwwsonycslcojppersonnielsenvisualcomputing

Disponible agrave la bibliothegraveque en 5 exemplairesAllez lemprucircnter

copy 2011 Frank Nielsen Lecture 1

Abstract Data Structures

Concepts encapsulated into an interface

Multiple implementations (various trade-offs)

rarr Good for code reuse (APIs) rarr Actual implementation is hidden

copy 2011 Frank Nielsen Lecture 1

Outline of Abstract DS

Abstract data-structures in Java

Area Flood filling (larr stacks and larr queues)

Any segment pair intersection (larr dictionary)

Image segmentation (larr union-find disjoint elements)

Object recognition (larr geometric hashing)

copy 2011 Frank Nielsen Lecture 1

I Abstract Data Structures Stack

Interface (method prototypes)isEmptypush(Element)pop (or pull)

For example two implementations Array Linked list

public static void main(String [] args)

Stack myStack=new Stack()int ifor(i=0ilt10i++)

myStackPush(i)

for(i=0ilt15i++)

Systemoutprintln(myStackPull())

copy 2011 Frank Nielsen Lecture 1

class StackArrayint nbmaxint indexint [ ] array

ConstructorsStackArray(int n)thisnbmax=narray=new int[nbmax] index=-1Systemoutprintln(Succesfully created a stack array object)

Methods INTERFACEvoid Push(int element)if (indexltnbmax-1)

array[++index]=element

int Pull()if (indexgt=0 ) return array[index--]else return -1

Stack (array)

copy 2011 Frank Nielsen Lecture 1

Stack (linked list)class StackList listStack()list=null

void Push(int el)if (list=null) list=listinsertHead(el)

else list=new

List(elnull)

int Pull()int valif (list=null)

val=listelement list=listnext else val=-1

return val

class Listint elementList next

ConstructorList(int el List tail)thiselement=elthisnext=tail

List insertHead(int el)return new List(elthis)

copy 2011 Frank Nielsen Lecture 1

httpjavasuncomj2se142docsapijavautilStackhtml

Java documentation of interfaces

Commentez vos programmes avec JavaDoc (sous Eclipse)ou Doxygen (incluant des formules latex par exemple)httpwwwstacknl~dimitridoxygen

copy 2011 Frank Nielsen Lecture 1

II Computer Graphics Area Flood Filling

Basic coloring application

copy 2011 Frank Nielsen Lecture 1

Area Flood Filling

Tint filling

Tint fill+pattern fill

Gradient filling

copy 2011 Frank Nielsen Lecture 1

Application Vectorization of Cartoon Animation

rarr Rendering to multi-size displaysrarr Interaction with image semantic

Vectorizing Cartoon AnimationsJulyAugust 2009 (vol 15 no 4)pp 618-629

copy 2011 Frank Nielsen Lecture 1

Area Flood FillingImages as large graphs (million pixels)Image (pixel) connectivity 4- or 8-connectivity (but also hexagonal etc)

Example of flood filling (cartoon animation etc)

httpwww-graphicsstanfordedu~levoysands_awardhtml

copy 2011 Frank Nielsen Lecture 1

Area Flood Filling Recursive Algorithm

Use an abstract data-structure Stack

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a stackHandle recursion explicitly with the stack

Depth first order

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a queue

Properties of abstract queues

Breadth first order

copy 2011 Frank Nielsen Lecture 1

Stack(depth search)

Queue(breadth search)

copy 2011 Frank Nielsen Lecture 1

3 Abstract dictionariesStore items indexed by keysAxiomatic semantic

Unordered (collection) or ordered dictionaries (rarr augmented dictionaries)

copy 2011 Frank Nielsen Lecture 1

IV Dictionaries Detecting Any Segment Pair Intersection Naive quadratic time algorithm

copy 2011 Frank Nielsen Lecture 1

S2 intersects S4 At some position they become y-adjacent

Sweeping line combinatorial algorithm 2n extremities onlyrarr 2n events so swap from left to right(A preliminary computational geometric algorithm)

A structural propertyrarr Sweeping combinatorial events

copy 2011 Frank Nielsen Lecture 1

Ordered dictionary

For a given query (ey) report the line segment immediately above and below (ey)

Dynamic insertiondeletion of line segment extremities

Implementation using binary trees (red-black AVL etc)

copy 2011 Frank Nielsen Lecture 1

Shamos-Hoey intersection detection algorithmDoes a pair of segment intersect Yes or No

copy 2011 Frank Nielsen Lecture 1

Priority queues

(INF311 Implementation using implicit heaps stored in an array)

For the line sweep 3 kinds of events type 1 Begin extremity type 2 End extremity type 3 Intersection point

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm (extend Shamos-Hoey)Complexity O((n+I) log n)

Initialization

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm Handling events

Interesting caseSwap manually order at intersection points

copy 2011 Frank Nielsen Lecture 1

httpenwikipediaorgwikiBentleyE28093Ottmann_algorithm

Collision detection for 3D games

copy 2011 Frank Nielsen Lecture 1

IV Union-Find abstract data-structuresManage disjoint sets very efficiently under union

Example Image segmentation (let a robot see)

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

Each region is a setInitially each pixel defines a region

Merging regions=merging disjoint sets

For a given element find the set that contains it

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

copy 2011 Frank Nielsen Lecture 1

Path compressionAlmost linear-size data-structure(inverse of Ackermann function)

copy 2011 Frank Nielsen Lecture 1

Union find DS for labelling connected components

Much easier problem than segmentation

Disjoint set data-structure

copy 2011 Frank Nielsen Lecture 1

Segmentation clustering and tone mapping

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 2: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

INF555 Fundamentals of 3D

L1 Abstract data structures L2 Transformations and coordinate pipelines L3 Advanced transformations L4 Images and colors L5 Meshes L6 Animation L7 Randomized algorithms L8 High-dimensions for 3D L9 Robustness

rarr Examen 20 min oral en Deacutecembre

copy 2011 Frank Nielsen Lecture 1

Deacuteboucheacutes de la filiegravere Image (4A)middotmiddotFormation complementaire inteacutegreacutee (FCI) avec lmiddotmiddotEacutecole des Ponts ParisTech

Master II middotmiddotMatheacutematiques Vision Apprentissage (MVA)

Master II agrave lmiddotmiddotEacutecole Polytechnique Feacutedeacuterale de Lausanne (EPFL) Suisse Master II dinformatique Master II de robotique et systegravemes autonomes

middotmiddotTeacuteleacutecom ParisTech (ENST) + Master middotmiddotspeacutecialiteacute imagerie du vivant (IMA) + Master middotmiddotIntelligence Artificielle et Deacutecision (IAD) agrave UPMC

Cadre du Corps de lArmement (filiegravere recherche) middotmiddotRoyal Institute of Technology (KTH Stockholm Sueacutede )

Master agrave leacutetranger (notamment aux Etats-Unis et au Japon) Master agrave Columbia University USA en infographieMaster en Electrical and Computer Engineering Cornell University USA

Master II middotmiddotMaster Parisien de Recherche en Informatique (MPRI) Master II middotmiddotMatheacutematiques Vision Apprentissage (MVA) middotmiddotENSIMAG middotmiddotENSTA Masters europeacuteens

Master middotmiddotETH Zuumlrich middotmiddotTU Munchen Computer Science Dept Master in middotmiddotBiomedical Engineering agrave Oxford

middot Masters internationaux Eacutetats-Unis Japon middot etc

httpwwwlixpolytechniquefr~nielsenINF555devenirhtml

copy 2011 Frank Nielsen Lecture 1

Notations et projets

httpwwwlixpolytechniquefrLaboFrankNielsenINF555HallFamePj2008HF2008-Pjhtmlhttpwwwlixpolytechniquefr~nielsenINF555indexhtml

bull 30 rendus des programmes TDs bull 20 controle de connaissance par questions orales (lors de la soutenance

du projet) bull 50 soutenance de projet

copy 2011 Frank Nielsen Lecture 1

httpwwwlixpolytechniquefrLaboFrankNielsenINF555HallFamePj2009

Dehazing(anti-brouillard)

Stippling(pointillisme)

TextureShop(retextureacute les photos)

Face recognitioncompression(algorithmique du visage)

Out of bound photo(effet photo 3D)

copy 2011 Frank Nielsen Lecture 1

Reference textbook

httpwwwsonycslcojppersonnielsenvisualcomputing

Disponible agrave la bibliothegraveque en 5 exemplairesAllez lemprucircnter

copy 2011 Frank Nielsen Lecture 1

Abstract Data Structures

Concepts encapsulated into an interface

Multiple implementations (various trade-offs)

rarr Good for code reuse (APIs) rarr Actual implementation is hidden

copy 2011 Frank Nielsen Lecture 1

Outline of Abstract DS

Abstract data-structures in Java

Area Flood filling (larr stacks and larr queues)

Any segment pair intersection (larr dictionary)

Image segmentation (larr union-find disjoint elements)

Object recognition (larr geometric hashing)

copy 2011 Frank Nielsen Lecture 1

I Abstract Data Structures Stack

Interface (method prototypes)isEmptypush(Element)pop (or pull)

For example two implementations Array Linked list

public static void main(String [] args)

Stack myStack=new Stack()int ifor(i=0ilt10i++)

myStackPush(i)

for(i=0ilt15i++)

Systemoutprintln(myStackPull())

copy 2011 Frank Nielsen Lecture 1

class StackArrayint nbmaxint indexint [ ] array

ConstructorsStackArray(int n)thisnbmax=narray=new int[nbmax] index=-1Systemoutprintln(Succesfully created a stack array object)

Methods INTERFACEvoid Push(int element)if (indexltnbmax-1)

array[++index]=element

int Pull()if (indexgt=0 ) return array[index--]else return -1

Stack (array)

copy 2011 Frank Nielsen Lecture 1

Stack (linked list)class StackList listStack()list=null

void Push(int el)if (list=null) list=listinsertHead(el)

else list=new

List(elnull)

int Pull()int valif (list=null)

val=listelement list=listnext else val=-1

return val

class Listint elementList next

ConstructorList(int el List tail)thiselement=elthisnext=tail

List insertHead(int el)return new List(elthis)

copy 2011 Frank Nielsen Lecture 1

httpjavasuncomj2se142docsapijavautilStackhtml

Java documentation of interfaces

Commentez vos programmes avec JavaDoc (sous Eclipse)ou Doxygen (incluant des formules latex par exemple)httpwwwstacknl~dimitridoxygen

copy 2011 Frank Nielsen Lecture 1

II Computer Graphics Area Flood Filling

Basic coloring application

copy 2011 Frank Nielsen Lecture 1

Area Flood Filling

Tint filling

Tint fill+pattern fill

Gradient filling

copy 2011 Frank Nielsen Lecture 1

Application Vectorization of Cartoon Animation

rarr Rendering to multi-size displaysrarr Interaction with image semantic

Vectorizing Cartoon AnimationsJulyAugust 2009 (vol 15 no 4)pp 618-629

copy 2011 Frank Nielsen Lecture 1

Area Flood FillingImages as large graphs (million pixels)Image (pixel) connectivity 4- or 8-connectivity (but also hexagonal etc)

Example of flood filling (cartoon animation etc)

httpwww-graphicsstanfordedu~levoysands_awardhtml

copy 2011 Frank Nielsen Lecture 1

Area Flood Filling Recursive Algorithm

Use an abstract data-structure Stack

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a stackHandle recursion explicitly with the stack

Depth first order

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a queue

Properties of abstract queues

Breadth first order

copy 2011 Frank Nielsen Lecture 1

Stack(depth search)

Queue(breadth search)

copy 2011 Frank Nielsen Lecture 1

3 Abstract dictionariesStore items indexed by keysAxiomatic semantic

Unordered (collection) or ordered dictionaries (rarr augmented dictionaries)

copy 2011 Frank Nielsen Lecture 1

IV Dictionaries Detecting Any Segment Pair Intersection Naive quadratic time algorithm

copy 2011 Frank Nielsen Lecture 1

S2 intersects S4 At some position they become y-adjacent

Sweeping line combinatorial algorithm 2n extremities onlyrarr 2n events so swap from left to right(A preliminary computational geometric algorithm)

A structural propertyrarr Sweeping combinatorial events

copy 2011 Frank Nielsen Lecture 1

Ordered dictionary

For a given query (ey) report the line segment immediately above and below (ey)

Dynamic insertiondeletion of line segment extremities

Implementation using binary trees (red-black AVL etc)

copy 2011 Frank Nielsen Lecture 1

Shamos-Hoey intersection detection algorithmDoes a pair of segment intersect Yes or No

copy 2011 Frank Nielsen Lecture 1

Priority queues

(INF311 Implementation using implicit heaps stored in an array)

For the line sweep 3 kinds of events type 1 Begin extremity type 2 End extremity type 3 Intersection point

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm (extend Shamos-Hoey)Complexity O((n+I) log n)

Initialization

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm Handling events

Interesting caseSwap manually order at intersection points

copy 2011 Frank Nielsen Lecture 1

httpenwikipediaorgwikiBentleyE28093Ottmann_algorithm

Collision detection for 3D games

copy 2011 Frank Nielsen Lecture 1

IV Union-Find abstract data-structuresManage disjoint sets very efficiently under union

Example Image segmentation (let a robot see)

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

Each region is a setInitially each pixel defines a region

Merging regions=merging disjoint sets

For a given element find the set that contains it

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

copy 2011 Frank Nielsen Lecture 1

Path compressionAlmost linear-size data-structure(inverse of Ackermann function)

copy 2011 Frank Nielsen Lecture 1

Union find DS for labelling connected components

Much easier problem than segmentation

Disjoint set data-structure

copy 2011 Frank Nielsen Lecture 1

Segmentation clustering and tone mapping

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 3: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

Deacuteboucheacutes de la filiegravere Image (4A)middotmiddotFormation complementaire inteacutegreacutee (FCI) avec lmiddotmiddotEacutecole des Ponts ParisTech

Master II middotmiddotMatheacutematiques Vision Apprentissage (MVA)

Master II agrave lmiddotmiddotEacutecole Polytechnique Feacutedeacuterale de Lausanne (EPFL) Suisse Master II dinformatique Master II de robotique et systegravemes autonomes

middotmiddotTeacuteleacutecom ParisTech (ENST) + Master middotmiddotspeacutecialiteacute imagerie du vivant (IMA) + Master middotmiddotIntelligence Artificielle et Deacutecision (IAD) agrave UPMC

Cadre du Corps de lArmement (filiegravere recherche) middotmiddotRoyal Institute of Technology (KTH Stockholm Sueacutede )

Master agrave leacutetranger (notamment aux Etats-Unis et au Japon) Master agrave Columbia University USA en infographieMaster en Electrical and Computer Engineering Cornell University USA

Master II middotmiddotMaster Parisien de Recherche en Informatique (MPRI) Master II middotmiddotMatheacutematiques Vision Apprentissage (MVA) middotmiddotENSIMAG middotmiddotENSTA Masters europeacuteens

Master middotmiddotETH Zuumlrich middotmiddotTU Munchen Computer Science Dept Master in middotmiddotBiomedical Engineering agrave Oxford

middot Masters internationaux Eacutetats-Unis Japon middot etc

httpwwwlixpolytechniquefr~nielsenINF555devenirhtml

copy 2011 Frank Nielsen Lecture 1

Notations et projets

httpwwwlixpolytechniquefrLaboFrankNielsenINF555HallFamePj2008HF2008-Pjhtmlhttpwwwlixpolytechniquefr~nielsenINF555indexhtml

bull 30 rendus des programmes TDs bull 20 controle de connaissance par questions orales (lors de la soutenance

du projet) bull 50 soutenance de projet

copy 2011 Frank Nielsen Lecture 1

httpwwwlixpolytechniquefrLaboFrankNielsenINF555HallFamePj2009

Dehazing(anti-brouillard)

Stippling(pointillisme)

TextureShop(retextureacute les photos)

Face recognitioncompression(algorithmique du visage)

Out of bound photo(effet photo 3D)

copy 2011 Frank Nielsen Lecture 1

Reference textbook

httpwwwsonycslcojppersonnielsenvisualcomputing

Disponible agrave la bibliothegraveque en 5 exemplairesAllez lemprucircnter

copy 2011 Frank Nielsen Lecture 1

Abstract Data Structures

Concepts encapsulated into an interface

Multiple implementations (various trade-offs)

rarr Good for code reuse (APIs) rarr Actual implementation is hidden

copy 2011 Frank Nielsen Lecture 1

Outline of Abstract DS

Abstract data-structures in Java

Area Flood filling (larr stacks and larr queues)

Any segment pair intersection (larr dictionary)

Image segmentation (larr union-find disjoint elements)

Object recognition (larr geometric hashing)

copy 2011 Frank Nielsen Lecture 1

I Abstract Data Structures Stack

Interface (method prototypes)isEmptypush(Element)pop (or pull)

For example two implementations Array Linked list

public static void main(String [] args)

Stack myStack=new Stack()int ifor(i=0ilt10i++)

myStackPush(i)

for(i=0ilt15i++)

Systemoutprintln(myStackPull())

copy 2011 Frank Nielsen Lecture 1

class StackArrayint nbmaxint indexint [ ] array

ConstructorsStackArray(int n)thisnbmax=narray=new int[nbmax] index=-1Systemoutprintln(Succesfully created a stack array object)

Methods INTERFACEvoid Push(int element)if (indexltnbmax-1)

array[++index]=element

int Pull()if (indexgt=0 ) return array[index--]else return -1

Stack (array)

copy 2011 Frank Nielsen Lecture 1

Stack (linked list)class StackList listStack()list=null

void Push(int el)if (list=null) list=listinsertHead(el)

else list=new

List(elnull)

int Pull()int valif (list=null)

val=listelement list=listnext else val=-1

return val

class Listint elementList next

ConstructorList(int el List tail)thiselement=elthisnext=tail

List insertHead(int el)return new List(elthis)

copy 2011 Frank Nielsen Lecture 1

httpjavasuncomj2se142docsapijavautilStackhtml

Java documentation of interfaces

Commentez vos programmes avec JavaDoc (sous Eclipse)ou Doxygen (incluant des formules latex par exemple)httpwwwstacknl~dimitridoxygen

copy 2011 Frank Nielsen Lecture 1

II Computer Graphics Area Flood Filling

Basic coloring application

copy 2011 Frank Nielsen Lecture 1

Area Flood Filling

Tint filling

Tint fill+pattern fill

Gradient filling

copy 2011 Frank Nielsen Lecture 1

Application Vectorization of Cartoon Animation

rarr Rendering to multi-size displaysrarr Interaction with image semantic

Vectorizing Cartoon AnimationsJulyAugust 2009 (vol 15 no 4)pp 618-629

copy 2011 Frank Nielsen Lecture 1

Area Flood FillingImages as large graphs (million pixels)Image (pixel) connectivity 4- or 8-connectivity (but also hexagonal etc)

Example of flood filling (cartoon animation etc)

httpwww-graphicsstanfordedu~levoysands_awardhtml

copy 2011 Frank Nielsen Lecture 1

Area Flood Filling Recursive Algorithm

Use an abstract data-structure Stack

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a stackHandle recursion explicitly with the stack

Depth first order

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a queue

Properties of abstract queues

Breadth first order

copy 2011 Frank Nielsen Lecture 1

Stack(depth search)

Queue(breadth search)

copy 2011 Frank Nielsen Lecture 1

3 Abstract dictionariesStore items indexed by keysAxiomatic semantic

Unordered (collection) or ordered dictionaries (rarr augmented dictionaries)

copy 2011 Frank Nielsen Lecture 1

IV Dictionaries Detecting Any Segment Pair Intersection Naive quadratic time algorithm

copy 2011 Frank Nielsen Lecture 1

S2 intersects S4 At some position they become y-adjacent

Sweeping line combinatorial algorithm 2n extremities onlyrarr 2n events so swap from left to right(A preliminary computational geometric algorithm)

A structural propertyrarr Sweeping combinatorial events

copy 2011 Frank Nielsen Lecture 1

Ordered dictionary

For a given query (ey) report the line segment immediately above and below (ey)

Dynamic insertiondeletion of line segment extremities

Implementation using binary trees (red-black AVL etc)

copy 2011 Frank Nielsen Lecture 1

Shamos-Hoey intersection detection algorithmDoes a pair of segment intersect Yes or No

copy 2011 Frank Nielsen Lecture 1

Priority queues

(INF311 Implementation using implicit heaps stored in an array)

For the line sweep 3 kinds of events type 1 Begin extremity type 2 End extremity type 3 Intersection point

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm (extend Shamos-Hoey)Complexity O((n+I) log n)

Initialization

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm Handling events

Interesting caseSwap manually order at intersection points

copy 2011 Frank Nielsen Lecture 1

httpenwikipediaorgwikiBentleyE28093Ottmann_algorithm

Collision detection for 3D games

copy 2011 Frank Nielsen Lecture 1

IV Union-Find abstract data-structuresManage disjoint sets very efficiently under union

Example Image segmentation (let a robot see)

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

Each region is a setInitially each pixel defines a region

Merging regions=merging disjoint sets

For a given element find the set that contains it

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

copy 2011 Frank Nielsen Lecture 1

Path compressionAlmost linear-size data-structure(inverse of Ackermann function)

copy 2011 Frank Nielsen Lecture 1

Union find DS for labelling connected components

Much easier problem than segmentation

Disjoint set data-structure

copy 2011 Frank Nielsen Lecture 1

Segmentation clustering and tone mapping

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 4: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

Notations et projets

httpwwwlixpolytechniquefrLaboFrankNielsenINF555HallFamePj2008HF2008-Pjhtmlhttpwwwlixpolytechniquefr~nielsenINF555indexhtml

bull 30 rendus des programmes TDs bull 20 controle de connaissance par questions orales (lors de la soutenance

du projet) bull 50 soutenance de projet

copy 2011 Frank Nielsen Lecture 1

httpwwwlixpolytechniquefrLaboFrankNielsenINF555HallFamePj2009

Dehazing(anti-brouillard)

Stippling(pointillisme)

TextureShop(retextureacute les photos)

Face recognitioncompression(algorithmique du visage)

Out of bound photo(effet photo 3D)

copy 2011 Frank Nielsen Lecture 1

Reference textbook

httpwwwsonycslcojppersonnielsenvisualcomputing

Disponible agrave la bibliothegraveque en 5 exemplairesAllez lemprucircnter

copy 2011 Frank Nielsen Lecture 1

Abstract Data Structures

Concepts encapsulated into an interface

Multiple implementations (various trade-offs)

rarr Good for code reuse (APIs) rarr Actual implementation is hidden

copy 2011 Frank Nielsen Lecture 1

Outline of Abstract DS

Abstract data-structures in Java

Area Flood filling (larr stacks and larr queues)

Any segment pair intersection (larr dictionary)

Image segmentation (larr union-find disjoint elements)

Object recognition (larr geometric hashing)

copy 2011 Frank Nielsen Lecture 1

I Abstract Data Structures Stack

Interface (method prototypes)isEmptypush(Element)pop (or pull)

For example two implementations Array Linked list

public static void main(String [] args)

Stack myStack=new Stack()int ifor(i=0ilt10i++)

myStackPush(i)

for(i=0ilt15i++)

Systemoutprintln(myStackPull())

copy 2011 Frank Nielsen Lecture 1

class StackArrayint nbmaxint indexint [ ] array

ConstructorsStackArray(int n)thisnbmax=narray=new int[nbmax] index=-1Systemoutprintln(Succesfully created a stack array object)

Methods INTERFACEvoid Push(int element)if (indexltnbmax-1)

array[++index]=element

int Pull()if (indexgt=0 ) return array[index--]else return -1

Stack (array)

copy 2011 Frank Nielsen Lecture 1

Stack (linked list)class StackList listStack()list=null

void Push(int el)if (list=null) list=listinsertHead(el)

else list=new

List(elnull)

int Pull()int valif (list=null)

val=listelement list=listnext else val=-1

return val

class Listint elementList next

ConstructorList(int el List tail)thiselement=elthisnext=tail

List insertHead(int el)return new List(elthis)

copy 2011 Frank Nielsen Lecture 1

httpjavasuncomj2se142docsapijavautilStackhtml

Java documentation of interfaces

Commentez vos programmes avec JavaDoc (sous Eclipse)ou Doxygen (incluant des formules latex par exemple)httpwwwstacknl~dimitridoxygen

copy 2011 Frank Nielsen Lecture 1

II Computer Graphics Area Flood Filling

Basic coloring application

copy 2011 Frank Nielsen Lecture 1

Area Flood Filling

Tint filling

Tint fill+pattern fill

Gradient filling

copy 2011 Frank Nielsen Lecture 1

Application Vectorization of Cartoon Animation

rarr Rendering to multi-size displaysrarr Interaction with image semantic

Vectorizing Cartoon AnimationsJulyAugust 2009 (vol 15 no 4)pp 618-629

copy 2011 Frank Nielsen Lecture 1

Area Flood FillingImages as large graphs (million pixels)Image (pixel) connectivity 4- or 8-connectivity (but also hexagonal etc)

Example of flood filling (cartoon animation etc)

httpwww-graphicsstanfordedu~levoysands_awardhtml

copy 2011 Frank Nielsen Lecture 1

Area Flood Filling Recursive Algorithm

Use an abstract data-structure Stack

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a stackHandle recursion explicitly with the stack

Depth first order

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a queue

Properties of abstract queues

Breadth first order

copy 2011 Frank Nielsen Lecture 1

Stack(depth search)

Queue(breadth search)

copy 2011 Frank Nielsen Lecture 1

3 Abstract dictionariesStore items indexed by keysAxiomatic semantic

Unordered (collection) or ordered dictionaries (rarr augmented dictionaries)

copy 2011 Frank Nielsen Lecture 1

IV Dictionaries Detecting Any Segment Pair Intersection Naive quadratic time algorithm

copy 2011 Frank Nielsen Lecture 1

S2 intersects S4 At some position they become y-adjacent

Sweeping line combinatorial algorithm 2n extremities onlyrarr 2n events so swap from left to right(A preliminary computational geometric algorithm)

A structural propertyrarr Sweeping combinatorial events

copy 2011 Frank Nielsen Lecture 1

Ordered dictionary

For a given query (ey) report the line segment immediately above and below (ey)

Dynamic insertiondeletion of line segment extremities

Implementation using binary trees (red-black AVL etc)

copy 2011 Frank Nielsen Lecture 1

Shamos-Hoey intersection detection algorithmDoes a pair of segment intersect Yes or No

copy 2011 Frank Nielsen Lecture 1

Priority queues

(INF311 Implementation using implicit heaps stored in an array)

For the line sweep 3 kinds of events type 1 Begin extremity type 2 End extremity type 3 Intersection point

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm (extend Shamos-Hoey)Complexity O((n+I) log n)

Initialization

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm Handling events

Interesting caseSwap manually order at intersection points

copy 2011 Frank Nielsen Lecture 1

httpenwikipediaorgwikiBentleyE28093Ottmann_algorithm

Collision detection for 3D games

copy 2011 Frank Nielsen Lecture 1

IV Union-Find abstract data-structuresManage disjoint sets very efficiently under union

Example Image segmentation (let a robot see)

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

Each region is a setInitially each pixel defines a region

Merging regions=merging disjoint sets

For a given element find the set that contains it

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

copy 2011 Frank Nielsen Lecture 1

Path compressionAlmost linear-size data-structure(inverse of Ackermann function)

copy 2011 Frank Nielsen Lecture 1

Union find DS for labelling connected components

Much easier problem than segmentation

Disjoint set data-structure

copy 2011 Frank Nielsen Lecture 1

Segmentation clustering and tone mapping

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 5: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

httpwwwlixpolytechniquefrLaboFrankNielsenINF555HallFamePj2009

Dehazing(anti-brouillard)

Stippling(pointillisme)

TextureShop(retextureacute les photos)

Face recognitioncompression(algorithmique du visage)

Out of bound photo(effet photo 3D)

copy 2011 Frank Nielsen Lecture 1

Reference textbook

httpwwwsonycslcojppersonnielsenvisualcomputing

Disponible agrave la bibliothegraveque en 5 exemplairesAllez lemprucircnter

copy 2011 Frank Nielsen Lecture 1

Abstract Data Structures

Concepts encapsulated into an interface

Multiple implementations (various trade-offs)

rarr Good for code reuse (APIs) rarr Actual implementation is hidden

copy 2011 Frank Nielsen Lecture 1

Outline of Abstract DS

Abstract data-structures in Java

Area Flood filling (larr stacks and larr queues)

Any segment pair intersection (larr dictionary)

Image segmentation (larr union-find disjoint elements)

Object recognition (larr geometric hashing)

copy 2011 Frank Nielsen Lecture 1

I Abstract Data Structures Stack

Interface (method prototypes)isEmptypush(Element)pop (or pull)

For example two implementations Array Linked list

public static void main(String [] args)

Stack myStack=new Stack()int ifor(i=0ilt10i++)

myStackPush(i)

for(i=0ilt15i++)

Systemoutprintln(myStackPull())

copy 2011 Frank Nielsen Lecture 1

class StackArrayint nbmaxint indexint [ ] array

ConstructorsStackArray(int n)thisnbmax=narray=new int[nbmax] index=-1Systemoutprintln(Succesfully created a stack array object)

Methods INTERFACEvoid Push(int element)if (indexltnbmax-1)

array[++index]=element

int Pull()if (indexgt=0 ) return array[index--]else return -1

Stack (array)

copy 2011 Frank Nielsen Lecture 1

Stack (linked list)class StackList listStack()list=null

void Push(int el)if (list=null) list=listinsertHead(el)

else list=new

List(elnull)

int Pull()int valif (list=null)

val=listelement list=listnext else val=-1

return val

class Listint elementList next

ConstructorList(int el List tail)thiselement=elthisnext=tail

List insertHead(int el)return new List(elthis)

copy 2011 Frank Nielsen Lecture 1

httpjavasuncomj2se142docsapijavautilStackhtml

Java documentation of interfaces

Commentez vos programmes avec JavaDoc (sous Eclipse)ou Doxygen (incluant des formules latex par exemple)httpwwwstacknl~dimitridoxygen

copy 2011 Frank Nielsen Lecture 1

II Computer Graphics Area Flood Filling

Basic coloring application

copy 2011 Frank Nielsen Lecture 1

Area Flood Filling

Tint filling

Tint fill+pattern fill

Gradient filling

copy 2011 Frank Nielsen Lecture 1

Application Vectorization of Cartoon Animation

rarr Rendering to multi-size displaysrarr Interaction with image semantic

Vectorizing Cartoon AnimationsJulyAugust 2009 (vol 15 no 4)pp 618-629

copy 2011 Frank Nielsen Lecture 1

Area Flood FillingImages as large graphs (million pixels)Image (pixel) connectivity 4- or 8-connectivity (but also hexagonal etc)

Example of flood filling (cartoon animation etc)

httpwww-graphicsstanfordedu~levoysands_awardhtml

copy 2011 Frank Nielsen Lecture 1

Area Flood Filling Recursive Algorithm

Use an abstract data-structure Stack

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a stackHandle recursion explicitly with the stack

Depth first order

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a queue

Properties of abstract queues

Breadth first order

copy 2011 Frank Nielsen Lecture 1

Stack(depth search)

Queue(breadth search)

copy 2011 Frank Nielsen Lecture 1

3 Abstract dictionariesStore items indexed by keysAxiomatic semantic

Unordered (collection) or ordered dictionaries (rarr augmented dictionaries)

copy 2011 Frank Nielsen Lecture 1

IV Dictionaries Detecting Any Segment Pair Intersection Naive quadratic time algorithm

copy 2011 Frank Nielsen Lecture 1

S2 intersects S4 At some position they become y-adjacent

Sweeping line combinatorial algorithm 2n extremities onlyrarr 2n events so swap from left to right(A preliminary computational geometric algorithm)

A structural propertyrarr Sweeping combinatorial events

copy 2011 Frank Nielsen Lecture 1

Ordered dictionary

For a given query (ey) report the line segment immediately above and below (ey)

Dynamic insertiondeletion of line segment extremities

Implementation using binary trees (red-black AVL etc)

copy 2011 Frank Nielsen Lecture 1

Shamos-Hoey intersection detection algorithmDoes a pair of segment intersect Yes or No

copy 2011 Frank Nielsen Lecture 1

Priority queues

(INF311 Implementation using implicit heaps stored in an array)

For the line sweep 3 kinds of events type 1 Begin extremity type 2 End extremity type 3 Intersection point

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm (extend Shamos-Hoey)Complexity O((n+I) log n)

Initialization

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm Handling events

Interesting caseSwap manually order at intersection points

copy 2011 Frank Nielsen Lecture 1

httpenwikipediaorgwikiBentleyE28093Ottmann_algorithm

Collision detection for 3D games

copy 2011 Frank Nielsen Lecture 1

IV Union-Find abstract data-structuresManage disjoint sets very efficiently under union

Example Image segmentation (let a robot see)

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

Each region is a setInitially each pixel defines a region

Merging regions=merging disjoint sets

For a given element find the set that contains it

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

copy 2011 Frank Nielsen Lecture 1

Path compressionAlmost linear-size data-structure(inverse of Ackermann function)

copy 2011 Frank Nielsen Lecture 1

Union find DS for labelling connected components

Much easier problem than segmentation

Disjoint set data-structure

copy 2011 Frank Nielsen Lecture 1

Segmentation clustering and tone mapping

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 6: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

Reference textbook

httpwwwsonycslcojppersonnielsenvisualcomputing

Disponible agrave la bibliothegraveque en 5 exemplairesAllez lemprucircnter

copy 2011 Frank Nielsen Lecture 1

Abstract Data Structures

Concepts encapsulated into an interface

Multiple implementations (various trade-offs)

rarr Good for code reuse (APIs) rarr Actual implementation is hidden

copy 2011 Frank Nielsen Lecture 1

Outline of Abstract DS

Abstract data-structures in Java

Area Flood filling (larr stacks and larr queues)

Any segment pair intersection (larr dictionary)

Image segmentation (larr union-find disjoint elements)

Object recognition (larr geometric hashing)

copy 2011 Frank Nielsen Lecture 1

I Abstract Data Structures Stack

Interface (method prototypes)isEmptypush(Element)pop (or pull)

For example two implementations Array Linked list

public static void main(String [] args)

Stack myStack=new Stack()int ifor(i=0ilt10i++)

myStackPush(i)

for(i=0ilt15i++)

Systemoutprintln(myStackPull())

copy 2011 Frank Nielsen Lecture 1

class StackArrayint nbmaxint indexint [ ] array

ConstructorsStackArray(int n)thisnbmax=narray=new int[nbmax] index=-1Systemoutprintln(Succesfully created a stack array object)

Methods INTERFACEvoid Push(int element)if (indexltnbmax-1)

array[++index]=element

int Pull()if (indexgt=0 ) return array[index--]else return -1

Stack (array)

copy 2011 Frank Nielsen Lecture 1

Stack (linked list)class StackList listStack()list=null

void Push(int el)if (list=null) list=listinsertHead(el)

else list=new

List(elnull)

int Pull()int valif (list=null)

val=listelement list=listnext else val=-1

return val

class Listint elementList next

ConstructorList(int el List tail)thiselement=elthisnext=tail

List insertHead(int el)return new List(elthis)

copy 2011 Frank Nielsen Lecture 1

httpjavasuncomj2se142docsapijavautilStackhtml

Java documentation of interfaces

Commentez vos programmes avec JavaDoc (sous Eclipse)ou Doxygen (incluant des formules latex par exemple)httpwwwstacknl~dimitridoxygen

copy 2011 Frank Nielsen Lecture 1

II Computer Graphics Area Flood Filling

Basic coloring application

copy 2011 Frank Nielsen Lecture 1

Area Flood Filling

Tint filling

Tint fill+pattern fill

Gradient filling

copy 2011 Frank Nielsen Lecture 1

Application Vectorization of Cartoon Animation

rarr Rendering to multi-size displaysrarr Interaction with image semantic

Vectorizing Cartoon AnimationsJulyAugust 2009 (vol 15 no 4)pp 618-629

copy 2011 Frank Nielsen Lecture 1

Area Flood FillingImages as large graphs (million pixels)Image (pixel) connectivity 4- or 8-connectivity (but also hexagonal etc)

Example of flood filling (cartoon animation etc)

httpwww-graphicsstanfordedu~levoysands_awardhtml

copy 2011 Frank Nielsen Lecture 1

Area Flood Filling Recursive Algorithm

Use an abstract data-structure Stack

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a stackHandle recursion explicitly with the stack

Depth first order

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a queue

Properties of abstract queues

Breadth first order

copy 2011 Frank Nielsen Lecture 1

Stack(depth search)

Queue(breadth search)

copy 2011 Frank Nielsen Lecture 1

3 Abstract dictionariesStore items indexed by keysAxiomatic semantic

Unordered (collection) or ordered dictionaries (rarr augmented dictionaries)

copy 2011 Frank Nielsen Lecture 1

IV Dictionaries Detecting Any Segment Pair Intersection Naive quadratic time algorithm

copy 2011 Frank Nielsen Lecture 1

S2 intersects S4 At some position they become y-adjacent

Sweeping line combinatorial algorithm 2n extremities onlyrarr 2n events so swap from left to right(A preliminary computational geometric algorithm)

A structural propertyrarr Sweeping combinatorial events

copy 2011 Frank Nielsen Lecture 1

Ordered dictionary

For a given query (ey) report the line segment immediately above and below (ey)

Dynamic insertiondeletion of line segment extremities

Implementation using binary trees (red-black AVL etc)

copy 2011 Frank Nielsen Lecture 1

Shamos-Hoey intersection detection algorithmDoes a pair of segment intersect Yes or No

copy 2011 Frank Nielsen Lecture 1

Priority queues

(INF311 Implementation using implicit heaps stored in an array)

For the line sweep 3 kinds of events type 1 Begin extremity type 2 End extremity type 3 Intersection point

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm (extend Shamos-Hoey)Complexity O((n+I) log n)

Initialization

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm Handling events

Interesting caseSwap manually order at intersection points

copy 2011 Frank Nielsen Lecture 1

httpenwikipediaorgwikiBentleyE28093Ottmann_algorithm

Collision detection for 3D games

copy 2011 Frank Nielsen Lecture 1

IV Union-Find abstract data-structuresManage disjoint sets very efficiently under union

Example Image segmentation (let a robot see)

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

Each region is a setInitially each pixel defines a region

Merging regions=merging disjoint sets

For a given element find the set that contains it

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

copy 2011 Frank Nielsen Lecture 1

Path compressionAlmost linear-size data-structure(inverse of Ackermann function)

copy 2011 Frank Nielsen Lecture 1

Union find DS for labelling connected components

Much easier problem than segmentation

Disjoint set data-structure

copy 2011 Frank Nielsen Lecture 1

Segmentation clustering and tone mapping

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 7: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

Abstract Data Structures

Concepts encapsulated into an interface

Multiple implementations (various trade-offs)

rarr Good for code reuse (APIs) rarr Actual implementation is hidden

copy 2011 Frank Nielsen Lecture 1

Outline of Abstract DS

Abstract data-structures in Java

Area Flood filling (larr stacks and larr queues)

Any segment pair intersection (larr dictionary)

Image segmentation (larr union-find disjoint elements)

Object recognition (larr geometric hashing)

copy 2011 Frank Nielsen Lecture 1

I Abstract Data Structures Stack

Interface (method prototypes)isEmptypush(Element)pop (or pull)

For example two implementations Array Linked list

public static void main(String [] args)

Stack myStack=new Stack()int ifor(i=0ilt10i++)

myStackPush(i)

for(i=0ilt15i++)

Systemoutprintln(myStackPull())

copy 2011 Frank Nielsen Lecture 1

class StackArrayint nbmaxint indexint [ ] array

ConstructorsStackArray(int n)thisnbmax=narray=new int[nbmax] index=-1Systemoutprintln(Succesfully created a stack array object)

Methods INTERFACEvoid Push(int element)if (indexltnbmax-1)

array[++index]=element

int Pull()if (indexgt=0 ) return array[index--]else return -1

Stack (array)

copy 2011 Frank Nielsen Lecture 1

Stack (linked list)class StackList listStack()list=null

void Push(int el)if (list=null) list=listinsertHead(el)

else list=new

List(elnull)

int Pull()int valif (list=null)

val=listelement list=listnext else val=-1

return val

class Listint elementList next

ConstructorList(int el List tail)thiselement=elthisnext=tail

List insertHead(int el)return new List(elthis)

copy 2011 Frank Nielsen Lecture 1

httpjavasuncomj2se142docsapijavautilStackhtml

Java documentation of interfaces

Commentez vos programmes avec JavaDoc (sous Eclipse)ou Doxygen (incluant des formules latex par exemple)httpwwwstacknl~dimitridoxygen

copy 2011 Frank Nielsen Lecture 1

II Computer Graphics Area Flood Filling

Basic coloring application

copy 2011 Frank Nielsen Lecture 1

Area Flood Filling

Tint filling

Tint fill+pattern fill

Gradient filling

copy 2011 Frank Nielsen Lecture 1

Application Vectorization of Cartoon Animation

rarr Rendering to multi-size displaysrarr Interaction with image semantic

Vectorizing Cartoon AnimationsJulyAugust 2009 (vol 15 no 4)pp 618-629

copy 2011 Frank Nielsen Lecture 1

Area Flood FillingImages as large graphs (million pixels)Image (pixel) connectivity 4- or 8-connectivity (but also hexagonal etc)

Example of flood filling (cartoon animation etc)

httpwww-graphicsstanfordedu~levoysands_awardhtml

copy 2011 Frank Nielsen Lecture 1

Area Flood Filling Recursive Algorithm

Use an abstract data-structure Stack

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a stackHandle recursion explicitly with the stack

Depth first order

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a queue

Properties of abstract queues

Breadth first order

copy 2011 Frank Nielsen Lecture 1

Stack(depth search)

Queue(breadth search)

copy 2011 Frank Nielsen Lecture 1

3 Abstract dictionariesStore items indexed by keysAxiomatic semantic

Unordered (collection) or ordered dictionaries (rarr augmented dictionaries)

copy 2011 Frank Nielsen Lecture 1

IV Dictionaries Detecting Any Segment Pair Intersection Naive quadratic time algorithm

copy 2011 Frank Nielsen Lecture 1

S2 intersects S4 At some position they become y-adjacent

Sweeping line combinatorial algorithm 2n extremities onlyrarr 2n events so swap from left to right(A preliminary computational geometric algorithm)

A structural propertyrarr Sweeping combinatorial events

copy 2011 Frank Nielsen Lecture 1

Ordered dictionary

For a given query (ey) report the line segment immediately above and below (ey)

Dynamic insertiondeletion of line segment extremities

Implementation using binary trees (red-black AVL etc)

copy 2011 Frank Nielsen Lecture 1

Shamos-Hoey intersection detection algorithmDoes a pair of segment intersect Yes or No

copy 2011 Frank Nielsen Lecture 1

Priority queues

(INF311 Implementation using implicit heaps stored in an array)

For the line sweep 3 kinds of events type 1 Begin extremity type 2 End extremity type 3 Intersection point

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm (extend Shamos-Hoey)Complexity O((n+I) log n)

Initialization

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm Handling events

Interesting caseSwap manually order at intersection points

copy 2011 Frank Nielsen Lecture 1

httpenwikipediaorgwikiBentleyE28093Ottmann_algorithm

Collision detection for 3D games

copy 2011 Frank Nielsen Lecture 1

IV Union-Find abstract data-structuresManage disjoint sets very efficiently under union

Example Image segmentation (let a robot see)

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

Each region is a setInitially each pixel defines a region

Merging regions=merging disjoint sets

For a given element find the set that contains it

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

copy 2011 Frank Nielsen Lecture 1

Path compressionAlmost linear-size data-structure(inverse of Ackermann function)

copy 2011 Frank Nielsen Lecture 1

Union find DS for labelling connected components

Much easier problem than segmentation

Disjoint set data-structure

copy 2011 Frank Nielsen Lecture 1

Segmentation clustering and tone mapping

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 8: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

Outline of Abstract DS

Abstract data-structures in Java

Area Flood filling (larr stacks and larr queues)

Any segment pair intersection (larr dictionary)

Image segmentation (larr union-find disjoint elements)

Object recognition (larr geometric hashing)

copy 2011 Frank Nielsen Lecture 1

I Abstract Data Structures Stack

Interface (method prototypes)isEmptypush(Element)pop (or pull)

For example two implementations Array Linked list

public static void main(String [] args)

Stack myStack=new Stack()int ifor(i=0ilt10i++)

myStackPush(i)

for(i=0ilt15i++)

Systemoutprintln(myStackPull())

copy 2011 Frank Nielsen Lecture 1

class StackArrayint nbmaxint indexint [ ] array

ConstructorsStackArray(int n)thisnbmax=narray=new int[nbmax] index=-1Systemoutprintln(Succesfully created a stack array object)

Methods INTERFACEvoid Push(int element)if (indexltnbmax-1)

array[++index]=element

int Pull()if (indexgt=0 ) return array[index--]else return -1

Stack (array)

copy 2011 Frank Nielsen Lecture 1

Stack (linked list)class StackList listStack()list=null

void Push(int el)if (list=null) list=listinsertHead(el)

else list=new

List(elnull)

int Pull()int valif (list=null)

val=listelement list=listnext else val=-1

return val

class Listint elementList next

ConstructorList(int el List tail)thiselement=elthisnext=tail

List insertHead(int el)return new List(elthis)

copy 2011 Frank Nielsen Lecture 1

httpjavasuncomj2se142docsapijavautilStackhtml

Java documentation of interfaces

Commentez vos programmes avec JavaDoc (sous Eclipse)ou Doxygen (incluant des formules latex par exemple)httpwwwstacknl~dimitridoxygen

copy 2011 Frank Nielsen Lecture 1

II Computer Graphics Area Flood Filling

Basic coloring application

copy 2011 Frank Nielsen Lecture 1

Area Flood Filling

Tint filling

Tint fill+pattern fill

Gradient filling

copy 2011 Frank Nielsen Lecture 1

Application Vectorization of Cartoon Animation

rarr Rendering to multi-size displaysrarr Interaction with image semantic

Vectorizing Cartoon AnimationsJulyAugust 2009 (vol 15 no 4)pp 618-629

copy 2011 Frank Nielsen Lecture 1

Area Flood FillingImages as large graphs (million pixels)Image (pixel) connectivity 4- or 8-connectivity (but also hexagonal etc)

Example of flood filling (cartoon animation etc)

httpwww-graphicsstanfordedu~levoysands_awardhtml

copy 2011 Frank Nielsen Lecture 1

Area Flood Filling Recursive Algorithm

Use an abstract data-structure Stack

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a stackHandle recursion explicitly with the stack

Depth first order

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a queue

Properties of abstract queues

Breadth first order

copy 2011 Frank Nielsen Lecture 1

Stack(depth search)

Queue(breadth search)

copy 2011 Frank Nielsen Lecture 1

3 Abstract dictionariesStore items indexed by keysAxiomatic semantic

Unordered (collection) or ordered dictionaries (rarr augmented dictionaries)

copy 2011 Frank Nielsen Lecture 1

IV Dictionaries Detecting Any Segment Pair Intersection Naive quadratic time algorithm

copy 2011 Frank Nielsen Lecture 1

S2 intersects S4 At some position they become y-adjacent

Sweeping line combinatorial algorithm 2n extremities onlyrarr 2n events so swap from left to right(A preliminary computational geometric algorithm)

A structural propertyrarr Sweeping combinatorial events

copy 2011 Frank Nielsen Lecture 1

Ordered dictionary

For a given query (ey) report the line segment immediately above and below (ey)

Dynamic insertiondeletion of line segment extremities

Implementation using binary trees (red-black AVL etc)

copy 2011 Frank Nielsen Lecture 1

Shamos-Hoey intersection detection algorithmDoes a pair of segment intersect Yes or No

copy 2011 Frank Nielsen Lecture 1

Priority queues

(INF311 Implementation using implicit heaps stored in an array)

For the line sweep 3 kinds of events type 1 Begin extremity type 2 End extremity type 3 Intersection point

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm (extend Shamos-Hoey)Complexity O((n+I) log n)

Initialization

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm Handling events

Interesting caseSwap manually order at intersection points

copy 2011 Frank Nielsen Lecture 1

httpenwikipediaorgwikiBentleyE28093Ottmann_algorithm

Collision detection for 3D games

copy 2011 Frank Nielsen Lecture 1

IV Union-Find abstract data-structuresManage disjoint sets very efficiently under union

Example Image segmentation (let a robot see)

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

Each region is a setInitially each pixel defines a region

Merging regions=merging disjoint sets

For a given element find the set that contains it

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

copy 2011 Frank Nielsen Lecture 1

Path compressionAlmost linear-size data-structure(inverse of Ackermann function)

copy 2011 Frank Nielsen Lecture 1

Union find DS for labelling connected components

Much easier problem than segmentation

Disjoint set data-structure

copy 2011 Frank Nielsen Lecture 1

Segmentation clustering and tone mapping

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 9: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

I Abstract Data Structures Stack

Interface (method prototypes)isEmptypush(Element)pop (or pull)

For example two implementations Array Linked list

public static void main(String [] args)

Stack myStack=new Stack()int ifor(i=0ilt10i++)

myStackPush(i)

for(i=0ilt15i++)

Systemoutprintln(myStackPull())

copy 2011 Frank Nielsen Lecture 1

class StackArrayint nbmaxint indexint [ ] array

ConstructorsStackArray(int n)thisnbmax=narray=new int[nbmax] index=-1Systemoutprintln(Succesfully created a stack array object)

Methods INTERFACEvoid Push(int element)if (indexltnbmax-1)

array[++index]=element

int Pull()if (indexgt=0 ) return array[index--]else return -1

Stack (array)

copy 2011 Frank Nielsen Lecture 1

Stack (linked list)class StackList listStack()list=null

void Push(int el)if (list=null) list=listinsertHead(el)

else list=new

List(elnull)

int Pull()int valif (list=null)

val=listelement list=listnext else val=-1

return val

class Listint elementList next

ConstructorList(int el List tail)thiselement=elthisnext=tail

List insertHead(int el)return new List(elthis)

copy 2011 Frank Nielsen Lecture 1

httpjavasuncomj2se142docsapijavautilStackhtml

Java documentation of interfaces

Commentez vos programmes avec JavaDoc (sous Eclipse)ou Doxygen (incluant des formules latex par exemple)httpwwwstacknl~dimitridoxygen

copy 2011 Frank Nielsen Lecture 1

II Computer Graphics Area Flood Filling

Basic coloring application

copy 2011 Frank Nielsen Lecture 1

Area Flood Filling

Tint filling

Tint fill+pattern fill

Gradient filling

copy 2011 Frank Nielsen Lecture 1

Application Vectorization of Cartoon Animation

rarr Rendering to multi-size displaysrarr Interaction with image semantic

Vectorizing Cartoon AnimationsJulyAugust 2009 (vol 15 no 4)pp 618-629

copy 2011 Frank Nielsen Lecture 1

Area Flood FillingImages as large graphs (million pixels)Image (pixel) connectivity 4- or 8-connectivity (but also hexagonal etc)

Example of flood filling (cartoon animation etc)

httpwww-graphicsstanfordedu~levoysands_awardhtml

copy 2011 Frank Nielsen Lecture 1

Area Flood Filling Recursive Algorithm

Use an abstract data-structure Stack

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a stackHandle recursion explicitly with the stack

Depth first order

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a queue

Properties of abstract queues

Breadth first order

copy 2011 Frank Nielsen Lecture 1

Stack(depth search)

Queue(breadth search)

copy 2011 Frank Nielsen Lecture 1

3 Abstract dictionariesStore items indexed by keysAxiomatic semantic

Unordered (collection) or ordered dictionaries (rarr augmented dictionaries)

copy 2011 Frank Nielsen Lecture 1

IV Dictionaries Detecting Any Segment Pair Intersection Naive quadratic time algorithm

copy 2011 Frank Nielsen Lecture 1

S2 intersects S4 At some position they become y-adjacent

Sweeping line combinatorial algorithm 2n extremities onlyrarr 2n events so swap from left to right(A preliminary computational geometric algorithm)

A structural propertyrarr Sweeping combinatorial events

copy 2011 Frank Nielsen Lecture 1

Ordered dictionary

For a given query (ey) report the line segment immediately above and below (ey)

Dynamic insertiondeletion of line segment extremities

Implementation using binary trees (red-black AVL etc)

copy 2011 Frank Nielsen Lecture 1

Shamos-Hoey intersection detection algorithmDoes a pair of segment intersect Yes or No

copy 2011 Frank Nielsen Lecture 1

Priority queues

(INF311 Implementation using implicit heaps stored in an array)

For the line sweep 3 kinds of events type 1 Begin extremity type 2 End extremity type 3 Intersection point

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm (extend Shamos-Hoey)Complexity O((n+I) log n)

Initialization

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm Handling events

Interesting caseSwap manually order at intersection points

copy 2011 Frank Nielsen Lecture 1

httpenwikipediaorgwikiBentleyE28093Ottmann_algorithm

Collision detection for 3D games

copy 2011 Frank Nielsen Lecture 1

IV Union-Find abstract data-structuresManage disjoint sets very efficiently under union

Example Image segmentation (let a robot see)

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

Each region is a setInitially each pixel defines a region

Merging regions=merging disjoint sets

For a given element find the set that contains it

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

copy 2011 Frank Nielsen Lecture 1

Path compressionAlmost linear-size data-structure(inverse of Ackermann function)

copy 2011 Frank Nielsen Lecture 1

Union find DS for labelling connected components

Much easier problem than segmentation

Disjoint set data-structure

copy 2011 Frank Nielsen Lecture 1

Segmentation clustering and tone mapping

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 10: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

class StackArrayint nbmaxint indexint [ ] array

ConstructorsStackArray(int n)thisnbmax=narray=new int[nbmax] index=-1Systemoutprintln(Succesfully created a stack array object)

Methods INTERFACEvoid Push(int element)if (indexltnbmax-1)

array[++index]=element

int Pull()if (indexgt=0 ) return array[index--]else return -1

Stack (array)

copy 2011 Frank Nielsen Lecture 1

Stack (linked list)class StackList listStack()list=null

void Push(int el)if (list=null) list=listinsertHead(el)

else list=new

List(elnull)

int Pull()int valif (list=null)

val=listelement list=listnext else val=-1

return val

class Listint elementList next

ConstructorList(int el List tail)thiselement=elthisnext=tail

List insertHead(int el)return new List(elthis)

copy 2011 Frank Nielsen Lecture 1

httpjavasuncomj2se142docsapijavautilStackhtml

Java documentation of interfaces

Commentez vos programmes avec JavaDoc (sous Eclipse)ou Doxygen (incluant des formules latex par exemple)httpwwwstacknl~dimitridoxygen

copy 2011 Frank Nielsen Lecture 1

II Computer Graphics Area Flood Filling

Basic coloring application

copy 2011 Frank Nielsen Lecture 1

Area Flood Filling

Tint filling

Tint fill+pattern fill

Gradient filling

copy 2011 Frank Nielsen Lecture 1

Application Vectorization of Cartoon Animation

rarr Rendering to multi-size displaysrarr Interaction with image semantic

Vectorizing Cartoon AnimationsJulyAugust 2009 (vol 15 no 4)pp 618-629

copy 2011 Frank Nielsen Lecture 1

Area Flood FillingImages as large graphs (million pixels)Image (pixel) connectivity 4- or 8-connectivity (but also hexagonal etc)

Example of flood filling (cartoon animation etc)

httpwww-graphicsstanfordedu~levoysands_awardhtml

copy 2011 Frank Nielsen Lecture 1

Area Flood Filling Recursive Algorithm

Use an abstract data-structure Stack

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a stackHandle recursion explicitly with the stack

Depth first order

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a queue

Properties of abstract queues

Breadth first order

copy 2011 Frank Nielsen Lecture 1

Stack(depth search)

Queue(breadth search)

copy 2011 Frank Nielsen Lecture 1

3 Abstract dictionariesStore items indexed by keysAxiomatic semantic

Unordered (collection) or ordered dictionaries (rarr augmented dictionaries)

copy 2011 Frank Nielsen Lecture 1

IV Dictionaries Detecting Any Segment Pair Intersection Naive quadratic time algorithm

copy 2011 Frank Nielsen Lecture 1

S2 intersects S4 At some position they become y-adjacent

Sweeping line combinatorial algorithm 2n extremities onlyrarr 2n events so swap from left to right(A preliminary computational geometric algorithm)

A structural propertyrarr Sweeping combinatorial events

copy 2011 Frank Nielsen Lecture 1

Ordered dictionary

For a given query (ey) report the line segment immediately above and below (ey)

Dynamic insertiondeletion of line segment extremities

Implementation using binary trees (red-black AVL etc)

copy 2011 Frank Nielsen Lecture 1

Shamos-Hoey intersection detection algorithmDoes a pair of segment intersect Yes or No

copy 2011 Frank Nielsen Lecture 1

Priority queues

(INF311 Implementation using implicit heaps stored in an array)

For the line sweep 3 kinds of events type 1 Begin extremity type 2 End extremity type 3 Intersection point

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm (extend Shamos-Hoey)Complexity O((n+I) log n)

Initialization

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm Handling events

Interesting caseSwap manually order at intersection points

copy 2011 Frank Nielsen Lecture 1

httpenwikipediaorgwikiBentleyE28093Ottmann_algorithm

Collision detection for 3D games

copy 2011 Frank Nielsen Lecture 1

IV Union-Find abstract data-structuresManage disjoint sets very efficiently under union

Example Image segmentation (let a robot see)

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

Each region is a setInitially each pixel defines a region

Merging regions=merging disjoint sets

For a given element find the set that contains it

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

copy 2011 Frank Nielsen Lecture 1

Path compressionAlmost linear-size data-structure(inverse of Ackermann function)

copy 2011 Frank Nielsen Lecture 1

Union find DS for labelling connected components

Much easier problem than segmentation

Disjoint set data-structure

copy 2011 Frank Nielsen Lecture 1

Segmentation clustering and tone mapping

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 11: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

Stack (linked list)class StackList listStack()list=null

void Push(int el)if (list=null) list=listinsertHead(el)

else list=new

List(elnull)

int Pull()int valif (list=null)

val=listelement list=listnext else val=-1

return val

class Listint elementList next

ConstructorList(int el List tail)thiselement=elthisnext=tail

List insertHead(int el)return new List(elthis)

copy 2011 Frank Nielsen Lecture 1

httpjavasuncomj2se142docsapijavautilStackhtml

Java documentation of interfaces

Commentez vos programmes avec JavaDoc (sous Eclipse)ou Doxygen (incluant des formules latex par exemple)httpwwwstacknl~dimitridoxygen

copy 2011 Frank Nielsen Lecture 1

II Computer Graphics Area Flood Filling

Basic coloring application

copy 2011 Frank Nielsen Lecture 1

Area Flood Filling

Tint filling

Tint fill+pattern fill

Gradient filling

copy 2011 Frank Nielsen Lecture 1

Application Vectorization of Cartoon Animation

rarr Rendering to multi-size displaysrarr Interaction with image semantic

Vectorizing Cartoon AnimationsJulyAugust 2009 (vol 15 no 4)pp 618-629

copy 2011 Frank Nielsen Lecture 1

Area Flood FillingImages as large graphs (million pixels)Image (pixel) connectivity 4- or 8-connectivity (but also hexagonal etc)

Example of flood filling (cartoon animation etc)

httpwww-graphicsstanfordedu~levoysands_awardhtml

copy 2011 Frank Nielsen Lecture 1

Area Flood Filling Recursive Algorithm

Use an abstract data-structure Stack

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a stackHandle recursion explicitly with the stack

Depth first order

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a queue

Properties of abstract queues

Breadth first order

copy 2011 Frank Nielsen Lecture 1

Stack(depth search)

Queue(breadth search)

copy 2011 Frank Nielsen Lecture 1

3 Abstract dictionariesStore items indexed by keysAxiomatic semantic

Unordered (collection) or ordered dictionaries (rarr augmented dictionaries)

copy 2011 Frank Nielsen Lecture 1

IV Dictionaries Detecting Any Segment Pair Intersection Naive quadratic time algorithm

copy 2011 Frank Nielsen Lecture 1

S2 intersects S4 At some position they become y-adjacent

Sweeping line combinatorial algorithm 2n extremities onlyrarr 2n events so swap from left to right(A preliminary computational geometric algorithm)

A structural propertyrarr Sweeping combinatorial events

copy 2011 Frank Nielsen Lecture 1

Ordered dictionary

For a given query (ey) report the line segment immediately above and below (ey)

Dynamic insertiondeletion of line segment extremities

Implementation using binary trees (red-black AVL etc)

copy 2011 Frank Nielsen Lecture 1

Shamos-Hoey intersection detection algorithmDoes a pair of segment intersect Yes or No

copy 2011 Frank Nielsen Lecture 1

Priority queues

(INF311 Implementation using implicit heaps stored in an array)

For the line sweep 3 kinds of events type 1 Begin extremity type 2 End extremity type 3 Intersection point

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm (extend Shamos-Hoey)Complexity O((n+I) log n)

Initialization

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm Handling events

Interesting caseSwap manually order at intersection points

copy 2011 Frank Nielsen Lecture 1

httpenwikipediaorgwikiBentleyE28093Ottmann_algorithm

Collision detection for 3D games

copy 2011 Frank Nielsen Lecture 1

IV Union-Find abstract data-structuresManage disjoint sets very efficiently under union

Example Image segmentation (let a robot see)

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

Each region is a setInitially each pixel defines a region

Merging regions=merging disjoint sets

For a given element find the set that contains it

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

copy 2011 Frank Nielsen Lecture 1

Path compressionAlmost linear-size data-structure(inverse of Ackermann function)

copy 2011 Frank Nielsen Lecture 1

Union find DS for labelling connected components

Much easier problem than segmentation

Disjoint set data-structure

copy 2011 Frank Nielsen Lecture 1

Segmentation clustering and tone mapping

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 12: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

httpjavasuncomj2se142docsapijavautilStackhtml

Java documentation of interfaces

Commentez vos programmes avec JavaDoc (sous Eclipse)ou Doxygen (incluant des formules latex par exemple)httpwwwstacknl~dimitridoxygen

copy 2011 Frank Nielsen Lecture 1

II Computer Graphics Area Flood Filling

Basic coloring application

copy 2011 Frank Nielsen Lecture 1

Area Flood Filling

Tint filling

Tint fill+pattern fill

Gradient filling

copy 2011 Frank Nielsen Lecture 1

Application Vectorization of Cartoon Animation

rarr Rendering to multi-size displaysrarr Interaction with image semantic

Vectorizing Cartoon AnimationsJulyAugust 2009 (vol 15 no 4)pp 618-629

copy 2011 Frank Nielsen Lecture 1

Area Flood FillingImages as large graphs (million pixels)Image (pixel) connectivity 4- or 8-connectivity (but also hexagonal etc)

Example of flood filling (cartoon animation etc)

httpwww-graphicsstanfordedu~levoysands_awardhtml

copy 2011 Frank Nielsen Lecture 1

Area Flood Filling Recursive Algorithm

Use an abstract data-structure Stack

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a stackHandle recursion explicitly with the stack

Depth first order

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a queue

Properties of abstract queues

Breadth first order

copy 2011 Frank Nielsen Lecture 1

Stack(depth search)

Queue(breadth search)

copy 2011 Frank Nielsen Lecture 1

3 Abstract dictionariesStore items indexed by keysAxiomatic semantic

Unordered (collection) or ordered dictionaries (rarr augmented dictionaries)

copy 2011 Frank Nielsen Lecture 1

IV Dictionaries Detecting Any Segment Pair Intersection Naive quadratic time algorithm

copy 2011 Frank Nielsen Lecture 1

S2 intersects S4 At some position they become y-adjacent

Sweeping line combinatorial algorithm 2n extremities onlyrarr 2n events so swap from left to right(A preliminary computational geometric algorithm)

A structural propertyrarr Sweeping combinatorial events

copy 2011 Frank Nielsen Lecture 1

Ordered dictionary

For a given query (ey) report the line segment immediately above and below (ey)

Dynamic insertiondeletion of line segment extremities

Implementation using binary trees (red-black AVL etc)

copy 2011 Frank Nielsen Lecture 1

Shamos-Hoey intersection detection algorithmDoes a pair of segment intersect Yes or No

copy 2011 Frank Nielsen Lecture 1

Priority queues

(INF311 Implementation using implicit heaps stored in an array)

For the line sweep 3 kinds of events type 1 Begin extremity type 2 End extremity type 3 Intersection point

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm (extend Shamos-Hoey)Complexity O((n+I) log n)

Initialization

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm Handling events

Interesting caseSwap manually order at intersection points

copy 2011 Frank Nielsen Lecture 1

httpenwikipediaorgwikiBentleyE28093Ottmann_algorithm

Collision detection for 3D games

copy 2011 Frank Nielsen Lecture 1

IV Union-Find abstract data-structuresManage disjoint sets very efficiently under union

Example Image segmentation (let a robot see)

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

Each region is a setInitially each pixel defines a region

Merging regions=merging disjoint sets

For a given element find the set that contains it

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

copy 2011 Frank Nielsen Lecture 1

Path compressionAlmost linear-size data-structure(inverse of Ackermann function)

copy 2011 Frank Nielsen Lecture 1

Union find DS for labelling connected components

Much easier problem than segmentation

Disjoint set data-structure

copy 2011 Frank Nielsen Lecture 1

Segmentation clustering and tone mapping

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 13: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

II Computer Graphics Area Flood Filling

Basic coloring application

copy 2011 Frank Nielsen Lecture 1

Area Flood Filling

Tint filling

Tint fill+pattern fill

Gradient filling

copy 2011 Frank Nielsen Lecture 1

Application Vectorization of Cartoon Animation

rarr Rendering to multi-size displaysrarr Interaction with image semantic

Vectorizing Cartoon AnimationsJulyAugust 2009 (vol 15 no 4)pp 618-629

copy 2011 Frank Nielsen Lecture 1

Area Flood FillingImages as large graphs (million pixels)Image (pixel) connectivity 4- or 8-connectivity (but also hexagonal etc)

Example of flood filling (cartoon animation etc)

httpwww-graphicsstanfordedu~levoysands_awardhtml

copy 2011 Frank Nielsen Lecture 1

Area Flood Filling Recursive Algorithm

Use an abstract data-structure Stack

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a stackHandle recursion explicitly with the stack

Depth first order

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a queue

Properties of abstract queues

Breadth first order

copy 2011 Frank Nielsen Lecture 1

Stack(depth search)

Queue(breadth search)

copy 2011 Frank Nielsen Lecture 1

3 Abstract dictionariesStore items indexed by keysAxiomatic semantic

Unordered (collection) or ordered dictionaries (rarr augmented dictionaries)

copy 2011 Frank Nielsen Lecture 1

IV Dictionaries Detecting Any Segment Pair Intersection Naive quadratic time algorithm

copy 2011 Frank Nielsen Lecture 1

S2 intersects S4 At some position they become y-adjacent

Sweeping line combinatorial algorithm 2n extremities onlyrarr 2n events so swap from left to right(A preliminary computational geometric algorithm)

A structural propertyrarr Sweeping combinatorial events

copy 2011 Frank Nielsen Lecture 1

Ordered dictionary

For a given query (ey) report the line segment immediately above and below (ey)

Dynamic insertiondeletion of line segment extremities

Implementation using binary trees (red-black AVL etc)

copy 2011 Frank Nielsen Lecture 1

Shamos-Hoey intersection detection algorithmDoes a pair of segment intersect Yes or No

copy 2011 Frank Nielsen Lecture 1

Priority queues

(INF311 Implementation using implicit heaps stored in an array)

For the line sweep 3 kinds of events type 1 Begin extremity type 2 End extremity type 3 Intersection point

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm (extend Shamos-Hoey)Complexity O((n+I) log n)

Initialization

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm Handling events

Interesting caseSwap manually order at intersection points

copy 2011 Frank Nielsen Lecture 1

httpenwikipediaorgwikiBentleyE28093Ottmann_algorithm

Collision detection for 3D games

copy 2011 Frank Nielsen Lecture 1

IV Union-Find abstract data-structuresManage disjoint sets very efficiently under union

Example Image segmentation (let a robot see)

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

Each region is a setInitially each pixel defines a region

Merging regions=merging disjoint sets

For a given element find the set that contains it

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

copy 2011 Frank Nielsen Lecture 1

Path compressionAlmost linear-size data-structure(inverse of Ackermann function)

copy 2011 Frank Nielsen Lecture 1

Union find DS for labelling connected components

Much easier problem than segmentation

Disjoint set data-structure

copy 2011 Frank Nielsen Lecture 1

Segmentation clustering and tone mapping

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 14: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

Area Flood Filling

Tint filling

Tint fill+pattern fill

Gradient filling

copy 2011 Frank Nielsen Lecture 1

Application Vectorization of Cartoon Animation

rarr Rendering to multi-size displaysrarr Interaction with image semantic

Vectorizing Cartoon AnimationsJulyAugust 2009 (vol 15 no 4)pp 618-629

copy 2011 Frank Nielsen Lecture 1

Area Flood FillingImages as large graphs (million pixels)Image (pixel) connectivity 4- or 8-connectivity (but also hexagonal etc)

Example of flood filling (cartoon animation etc)

httpwww-graphicsstanfordedu~levoysands_awardhtml

copy 2011 Frank Nielsen Lecture 1

Area Flood Filling Recursive Algorithm

Use an abstract data-structure Stack

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a stackHandle recursion explicitly with the stack

Depth first order

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a queue

Properties of abstract queues

Breadth first order

copy 2011 Frank Nielsen Lecture 1

Stack(depth search)

Queue(breadth search)

copy 2011 Frank Nielsen Lecture 1

3 Abstract dictionariesStore items indexed by keysAxiomatic semantic

Unordered (collection) or ordered dictionaries (rarr augmented dictionaries)

copy 2011 Frank Nielsen Lecture 1

IV Dictionaries Detecting Any Segment Pair Intersection Naive quadratic time algorithm

copy 2011 Frank Nielsen Lecture 1

S2 intersects S4 At some position they become y-adjacent

Sweeping line combinatorial algorithm 2n extremities onlyrarr 2n events so swap from left to right(A preliminary computational geometric algorithm)

A structural propertyrarr Sweeping combinatorial events

copy 2011 Frank Nielsen Lecture 1

Ordered dictionary

For a given query (ey) report the line segment immediately above and below (ey)

Dynamic insertiondeletion of line segment extremities

Implementation using binary trees (red-black AVL etc)

copy 2011 Frank Nielsen Lecture 1

Shamos-Hoey intersection detection algorithmDoes a pair of segment intersect Yes or No

copy 2011 Frank Nielsen Lecture 1

Priority queues

(INF311 Implementation using implicit heaps stored in an array)

For the line sweep 3 kinds of events type 1 Begin extremity type 2 End extremity type 3 Intersection point

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm (extend Shamos-Hoey)Complexity O((n+I) log n)

Initialization

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm Handling events

Interesting caseSwap manually order at intersection points

copy 2011 Frank Nielsen Lecture 1

httpenwikipediaorgwikiBentleyE28093Ottmann_algorithm

Collision detection for 3D games

copy 2011 Frank Nielsen Lecture 1

IV Union-Find abstract data-structuresManage disjoint sets very efficiently under union

Example Image segmentation (let a robot see)

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

Each region is a setInitially each pixel defines a region

Merging regions=merging disjoint sets

For a given element find the set that contains it

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

copy 2011 Frank Nielsen Lecture 1

Path compressionAlmost linear-size data-structure(inverse of Ackermann function)

copy 2011 Frank Nielsen Lecture 1

Union find DS for labelling connected components

Much easier problem than segmentation

Disjoint set data-structure

copy 2011 Frank Nielsen Lecture 1

Segmentation clustering and tone mapping

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 15: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

Application Vectorization of Cartoon Animation

rarr Rendering to multi-size displaysrarr Interaction with image semantic

Vectorizing Cartoon AnimationsJulyAugust 2009 (vol 15 no 4)pp 618-629

copy 2011 Frank Nielsen Lecture 1

Area Flood FillingImages as large graphs (million pixels)Image (pixel) connectivity 4- or 8-connectivity (but also hexagonal etc)

Example of flood filling (cartoon animation etc)

httpwww-graphicsstanfordedu~levoysands_awardhtml

copy 2011 Frank Nielsen Lecture 1

Area Flood Filling Recursive Algorithm

Use an abstract data-structure Stack

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a stackHandle recursion explicitly with the stack

Depth first order

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a queue

Properties of abstract queues

Breadth first order

copy 2011 Frank Nielsen Lecture 1

Stack(depth search)

Queue(breadth search)

copy 2011 Frank Nielsen Lecture 1

3 Abstract dictionariesStore items indexed by keysAxiomatic semantic

Unordered (collection) or ordered dictionaries (rarr augmented dictionaries)

copy 2011 Frank Nielsen Lecture 1

IV Dictionaries Detecting Any Segment Pair Intersection Naive quadratic time algorithm

copy 2011 Frank Nielsen Lecture 1

S2 intersects S4 At some position they become y-adjacent

Sweeping line combinatorial algorithm 2n extremities onlyrarr 2n events so swap from left to right(A preliminary computational geometric algorithm)

A structural propertyrarr Sweeping combinatorial events

copy 2011 Frank Nielsen Lecture 1

Ordered dictionary

For a given query (ey) report the line segment immediately above and below (ey)

Dynamic insertiondeletion of line segment extremities

Implementation using binary trees (red-black AVL etc)

copy 2011 Frank Nielsen Lecture 1

Shamos-Hoey intersection detection algorithmDoes a pair of segment intersect Yes or No

copy 2011 Frank Nielsen Lecture 1

Priority queues

(INF311 Implementation using implicit heaps stored in an array)

For the line sweep 3 kinds of events type 1 Begin extremity type 2 End extremity type 3 Intersection point

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm (extend Shamos-Hoey)Complexity O((n+I) log n)

Initialization

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm Handling events

Interesting caseSwap manually order at intersection points

copy 2011 Frank Nielsen Lecture 1

httpenwikipediaorgwikiBentleyE28093Ottmann_algorithm

Collision detection for 3D games

copy 2011 Frank Nielsen Lecture 1

IV Union-Find abstract data-structuresManage disjoint sets very efficiently under union

Example Image segmentation (let a robot see)

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

Each region is a setInitially each pixel defines a region

Merging regions=merging disjoint sets

For a given element find the set that contains it

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

copy 2011 Frank Nielsen Lecture 1

Path compressionAlmost linear-size data-structure(inverse of Ackermann function)

copy 2011 Frank Nielsen Lecture 1

Union find DS for labelling connected components

Much easier problem than segmentation

Disjoint set data-structure

copy 2011 Frank Nielsen Lecture 1

Segmentation clustering and tone mapping

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 16: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

Area Flood FillingImages as large graphs (million pixels)Image (pixel) connectivity 4- or 8-connectivity (but also hexagonal etc)

Example of flood filling (cartoon animation etc)

httpwww-graphicsstanfordedu~levoysands_awardhtml

copy 2011 Frank Nielsen Lecture 1

Area Flood Filling Recursive Algorithm

Use an abstract data-structure Stack

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a stackHandle recursion explicitly with the stack

Depth first order

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a queue

Properties of abstract queues

Breadth first order

copy 2011 Frank Nielsen Lecture 1

Stack(depth search)

Queue(breadth search)

copy 2011 Frank Nielsen Lecture 1

3 Abstract dictionariesStore items indexed by keysAxiomatic semantic

Unordered (collection) or ordered dictionaries (rarr augmented dictionaries)

copy 2011 Frank Nielsen Lecture 1

IV Dictionaries Detecting Any Segment Pair Intersection Naive quadratic time algorithm

copy 2011 Frank Nielsen Lecture 1

S2 intersects S4 At some position they become y-adjacent

Sweeping line combinatorial algorithm 2n extremities onlyrarr 2n events so swap from left to right(A preliminary computational geometric algorithm)

A structural propertyrarr Sweeping combinatorial events

copy 2011 Frank Nielsen Lecture 1

Ordered dictionary

For a given query (ey) report the line segment immediately above and below (ey)

Dynamic insertiondeletion of line segment extremities

Implementation using binary trees (red-black AVL etc)

copy 2011 Frank Nielsen Lecture 1

Shamos-Hoey intersection detection algorithmDoes a pair of segment intersect Yes or No

copy 2011 Frank Nielsen Lecture 1

Priority queues

(INF311 Implementation using implicit heaps stored in an array)

For the line sweep 3 kinds of events type 1 Begin extremity type 2 End extremity type 3 Intersection point

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm (extend Shamos-Hoey)Complexity O((n+I) log n)

Initialization

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm Handling events

Interesting caseSwap manually order at intersection points

copy 2011 Frank Nielsen Lecture 1

httpenwikipediaorgwikiBentleyE28093Ottmann_algorithm

Collision detection for 3D games

copy 2011 Frank Nielsen Lecture 1

IV Union-Find abstract data-structuresManage disjoint sets very efficiently under union

Example Image segmentation (let a robot see)

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

Each region is a setInitially each pixel defines a region

Merging regions=merging disjoint sets

For a given element find the set that contains it

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

copy 2011 Frank Nielsen Lecture 1

Path compressionAlmost linear-size data-structure(inverse of Ackermann function)

copy 2011 Frank Nielsen Lecture 1

Union find DS for labelling connected components

Much easier problem than segmentation

Disjoint set data-structure

copy 2011 Frank Nielsen Lecture 1

Segmentation clustering and tone mapping

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 17: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

Area Flood Filling Recursive Algorithm

Use an abstract data-structure Stack

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a stackHandle recursion explicitly with the stack

Depth first order

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a queue

Properties of abstract queues

Breadth first order

copy 2011 Frank Nielsen Lecture 1

Stack(depth search)

Queue(breadth search)

copy 2011 Frank Nielsen Lecture 1

3 Abstract dictionariesStore items indexed by keysAxiomatic semantic

Unordered (collection) or ordered dictionaries (rarr augmented dictionaries)

copy 2011 Frank Nielsen Lecture 1

IV Dictionaries Detecting Any Segment Pair Intersection Naive quadratic time algorithm

copy 2011 Frank Nielsen Lecture 1

S2 intersects S4 At some position they become y-adjacent

Sweeping line combinatorial algorithm 2n extremities onlyrarr 2n events so swap from left to right(A preliminary computational geometric algorithm)

A structural propertyrarr Sweeping combinatorial events

copy 2011 Frank Nielsen Lecture 1

Ordered dictionary

For a given query (ey) report the line segment immediately above and below (ey)

Dynamic insertiondeletion of line segment extremities

Implementation using binary trees (red-black AVL etc)

copy 2011 Frank Nielsen Lecture 1

Shamos-Hoey intersection detection algorithmDoes a pair of segment intersect Yes or No

copy 2011 Frank Nielsen Lecture 1

Priority queues

(INF311 Implementation using implicit heaps stored in an array)

For the line sweep 3 kinds of events type 1 Begin extremity type 2 End extremity type 3 Intersection point

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm (extend Shamos-Hoey)Complexity O((n+I) log n)

Initialization

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm Handling events

Interesting caseSwap manually order at intersection points

copy 2011 Frank Nielsen Lecture 1

httpenwikipediaorgwikiBentleyE28093Ottmann_algorithm

Collision detection for 3D games

copy 2011 Frank Nielsen Lecture 1

IV Union-Find abstract data-structuresManage disjoint sets very efficiently under union

Example Image segmentation (let a robot see)

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

Each region is a setInitially each pixel defines a region

Merging regions=merging disjoint sets

For a given element find the set that contains it

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

copy 2011 Frank Nielsen Lecture 1

Path compressionAlmost linear-size data-structure(inverse of Ackermann function)

copy 2011 Frank Nielsen Lecture 1

Union find DS for labelling connected components

Much easier problem than segmentation

Disjoint set data-structure

copy 2011 Frank Nielsen Lecture 1

Segmentation clustering and tone mapping

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 18: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a stackHandle recursion explicitly with the stack

Depth first order

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a queue

Properties of abstract queues

Breadth first order

copy 2011 Frank Nielsen Lecture 1

Stack(depth search)

Queue(breadth search)

copy 2011 Frank Nielsen Lecture 1

3 Abstract dictionariesStore items indexed by keysAxiomatic semantic

Unordered (collection) or ordered dictionaries (rarr augmented dictionaries)

copy 2011 Frank Nielsen Lecture 1

IV Dictionaries Detecting Any Segment Pair Intersection Naive quadratic time algorithm

copy 2011 Frank Nielsen Lecture 1

S2 intersects S4 At some position they become y-adjacent

Sweeping line combinatorial algorithm 2n extremities onlyrarr 2n events so swap from left to right(A preliminary computational geometric algorithm)

A structural propertyrarr Sweeping combinatorial events

copy 2011 Frank Nielsen Lecture 1

Ordered dictionary

For a given query (ey) report the line segment immediately above and below (ey)

Dynamic insertiondeletion of line segment extremities

Implementation using binary trees (red-black AVL etc)

copy 2011 Frank Nielsen Lecture 1

Shamos-Hoey intersection detection algorithmDoes a pair of segment intersect Yes or No

copy 2011 Frank Nielsen Lecture 1

Priority queues

(INF311 Implementation using implicit heaps stored in an array)

For the line sweep 3 kinds of events type 1 Begin extremity type 2 End extremity type 3 Intersection point

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm (extend Shamos-Hoey)Complexity O((n+I) log n)

Initialization

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm Handling events

Interesting caseSwap manually order at intersection points

copy 2011 Frank Nielsen Lecture 1

httpenwikipediaorgwikiBentleyE28093Ottmann_algorithm

Collision detection for 3D games

copy 2011 Frank Nielsen Lecture 1

IV Union-Find abstract data-structuresManage disjoint sets very efficiently under union

Example Image segmentation (let a robot see)

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

Each region is a setInitially each pixel defines a region

Merging regions=merging disjoint sets

For a given element find the set that contains it

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

copy 2011 Frank Nielsen Lecture 1

Path compressionAlmost linear-size data-structure(inverse of Ackermann function)

copy 2011 Frank Nielsen Lecture 1

Union find DS for labelling connected components

Much easier problem than segmentation

Disjoint set data-structure

copy 2011 Frank Nielsen Lecture 1

Segmentation clustering and tone mapping

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 19: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

Area flood filling using a queue

Properties of abstract queues

Breadth first order

copy 2011 Frank Nielsen Lecture 1

Stack(depth search)

Queue(breadth search)

copy 2011 Frank Nielsen Lecture 1

3 Abstract dictionariesStore items indexed by keysAxiomatic semantic

Unordered (collection) or ordered dictionaries (rarr augmented dictionaries)

copy 2011 Frank Nielsen Lecture 1

IV Dictionaries Detecting Any Segment Pair Intersection Naive quadratic time algorithm

copy 2011 Frank Nielsen Lecture 1

S2 intersects S4 At some position they become y-adjacent

Sweeping line combinatorial algorithm 2n extremities onlyrarr 2n events so swap from left to right(A preliminary computational geometric algorithm)

A structural propertyrarr Sweeping combinatorial events

copy 2011 Frank Nielsen Lecture 1

Ordered dictionary

For a given query (ey) report the line segment immediately above and below (ey)

Dynamic insertiondeletion of line segment extremities

Implementation using binary trees (red-black AVL etc)

copy 2011 Frank Nielsen Lecture 1

Shamos-Hoey intersection detection algorithmDoes a pair of segment intersect Yes or No

copy 2011 Frank Nielsen Lecture 1

Priority queues

(INF311 Implementation using implicit heaps stored in an array)

For the line sweep 3 kinds of events type 1 Begin extremity type 2 End extremity type 3 Intersection point

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm (extend Shamos-Hoey)Complexity O((n+I) log n)

Initialization

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm Handling events

Interesting caseSwap manually order at intersection points

copy 2011 Frank Nielsen Lecture 1

httpenwikipediaorgwikiBentleyE28093Ottmann_algorithm

Collision detection for 3D games

copy 2011 Frank Nielsen Lecture 1

IV Union-Find abstract data-structuresManage disjoint sets very efficiently under union

Example Image segmentation (let a robot see)

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

Each region is a setInitially each pixel defines a region

Merging regions=merging disjoint sets

For a given element find the set that contains it

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

copy 2011 Frank Nielsen Lecture 1

Path compressionAlmost linear-size data-structure(inverse of Ackermann function)

copy 2011 Frank Nielsen Lecture 1

Union find DS for labelling connected components

Much easier problem than segmentation

Disjoint set data-structure

copy 2011 Frank Nielsen Lecture 1

Segmentation clustering and tone mapping

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 20: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

Stack(depth search)

Queue(breadth search)

copy 2011 Frank Nielsen Lecture 1

3 Abstract dictionariesStore items indexed by keysAxiomatic semantic

Unordered (collection) or ordered dictionaries (rarr augmented dictionaries)

copy 2011 Frank Nielsen Lecture 1

IV Dictionaries Detecting Any Segment Pair Intersection Naive quadratic time algorithm

copy 2011 Frank Nielsen Lecture 1

S2 intersects S4 At some position they become y-adjacent

Sweeping line combinatorial algorithm 2n extremities onlyrarr 2n events so swap from left to right(A preliminary computational geometric algorithm)

A structural propertyrarr Sweeping combinatorial events

copy 2011 Frank Nielsen Lecture 1

Ordered dictionary

For a given query (ey) report the line segment immediately above and below (ey)

Dynamic insertiondeletion of line segment extremities

Implementation using binary trees (red-black AVL etc)

copy 2011 Frank Nielsen Lecture 1

Shamos-Hoey intersection detection algorithmDoes a pair of segment intersect Yes or No

copy 2011 Frank Nielsen Lecture 1

Priority queues

(INF311 Implementation using implicit heaps stored in an array)

For the line sweep 3 kinds of events type 1 Begin extremity type 2 End extremity type 3 Intersection point

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm (extend Shamos-Hoey)Complexity O((n+I) log n)

Initialization

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm Handling events

Interesting caseSwap manually order at intersection points

copy 2011 Frank Nielsen Lecture 1

httpenwikipediaorgwikiBentleyE28093Ottmann_algorithm

Collision detection for 3D games

copy 2011 Frank Nielsen Lecture 1

IV Union-Find abstract data-structuresManage disjoint sets very efficiently under union

Example Image segmentation (let a robot see)

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

Each region is a setInitially each pixel defines a region

Merging regions=merging disjoint sets

For a given element find the set that contains it

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

copy 2011 Frank Nielsen Lecture 1

Path compressionAlmost linear-size data-structure(inverse of Ackermann function)

copy 2011 Frank Nielsen Lecture 1

Union find DS for labelling connected components

Much easier problem than segmentation

Disjoint set data-structure

copy 2011 Frank Nielsen Lecture 1

Segmentation clustering and tone mapping

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 21: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

3 Abstract dictionariesStore items indexed by keysAxiomatic semantic

Unordered (collection) or ordered dictionaries (rarr augmented dictionaries)

copy 2011 Frank Nielsen Lecture 1

IV Dictionaries Detecting Any Segment Pair Intersection Naive quadratic time algorithm

copy 2011 Frank Nielsen Lecture 1

S2 intersects S4 At some position they become y-adjacent

Sweeping line combinatorial algorithm 2n extremities onlyrarr 2n events so swap from left to right(A preliminary computational geometric algorithm)

A structural propertyrarr Sweeping combinatorial events

copy 2011 Frank Nielsen Lecture 1

Ordered dictionary

For a given query (ey) report the line segment immediately above and below (ey)

Dynamic insertiondeletion of line segment extremities

Implementation using binary trees (red-black AVL etc)

copy 2011 Frank Nielsen Lecture 1

Shamos-Hoey intersection detection algorithmDoes a pair of segment intersect Yes or No

copy 2011 Frank Nielsen Lecture 1

Priority queues

(INF311 Implementation using implicit heaps stored in an array)

For the line sweep 3 kinds of events type 1 Begin extremity type 2 End extremity type 3 Intersection point

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm (extend Shamos-Hoey)Complexity O((n+I) log n)

Initialization

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm Handling events

Interesting caseSwap manually order at intersection points

copy 2011 Frank Nielsen Lecture 1

httpenwikipediaorgwikiBentleyE28093Ottmann_algorithm

Collision detection for 3D games

copy 2011 Frank Nielsen Lecture 1

IV Union-Find abstract data-structuresManage disjoint sets very efficiently under union

Example Image segmentation (let a robot see)

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

Each region is a setInitially each pixel defines a region

Merging regions=merging disjoint sets

For a given element find the set that contains it

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

copy 2011 Frank Nielsen Lecture 1

Path compressionAlmost linear-size data-structure(inverse of Ackermann function)

copy 2011 Frank Nielsen Lecture 1

Union find DS for labelling connected components

Much easier problem than segmentation

Disjoint set data-structure

copy 2011 Frank Nielsen Lecture 1

Segmentation clustering and tone mapping

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 22: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

IV Dictionaries Detecting Any Segment Pair Intersection Naive quadratic time algorithm

copy 2011 Frank Nielsen Lecture 1

S2 intersects S4 At some position they become y-adjacent

Sweeping line combinatorial algorithm 2n extremities onlyrarr 2n events so swap from left to right(A preliminary computational geometric algorithm)

A structural propertyrarr Sweeping combinatorial events

copy 2011 Frank Nielsen Lecture 1

Ordered dictionary

For a given query (ey) report the line segment immediately above and below (ey)

Dynamic insertiondeletion of line segment extremities

Implementation using binary trees (red-black AVL etc)

copy 2011 Frank Nielsen Lecture 1

Shamos-Hoey intersection detection algorithmDoes a pair of segment intersect Yes or No

copy 2011 Frank Nielsen Lecture 1

Priority queues

(INF311 Implementation using implicit heaps stored in an array)

For the line sweep 3 kinds of events type 1 Begin extremity type 2 End extremity type 3 Intersection point

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm (extend Shamos-Hoey)Complexity O((n+I) log n)

Initialization

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm Handling events

Interesting caseSwap manually order at intersection points

copy 2011 Frank Nielsen Lecture 1

httpenwikipediaorgwikiBentleyE28093Ottmann_algorithm

Collision detection for 3D games

copy 2011 Frank Nielsen Lecture 1

IV Union-Find abstract data-structuresManage disjoint sets very efficiently under union

Example Image segmentation (let a robot see)

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

Each region is a setInitially each pixel defines a region

Merging regions=merging disjoint sets

For a given element find the set that contains it

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

copy 2011 Frank Nielsen Lecture 1

Path compressionAlmost linear-size data-structure(inverse of Ackermann function)

copy 2011 Frank Nielsen Lecture 1

Union find DS for labelling connected components

Much easier problem than segmentation

Disjoint set data-structure

copy 2011 Frank Nielsen Lecture 1

Segmentation clustering and tone mapping

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 23: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

S2 intersects S4 At some position they become y-adjacent

Sweeping line combinatorial algorithm 2n extremities onlyrarr 2n events so swap from left to right(A preliminary computational geometric algorithm)

A structural propertyrarr Sweeping combinatorial events

copy 2011 Frank Nielsen Lecture 1

Ordered dictionary

For a given query (ey) report the line segment immediately above and below (ey)

Dynamic insertiondeletion of line segment extremities

Implementation using binary trees (red-black AVL etc)

copy 2011 Frank Nielsen Lecture 1

Shamos-Hoey intersection detection algorithmDoes a pair of segment intersect Yes or No

copy 2011 Frank Nielsen Lecture 1

Priority queues

(INF311 Implementation using implicit heaps stored in an array)

For the line sweep 3 kinds of events type 1 Begin extremity type 2 End extremity type 3 Intersection point

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm (extend Shamos-Hoey)Complexity O((n+I) log n)

Initialization

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm Handling events

Interesting caseSwap manually order at intersection points

copy 2011 Frank Nielsen Lecture 1

httpenwikipediaorgwikiBentleyE28093Ottmann_algorithm

Collision detection for 3D games

copy 2011 Frank Nielsen Lecture 1

IV Union-Find abstract data-structuresManage disjoint sets very efficiently under union

Example Image segmentation (let a robot see)

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

Each region is a setInitially each pixel defines a region

Merging regions=merging disjoint sets

For a given element find the set that contains it

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

copy 2011 Frank Nielsen Lecture 1

Path compressionAlmost linear-size data-structure(inverse of Ackermann function)

copy 2011 Frank Nielsen Lecture 1

Union find DS for labelling connected components

Much easier problem than segmentation

Disjoint set data-structure

copy 2011 Frank Nielsen Lecture 1

Segmentation clustering and tone mapping

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 24: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

Ordered dictionary

For a given query (ey) report the line segment immediately above and below (ey)

Dynamic insertiondeletion of line segment extremities

Implementation using binary trees (red-black AVL etc)

copy 2011 Frank Nielsen Lecture 1

Shamos-Hoey intersection detection algorithmDoes a pair of segment intersect Yes or No

copy 2011 Frank Nielsen Lecture 1

Priority queues

(INF311 Implementation using implicit heaps stored in an array)

For the line sweep 3 kinds of events type 1 Begin extremity type 2 End extremity type 3 Intersection point

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm (extend Shamos-Hoey)Complexity O((n+I) log n)

Initialization

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm Handling events

Interesting caseSwap manually order at intersection points

copy 2011 Frank Nielsen Lecture 1

httpenwikipediaorgwikiBentleyE28093Ottmann_algorithm

Collision detection for 3D games

copy 2011 Frank Nielsen Lecture 1

IV Union-Find abstract data-structuresManage disjoint sets very efficiently under union

Example Image segmentation (let a robot see)

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

Each region is a setInitially each pixel defines a region

Merging regions=merging disjoint sets

For a given element find the set that contains it

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

copy 2011 Frank Nielsen Lecture 1

Path compressionAlmost linear-size data-structure(inverse of Ackermann function)

copy 2011 Frank Nielsen Lecture 1

Union find DS for labelling connected components

Much easier problem than segmentation

Disjoint set data-structure

copy 2011 Frank Nielsen Lecture 1

Segmentation clustering and tone mapping

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 25: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

Shamos-Hoey intersection detection algorithmDoes a pair of segment intersect Yes or No

copy 2011 Frank Nielsen Lecture 1

Priority queues

(INF311 Implementation using implicit heaps stored in an array)

For the line sweep 3 kinds of events type 1 Begin extremity type 2 End extremity type 3 Intersection point

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm (extend Shamos-Hoey)Complexity O((n+I) log n)

Initialization

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm Handling events

Interesting caseSwap manually order at intersection points

copy 2011 Frank Nielsen Lecture 1

httpenwikipediaorgwikiBentleyE28093Ottmann_algorithm

Collision detection for 3D games

copy 2011 Frank Nielsen Lecture 1

IV Union-Find abstract data-structuresManage disjoint sets very efficiently under union

Example Image segmentation (let a robot see)

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

Each region is a setInitially each pixel defines a region

Merging regions=merging disjoint sets

For a given element find the set that contains it

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

copy 2011 Frank Nielsen Lecture 1

Path compressionAlmost linear-size data-structure(inverse of Ackermann function)

copy 2011 Frank Nielsen Lecture 1

Union find DS for labelling connected components

Much easier problem than segmentation

Disjoint set data-structure

copy 2011 Frank Nielsen Lecture 1

Segmentation clustering and tone mapping

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 26: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

Priority queues

(INF311 Implementation using implicit heaps stored in an array)

For the line sweep 3 kinds of events type 1 Begin extremity type 2 End extremity type 3 Intersection point

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm (extend Shamos-Hoey)Complexity O((n+I) log n)

Initialization

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm Handling events

Interesting caseSwap manually order at intersection points

copy 2011 Frank Nielsen Lecture 1

httpenwikipediaorgwikiBentleyE28093Ottmann_algorithm

Collision detection for 3D games

copy 2011 Frank Nielsen Lecture 1

IV Union-Find abstract data-structuresManage disjoint sets very efficiently under union

Example Image segmentation (let a robot see)

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

Each region is a setInitially each pixel defines a region

Merging regions=merging disjoint sets

For a given element find the set that contains it

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

copy 2011 Frank Nielsen Lecture 1

Path compressionAlmost linear-size data-structure(inverse of Ackermann function)

copy 2011 Frank Nielsen Lecture 1

Union find DS for labelling connected components

Much easier problem than segmentation

Disjoint set data-structure

copy 2011 Frank Nielsen Lecture 1

Segmentation clustering and tone mapping

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 27: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm (extend Shamos-Hoey)Complexity O((n+I) log n)

Initialization

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm Handling events

Interesting caseSwap manually order at intersection points

copy 2011 Frank Nielsen Lecture 1

httpenwikipediaorgwikiBentleyE28093Ottmann_algorithm

Collision detection for 3D games

copy 2011 Frank Nielsen Lecture 1

IV Union-Find abstract data-structuresManage disjoint sets very efficiently under union

Example Image segmentation (let a robot see)

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

Each region is a setInitially each pixel defines a region

Merging regions=merging disjoint sets

For a given element find the set that contains it

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

copy 2011 Frank Nielsen Lecture 1

Path compressionAlmost linear-size data-structure(inverse of Ackermann function)

copy 2011 Frank Nielsen Lecture 1

Union find DS for labelling connected components

Much easier problem than segmentation

Disjoint set data-structure

copy 2011 Frank Nielsen Lecture 1

Segmentation clustering and tone mapping

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 28: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

Bentley-Ottman algorithm Handling events

Interesting caseSwap manually order at intersection points

copy 2011 Frank Nielsen Lecture 1

httpenwikipediaorgwikiBentleyE28093Ottmann_algorithm

Collision detection for 3D games

copy 2011 Frank Nielsen Lecture 1

IV Union-Find abstract data-structuresManage disjoint sets very efficiently under union

Example Image segmentation (let a robot see)

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

Each region is a setInitially each pixel defines a region

Merging regions=merging disjoint sets

For a given element find the set that contains it

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

copy 2011 Frank Nielsen Lecture 1

Path compressionAlmost linear-size data-structure(inverse of Ackermann function)

copy 2011 Frank Nielsen Lecture 1

Union find DS for labelling connected components

Much easier problem than segmentation

Disjoint set data-structure

copy 2011 Frank Nielsen Lecture 1

Segmentation clustering and tone mapping

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 29: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

httpenwikipediaorgwikiBentleyE28093Ottmann_algorithm

Collision detection for 3D games

copy 2011 Frank Nielsen Lecture 1

IV Union-Find abstract data-structuresManage disjoint sets very efficiently under union

Example Image segmentation (let a robot see)

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

Each region is a setInitially each pixel defines a region

Merging regions=merging disjoint sets

For a given element find the set that contains it

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

copy 2011 Frank Nielsen Lecture 1

Path compressionAlmost linear-size data-structure(inverse of Ackermann function)

copy 2011 Frank Nielsen Lecture 1

Union find DS for labelling connected components

Much easier problem than segmentation

Disjoint set data-structure

copy 2011 Frank Nielsen Lecture 1

Segmentation clustering and tone mapping

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 30: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

IV Union-Find abstract data-structuresManage disjoint sets very efficiently under union

Example Image segmentation (let a robot see)

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

Each region is a setInitially each pixel defines a region

Merging regions=merging disjoint sets

For a given element find the set that contains it

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

copy 2011 Frank Nielsen Lecture 1

Path compressionAlmost linear-size data-structure(inverse of Ackermann function)

copy 2011 Frank Nielsen Lecture 1

Union find DS for labelling connected components

Much easier problem than segmentation

Disjoint set data-structure

copy 2011 Frank Nielsen Lecture 1

Segmentation clustering and tone mapping

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 31: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

Each region is a setInitially each pixel defines a region

Merging regions=merging disjoint sets

For a given element find the set that contains it

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

copy 2011 Frank Nielsen Lecture 1

Path compressionAlmost linear-size data-structure(inverse of Ackermann function)

copy 2011 Frank Nielsen Lecture 1

Union find DS for labelling connected components

Much easier problem than segmentation

Disjoint set data-structure

copy 2011 Frank Nielsen Lecture 1

Segmentation clustering and tone mapping

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 32: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

Union-Find abstract data-structures

copy 2011 Frank Nielsen Lecture 1

Path compressionAlmost linear-size data-structure(inverse of Ackermann function)

copy 2011 Frank Nielsen Lecture 1

Union find DS for labelling connected components

Much easier problem than segmentation

Disjoint set data-structure

copy 2011 Frank Nielsen Lecture 1

Segmentation clustering and tone mapping

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 33: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

Path compressionAlmost linear-size data-structure(inverse of Ackermann function)

copy 2011 Frank Nielsen Lecture 1

Union find DS for labelling connected components

Much easier problem than segmentation

Disjoint set data-structure

copy 2011 Frank Nielsen Lecture 1

Segmentation clustering and tone mapping

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 34: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

Union find DS for labelling connected components

Much easier problem than segmentation

Disjoint set data-structure

copy 2011 Frank Nielsen Lecture 1

Segmentation clustering and tone mapping

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 35: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

Segmentation clustering and tone mapping

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 36: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

V Hashing

Hashing and collision (INF3x1 du Tronc Commun) Open address Linked chains

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 37: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

For each feature pair of pointsFor each feature pair of points

bullbull Define a local coordinate Define a local coordinate basisbasis on this pair on this pair

bullbull Compute and quantize all other feature points in this coordinate basisCompute and quantize all other feature points in this coordinate basis

bullbull Record (model basis) in a hash tableRecord (model basis) in a hash table

V Geometric hashing Preprocessing(for a point set)

httpenwikipediaorgwikiGeometric_hashinghttpwwwseasgwuedu~simhawebcs151lecturesmodule4module4html

larr Quadratic time preprocessing

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 38: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

1 Pick 1 Pick arbitraryarbitrary ordered pair of scene ordered pair of sceneCompute the other points using this pair as a frame Compute the other points using this pair as a frame basisbasis

2 For all the transformed points vote all records (model basis) appear 2 For all the transformed points vote all records (model basis) appear in the corresponding entry in the hash table and in the corresponding entry in the hash table and histogramhistogram them them

(= frequency histogram)(= frequency histogram)3 Matching candidates (model basis) pairs with 3 Matching candidates (model basis) pairs with large number of voteslarge number of votes

4 Recover the transformation that results in the best least-squares match 4 Recover the transformation that results in the best least-squares match between all corresponding feature pointsbetween all corresponding feature pointsTransform the features and verify against the input image features Transform the features and verify against the input image features (if fails repeat this procedure with another pair)(if fails repeat this procedure with another pair)

Geometric hashing Recognition

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 39: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

Geometric hashing (2D rigid motion)

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 40: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

Geometric hashing

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 41: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

Geometric hashing Object recognition

Object Recognition from Local Scale-Invariant Features (SIFT)

Scalable recognition

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 42: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

Further readingshttpwwwlixpolytechniquefr~nielsenINF555indexhtml

Wolfson HJ amp Rigoutsos I (1997) Geometric Hashing An Overview IEEE Computational Science and Engineering 4(4) 10-21

Andrew S Glassner Fill Er Up IEEE Computer Graphics and Applications 21(1) 78-85 (2001)

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 43: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

Java IO ImageSeveral APIs

public Image(String filename) javaawtImage img = ToolkitgetDefaultToolkit()getImage(filename) if (img = null) PixelGrabber pg = new PixelGrabber(img 0 0 -1 -1 true) try pggrabPixels() catch (InterruptedException e) raster = (int[]) pggetPixels() height = pggetHeight() width = pggetWidth() else throw new IllegalArgumentException(Error opening file

+ filename)

Can use alsoprocessingorg

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 44: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

Java IO Image public int getBlue(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return (raster[y width + x] amp 0xFF)

public int getGreen(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF00) gtgt 8)

public int getRed(int x int y) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() return ((raster[y width + x] amp 0xFF0000) gtgt 16)

Alpha Red Green Blue

Opacity is 255 (0xFF)

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 45: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

public void setGreen(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt8) public void setRed(int x int y int value) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | ((valueamp0xff)ltlt16) public void setBlue(int x int y int value ) if (x lt 0 || x gt= width || y lt 0 || y gt= height) throw new IllegalArgumentException() raster[y width + x] = raster[y width + x] | (valueamp0xff)

Java IO Image Alpha Red Green Blue

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46
Page 46: (slides 1) Visual Computing: Geometry, Graphics, and Vision

copy 2011 Frank Nielsen Lecture 1

public void writeBinaryPPM(String filename) String lineStringTokenizer st int i try DataOutputStream out =new DataOutputStream(

new BufferedOutputStream(new FileOutputStream(filename))) outwriteBytes(P6n) outwriteBytes( INF555 Ecole Polytechniquen) outwriteBytes(width+ +height+n255n)

for (int y = 0 y lt height y++) for (int x = 0 x lt width x++)

int rgbr=getRed(xy)g=getGreen(xy)b=getBlue(xy)

outwriteByte((byte)r)outwriteByte((byte)g)outwriteByte((byte)b)

outclose() catch(IOException e)

PPM Image

  • Diapo 1
  • Diapo 2
  • Diapo 3
  • Diapo 4
  • Diapo 5
  • Diapo 6
  • Diapo 7
  • Diapo 8
  • Diapo 9
  • Diapo 10
  • Diapo 11
  • Diapo 12
  • Diapo 13
  • Diapo 14
  • Diapo 15
  • Diapo 16
  • Diapo 17
  • Diapo 18
  • Diapo 19
  • Diapo 20
  • Diapo 21
  • Diapo 22
  • Diapo 23
  • Diapo 24
  • Diapo 25
  • Diapo 26
  • Diapo 27
  • Diapo 28
  • Diapo 29
  • Diapo 30
  • Diapo 31
  • Diapo 32
  • Diapo 33
  • Diapo 34
  • Diapo 35
  • Diapo 36
  • Diapo 37
  • Diapo 38
  • Diapo 39
  • Diapo 40
  • Diapo 41
  • Diapo 42
  • Diapo 43
  • Diapo 44
  • Diapo 45
  • Diapo 46