SlideShare una empresa de Scribd logo
1 de 33
Descargar para leer sin conexión
http://vision.eng.shu.ac.uk/jan/shrug7.pdf
                      Machine Vision made easy with Ruby




                         Machine Vision made easy with Ruby

                                       Jan Wedekind

                               Mon Jun 14 19:00:00 BST 2010
c 2010 Jan Wedekind                         1/33
http://vision.eng.shu.ac.uk/jan/shrug7.pdf
                                    Motivation I/II
  Andrew Wilson: Robust Computer Vision-Based Detection of Pinching for One and
                          Two-Handed Gesture Input




                          http://research.microsoft.com/˜awilson
c 2010 Jan Wedekind                          2/33
http://vision.eng.shu.ac.uk/jan/shrug7.pdf
                                   Motivation II/II


  • subtract background from input image

  • threshold resulting difference image

  • connected component labeling

  • discard components touching border of image

  • select component of significant size

  • extract centroid

  • ...
                                   http://bit.ly/b9sCgw




c 2010 Jan Wedekind                          3/33
http://vision.eng.shu.ac.uk/jan/shrug7.pdf
                                      Hornetseye
                                      Input/Output




c 2010 Jan Wedekind                          4/33
http://vision.eng.shu.ac.uk/jan/shrug7.pdf
                                       Hornetseye
                                      Malloc Objects
                      m = Malloc.new 10
                      m.write ’0123456789’
                      # "0123456789"
                      m.read 5
                      # "01234"
                      ( m + 2 ).read 5
                      # "23456"

c 2010 Jan Wedekind                           5/33
http://vision.eng.shu.ac.uk/jan/shrug7.pdf
                                          Hornetseye
                                      Array Operations I/II
                        operation         loop body              loop variable

                        write element     r[b] =a                      -
                        read element      r      =a[b]                 -
                        write sub-array   r[b+i]=a[i]                  i
                        read sub-array    r[i]   =a[i+b]               i
                        fill               r[i]   =a                    i
                        index array       r[i]   =i                    i
                        unary function    r[i]   =f(a[i])              i
                        binary function   r[i]   =f(a,b[i])            i
                        binary function   r[i]   =f(a[i],b)            i
                        binary function   r[i]   =f(a[i],b[i])         i
                        accumulate        r      =f(r,a[i])            i
                        .
                        .                          .
                                                   .                   .
                                                                       .
                        .                          .                   .

c 2010 Jan Wedekind                              6/33
http://vision.eng.shu.ac.uk/jan/shrug7.pdf
                                         Hornetseye
                                    Array Operations II/II


                      operation        loop body                  loop variable
                      .
                      .                               .
                                                      .                 .
                                                                        .
                      .                               .                 .
                      warp/mask        r[i]   =a[b[i]]                  i
                      unmask           r[b[i]]=a[i]                     i
                      downsampling     r[i]   =a[b*i]                   i
                      upsampling       r[b*i] =a[i]                     i
                      integral         r[i]   =r[i-1]+a[i]              i
                      map              r[i]   =b[a[i]]                  i
                      histogram        r[a[i]]=r[a[i]]+1                i
                      weighted hist.   r[a[i]]=r[a[i]]+b[i]             i
                      correlation      r[i]   =r[i]+a[i+j]*b[j]        i,j



c 2010 Jan Wedekind                              7/33
http://vision.eng.shu.ac.uk/jan/shrug7.pdf
                                      Installation
                                      Kubuntu 8.04
   • Install required packages: sudo aptitude install ruby1.8 ruby1.8-dev 
     irb1.8 imagemagick librmagick-ruby1.8 g++ ccache libboost-dev libxine-dev 
     libxine1-all-plugins libdc1394-13-dev xorg-dev libfftw3-dev libopenexr-dev 
     bison flex texinfo

   • Install libJIT:
     wget http://vision.eng.shu.ac.uk/jan/libjit-0.1.3pre.tar.bz2
     tar xjf libjit-0.1.3pre.tar.bz2
     cd libjit-0.1.3pre
     ./configure && make && sudo make install

   • Download hornetseye-x.x.tar.bz2 from Rubyforge

   • Install Hornetseye:
     tar xjf hornetseye-*.tar.bz2
     cd hornetseye-*
     ./configure.ruby18 && make && sudo make install

c 2010 Jan Wedekind                          8/33
http://vision.eng.shu.ac.uk/jan/shrug7.pdf
                                      Installation
                                    Microsoft Windows



   • Run Ruby one-click installer

   • Reboot

   • Unpack Ghostscript fonts to c:gs (fonts should end up in c:gsfonts)

   • Run ImageMagick installer

   • Download RMagick Rubygem and install using the command
     gem install rmagick-2.6.0-x86-mswin32.gem

   • Download NSIS installer for Hornetseye from Rubyforge and run it

   • Optionally install NArray, MPlayer, Qt4 (requires MinGW), and Qt4QtRuby




c 2010 Jan Wedekind                          9/33
http://vision.eng.shu.ac.uk/jan/shrug7.pdf
                                      Installation
                          Future: Installation with Rubygems?




gem install malloc
gem install multiarray
gem install hornetseye-xine
gem install hornetseye-video4linux
gem install hornetseye-video4linux2
gem install hornetseye-x11
...




c 2010 Jan Wedekind                         10/33
http://vision.eng.shu.ac.uk/jan/shrug7.pdf
                                  Interactive Ruby




c 2010 Jan Wedekind                         11/33
http://vision.eng.shu.ac.uk/jan/shrug7.pdf
                          Gesture Recognition Example
                                   Background Image

               input = DC1394Input.new ’’ , 0, 0,
                  DC1394Input::FORMAT VGA NONCOMPRESSED,
                  DC1394Input::MODE 320x240 YUV422
               bg = input.read sint




c 2010 Jan Wedekind                         12/33
http://vision.eng.shu.ac.uk/jan/shrug7.pdf
                          Gesture Recognition Example
                                        Input Image

               img = input.read ubyte




c 2010 Jan Wedekind                         13/33
http://vision.eng.shu.ac.uk/jan/shrug7.pdf
                          Gesture Recognition Example
                                        Difference

               diff = img - bg




c 2010 Jan Wedekind                         14/33
http://vision.eng.shu.ac.uk/jan/shrug7.pdf
                          Gesture Recognition Example
                                      Thresholding

               binary = diff <= THRESHOLD




c 2010 Jan Wedekind                         15/33
http://vision.eng.shu.ac.uk/jan/shrug7.pdf
                          Gesture Recognition Example
                                       Components

               components = binary.components
               n components = components.max + 1




c 2010 Jan Wedekind                         16/33
http://vision.eng.shu.ac.uk/jan/shrug7.pdf
                          Gesture Recognition Example
                             Compute Area of Components

               area = components.hist n components




c 2010 Jan Wedekind                         17/33
http://vision.eng.shu.ac.uk/jan/shrug7.pdf
                          Gesture Recognition Example
                                 Impose Size Constraint

               mask area = area.between? RANGE.min * SIZE,
                                         RANGE.max * SIZE




c 2010 Jan Wedekind                         18/33
http://vision.eng.shu.ac.uk/jan/shrug7.pdf
                          Gesture Recognition Example
                                       Border Pixel

               border = MultiArray.int( *SHAPE ).fill! 1
               border[ 1 ... SHAPE[ 0 ] - 1, 1 ... SHAPE[ 1 ] - 1 ] = 0




c 2010 Jan Wedekind                         19/33
http://vision.eng.shu.ac.uk/jan/shrug7.pdf
                          Gesture Recognition Example
                          Reject Components touching Border

               mask border = components.
                 hist weighted( n components, border ).eq 0




c 2010 Jan Wedekind                         20/33
http://vision.eng.shu.ac.uk/jan/shrug7.pdf
                          Gesture Recognition Example
                                Remaining Component(s)

               mask = mask area.and mask border
               map = mask.to ubyte.integral * mask.to ubyte
               target = components.map map




c 2010 Jan Wedekind                         21/33
http://vision.eng.shu.ac.uk/jan/shrug7.pdf
                          Gesture Recognition Example
                                     Centre of Gravity

               index = MultiArray.int( *SHAPE ).indgen!
               x, y = index % SHAPE[ 0 ], index / SHAPE[ 0 ]
               sum target = target.sum.to f
               x target = x.mask( target.to bool ).sum / sum target
               y target = y.mask( target.to bool ).sum / sum target

                               x target, y target




c 2010 Jan Wedekind                            22/33
http://vision.eng.shu.ac.uk/jan/shrug7.pdf
                                   Other Examples
                                  Presentation Software




                        http://www.youtube.com/watch?v=wNFr7RNWeCs

c 2010 Jan Wedekind                         23/33
http://vision.eng.shu.ac.uk/jan/shrug7.pdf
                                   Other Examples
                                   Camshift Tracking




      http://www.wedesoft.demon.co.uk/hornetseye-api/files/camshift-txt.html
c 2010 Jan Wedekind                         24/33
http://vision.eng.shu.ac.uk/jan/shrug7.pdf
                                   Other Examples
                                     Barcode Reader




       http://www.wedesoft.demon.co.uk/hornetseye-api/files/barcode-txt.html
c 2010 Jan Wedekind                         25/33
http://vision.eng.shu.ac.uk/jan/shrug7.pdf
                                   Other Examples
                                 Lucas Kanade Tracker




     http://www.wedesoft.demon.co.uk/hornetseye-api/files/lktracker-txt.html

c 2010 Jan Wedekind                         26/33
http://vision.eng.shu.ac.uk/jan/shrug7.pdf
                                   Other Examples
                                Planar Marker Tracking




                            http://rubyconf2009.confreaks.com/
  19-nov-2009-13-15-computer-vision-using-ruby-and-libjit-jan-wedekind.html
c 2010 Jan Wedekind                         27/33
http://vision.eng.shu.ac.uk/jan/shrug7.pdf
                                     Future Work
                           Feature Locations and Descriptors




      http://www.wedesoft.demon.co.uk/hornetseye-api/files/features-txt.html
c 2010 Jan Wedekind                         28/33
Future Work
                       http://vision.eng.shu.ac.uk/jan/shrug7.pdf
                      Inspiration: Probabilistic Feature-based On-line
                                  Rapid Model Acquisition




                        http://mi.eng.cam.ac.uk/˜qp202/my_papers/BMVC09
                                http://mi.eng.cam.ac.uk/˜twd20/




c 2010 Jan Wedekind                           29/33
http://vision.eng.shu.ac.uk/jan/shrug7.pdf
                                         Future Work
                            Inspiration: Bounded Hough Transform




                           http://www.ptgrey.com/newsletters/dec2004.html
                      http://www.ptgrey.com/newsletters/images/GreShaJas04.pdf




c 2010 Jan Wedekind                             30/33
http://vision.eng.shu.ac.uk/jan/shrug7.pdf
                                     Future Work
                                  Inspiration: SceneLib




                               http://www.doc.ic.ac.uk/˜ajd/




c 2010 Jan Wedekind                         31/33
http://vision.eng.shu.ac.uk/jan/shrug7.pdf
                                     Future Work
                                   Inspiration: Avatar




                        http://seqmag.com/2010/01/making-of-avatar/
               http://seqmag.com/2010/01/exclusive-45minute-making-of-avatar/
c 2010 Jan Wedekind                         32/33
http://vision.eng.shu.ac.uk/jan/shrug7.pdf

                                          Thanks
                                   Credits
   Aiden Lockwood, Aleksey Demakov, Annemie Wedekind, Arul Nirai
  Selvan, Ashley Moran, Balasundram Amavasai, Beverly Inkson, Chinwe
Lucy Ozoegwu, Damien Douxchamps, Daniel Mart´n Mar´n, G´ raud De La
                                                     ı    ı    e
 Mensbruge, Gerhard Wedekind, Hussein Abdul-Rahman, Jacques Penders,
    Jag Gill, Jing Jing Wang, Jon Travis, Jong Peng, Juan Roldan, Julien
 Demarest, Julien Faucher, Julien Lacheray, Ken Dutton, Kim Chuan Lim,
   Kirill Kononenko, Klaus Treichel, Manuel Boissenin, Martin Howarth,
    Matthias Stumpf, Michael Doronin, Ralph Gay, Richard Dale, Sonia
Fern´ ndez Rodr´guez, Tan Kang Song, Ushakiran Soutapalli, Volkan Karaca,
    a            ı
                        Warren Jasper, Zineb Saghi, ...
                      http://www.wedesoft.demon.co.uk/hornetseye-api/
                          http://rubyforge.org/projects/hornetseye/
                         http://sourceforge.net/projects/hornetseye/
                               http://launchpad.net/hornetseye/
                        http://raa.ruby-lang.org/project/hornetseye/
                             http://www.ohloh.net/p/hornetseye/
c 2010 Jan Wedekind                           33/33

Más contenido relacionado

Similar a Machine Vision made easy with Ruby - ShRUG June 2010

Functional Reactive Programming on Android
Functional Reactive Programming on AndroidFunctional Reactive Programming on Android
Functional Reactive Programming on AndroidSam Lee
 
掀起 Swift 的面紗
掀起 Swift 的面紗掀起 Swift 的面紗
掀起 Swift 的面紗Pofat Tseng
 
C++totural file
C++totural fileC++totural file
C++totural filehalaisumit
 
Alberto Mancini - A few benchmark on Android
Alberto Mancini - A few benchmark on AndroidAlberto Mancini - A few benchmark on Android
Alberto Mancini - A few benchmark on Androidgdg-ancona
 
Android Survival Guide - Two years of software development
Android Survival Guide - Two years of software developmentAndroid Survival Guide - Two years of software development
Android Survival Guide - Two years of software developmentAlfredo Morresi
 
[Golang] 以 Mobile App 工程師視角,帶你進入 Golang 的世界 (Introduction of GoLang)
[Golang] 以 Mobile App 工程師視角,帶你進入 Golang 的世界 (Introduction of GoLang) [Golang] 以 Mobile App 工程師視角,帶你進入 Golang 的世界 (Introduction of GoLang)
[Golang] 以 Mobile App 工程師視角,帶你進入 Golang 的世界 (Introduction of GoLang) Johnny Sung
 
Catch a spider monkey
Catch a spider monkeyCatch a spider monkey
Catch a spider monkeyChengHui Weng
 
Using Android Things to Detect & Exterminate Reptilians
Using Android Things to Detect & Exterminate ReptiliansUsing Android Things to Detect & Exterminate Reptilians
Using Android Things to Detect & Exterminate ReptiliansNilhcem
 
Performance #6 threading
Performance #6  threadingPerformance #6  threading
Performance #6 threadingVitali Pekelis
 
Digital Imaging with Free Software - Talk at Sheffield Astronomical Society J...
Digital Imaging with Free Software - Talk at Sheffield Astronomical Society J...Digital Imaging with Free Software - Talk at Sheffield Astronomical Society J...
Digital Imaging with Free Software - Talk at Sheffield Astronomical Society J...Jan Wedekind
 
モジュール指向勉強会-コードリーディングを始める前に-
モジュール指向勉強会-コードリーディングを始める前に-モジュール指向勉強会-コードリーディングを始める前に-
モジュール指向勉強会-コードリーディングを始める前に-Hiroki Kondo
 
Digital Fabrication Studio: 3D Scanning
Digital Fabrication Studio: 3D ScanningDigital Fabrication Studio: 3D Scanning
Digital Fabrication Studio: 3D ScanningMassimo Menichinelli
 
Unbundling the JavaScript module bundler - DevIT
Unbundling the JavaScript module bundler - DevITUnbundling the JavaScript module bundler - DevIT
Unbundling the JavaScript module bundler - DevITLuciano Mammino
 
He stopped using for/while loops, you won't believe what happened next!
He stopped using for/while loops, you won't believe what happened next!He stopped using for/while loops, you won't believe what happened next!
He stopped using for/while loops, you won't believe what happened next!François-Guillaume Ribreau
 
I fly 747 400 operations manual
I fly 747 400 operations manualI fly 747 400 operations manual
I fly 747 400 operations manualguest426e85
 
DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)Soshi Nemoto
 

Similar a Machine Vision made easy with Ruby - ShRUG June 2010 (20)

Functional Reactive Programming on Android
Functional Reactive Programming on AndroidFunctional Reactive Programming on Android
Functional Reactive Programming on Android
 
REVIEW OF VIRTUAL ARTICULATED ROBOT
REVIEW OF VIRTUAL ARTICULATED ROBOTREVIEW OF VIRTUAL ARTICULATED ROBOT
REVIEW OF VIRTUAL ARTICULATED ROBOT
 
C++ tutorial
C++ tutorialC++ tutorial
C++ tutorial
 
掀起 Swift 的面紗
掀起 Swift 的面紗掀起 Swift 的面紗
掀起 Swift 的面紗
 
C++totural file
C++totural fileC++totural file
C++totural file
 
tutorial
tutorialtutorial
tutorial
 
Alberto Mancini - A few benchmark on Android
Alberto Mancini - A few benchmark on AndroidAlberto Mancini - A few benchmark on Android
Alberto Mancini - A few benchmark on Android
 
Android Survival Guide - Two years of software development
Android Survival Guide - Two years of software developmentAndroid Survival Guide - Two years of software development
Android Survival Guide - Two years of software development
 
[Golang] 以 Mobile App 工程師視角,帶你進入 Golang 的世界 (Introduction of GoLang)
[Golang] 以 Mobile App 工程師視角,帶你進入 Golang 的世界 (Introduction of GoLang) [Golang] 以 Mobile App 工程師視角,帶你進入 Golang 的世界 (Introduction of GoLang)
[Golang] 以 Mobile App 工程師視角,帶你進入 Golang 的世界 (Introduction of GoLang)
 
Catch a spider monkey
Catch a spider monkeyCatch a spider monkey
Catch a spider monkey
 
Using Android Things to Detect & Exterminate Reptilians
Using Android Things to Detect & Exterminate ReptiliansUsing Android Things to Detect & Exterminate Reptilians
Using Android Things to Detect & Exterminate Reptilians
 
Performance #6 threading
Performance #6  threadingPerformance #6  threading
Performance #6 threading
 
Digital Imaging with Free Software - Talk at Sheffield Astronomical Society J...
Digital Imaging with Free Software - Talk at Sheffield Astronomical Society J...Digital Imaging with Free Software - Talk at Sheffield Astronomical Society J...
Digital Imaging with Free Software - Talk at Sheffield Astronomical Society J...
 
モジュール指向勉強会-コードリーディングを始める前に-
モジュール指向勉強会-コードリーディングを始める前に-モジュール指向勉強会-コードリーディングを始める前に-
モジュール指向勉強会-コードリーディングを始める前に-
 
Digital Fabrication Studio: 3D Scanning
Digital Fabrication Studio: 3D ScanningDigital Fabrication Studio: 3D Scanning
Digital Fabrication Studio: 3D Scanning
 
Sync considered unethical
Sync considered unethicalSync considered unethical
Sync considered unethical
 
Unbundling the JavaScript module bundler - DevIT
Unbundling the JavaScript module bundler - DevITUnbundling the JavaScript module bundler - DevIT
Unbundling the JavaScript module bundler - DevIT
 
He stopped using for/while loops, you won't believe what happened next!
He stopped using for/while loops, you won't believe what happened next!He stopped using for/while loops, you won't believe what happened next!
He stopped using for/while loops, you won't believe what happened next!
 
I fly 747 400 operations manual
I fly 747 400 operations manualI fly 747 400 operations manual
I fly 747 400 operations manual
 
DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)
 

Más de Jan Wedekind

The SOLID Principles for Software Design
The SOLID Principles for Software DesignThe SOLID Principles for Software Design
The SOLID Principles for Software DesignJan Wedekind
 
Fundamentals of Computing
Fundamentals of ComputingFundamentals of Computing
Fundamentals of ComputingJan Wedekind
 
Using Generic Image Processing Operations to Detect a Calibration Grid
Using Generic Image Processing Operations to Detect a Calibration GridUsing Generic Image Processing Operations to Detect a Calibration Grid
Using Generic Image Processing Operations to Detect a Calibration GridJan Wedekind
 
Efficient implementations of machine vision algorithms using a dynamically ty...
Efficient implementations of machine vision algorithms using a dynamically ty...Efficient implementations of machine vision algorithms using a dynamically ty...
Efficient implementations of machine vision algorithms using a dynamically ty...Jan Wedekind
 
The MiCRoN Project
The MiCRoN ProjectThe MiCRoN Project
The MiCRoN ProjectJan Wedekind
 
Computer vision for microscopes
Computer vision for microscopesComputer vision for microscopes
Computer vision for microscopesJan Wedekind
 
Focus set based reconstruction of micro-objects
Focus set based reconstruction of micro-objectsFocus set based reconstruction of micro-objects
Focus set based reconstruction of micro-objectsJan Wedekind
 
Machine vision and device integration with the Ruby programming language (2008)
Machine vision and device integration with the Ruby programming language (2008)Machine vision and device integration with the Ruby programming language (2008)
Machine vision and device integration with the Ruby programming language (2008)Jan Wedekind
 
Reconstruction (of micro-objects) based on focus-sets using blind deconvoluti...
Reconstruction (of micro-objects) based on focus-sets using blind deconvoluti...Reconstruction (of micro-objects) based on focus-sets using blind deconvoluti...
Reconstruction (of micro-objects) based on focus-sets using blind deconvoluti...Jan Wedekind
 
Fokus-serien basierte Rekonstruktion von Mikroobjekten (2002)
Fokus-serien basierte Rekonstruktion von Mikroobjekten (2002)Fokus-serien basierte Rekonstruktion von Mikroobjekten (2002)
Fokus-serien basierte Rekonstruktion von Mikroobjekten (2002)Jan Wedekind
 
Play Squash with Ruby, OpenGL, and a Wiimote - ShRUG Feb 2011
Play Squash with Ruby, OpenGL, and a Wiimote - ShRUG Feb 2011Play Squash with Ruby, OpenGL, and a Wiimote - ShRUG Feb 2011
Play Squash with Ruby, OpenGL, and a Wiimote - ShRUG Feb 2011Jan Wedekind
 
Computer Vision using Ruby and libJIT - RubyConf 2009
Computer Vision using Ruby and libJIT - RubyConf 2009Computer Vision using Ruby and libJIT - RubyConf 2009
Computer Vision using Ruby and libJIT - RubyConf 2009Jan Wedekind
 
Real-time Computer Vision With Ruby - OSCON 2008
Real-time Computer Vision With Ruby - OSCON 2008Real-time Computer Vision With Ruby - OSCON 2008
Real-time Computer Vision With Ruby - OSCON 2008Jan Wedekind
 
Object Recognition and Real-Time Tracking in Microscope Imaging - IMVIP 2006
Object Recognition and Real-Time Tracking in Microscope Imaging - IMVIP 2006Object Recognition and Real-Time Tracking in Microscope Imaging - IMVIP 2006
Object Recognition and Real-Time Tracking in Microscope Imaging - IMVIP 2006Jan Wedekind
 
Steerable Filters generated with the Hypercomplex Dual-Tree Wavelet Transform...
Steerable Filters generated with the Hypercomplex Dual-Tree Wavelet Transform...Steerable Filters generated with the Hypercomplex Dual-Tree Wavelet Transform...
Steerable Filters generated with the Hypercomplex Dual-Tree Wavelet Transform...Jan Wedekind
 
Ruby & Machine Vision - Talk at Sheffield Hallam University Feb 2009
Ruby & Machine Vision - Talk at Sheffield Hallam University Feb 2009Ruby & Machine Vision - Talk at Sheffield Hallam University Feb 2009
Ruby & Machine Vision - Talk at Sheffield Hallam University Feb 2009Jan Wedekind
 

Más de Jan Wedekind (16)

The SOLID Principles for Software Design
The SOLID Principles for Software DesignThe SOLID Principles for Software Design
The SOLID Principles for Software Design
 
Fundamentals of Computing
Fundamentals of ComputingFundamentals of Computing
Fundamentals of Computing
 
Using Generic Image Processing Operations to Detect a Calibration Grid
Using Generic Image Processing Operations to Detect a Calibration GridUsing Generic Image Processing Operations to Detect a Calibration Grid
Using Generic Image Processing Operations to Detect a Calibration Grid
 
Efficient implementations of machine vision algorithms using a dynamically ty...
Efficient implementations of machine vision algorithms using a dynamically ty...Efficient implementations of machine vision algorithms using a dynamically ty...
Efficient implementations of machine vision algorithms using a dynamically ty...
 
The MiCRoN Project
The MiCRoN ProjectThe MiCRoN Project
The MiCRoN Project
 
Computer vision for microscopes
Computer vision for microscopesComputer vision for microscopes
Computer vision for microscopes
 
Focus set based reconstruction of micro-objects
Focus set based reconstruction of micro-objectsFocus set based reconstruction of micro-objects
Focus set based reconstruction of micro-objects
 
Machine vision and device integration with the Ruby programming language (2008)
Machine vision and device integration with the Ruby programming language (2008)Machine vision and device integration with the Ruby programming language (2008)
Machine vision and device integration with the Ruby programming language (2008)
 
Reconstruction (of micro-objects) based on focus-sets using blind deconvoluti...
Reconstruction (of micro-objects) based on focus-sets using blind deconvoluti...Reconstruction (of micro-objects) based on focus-sets using blind deconvoluti...
Reconstruction (of micro-objects) based on focus-sets using blind deconvoluti...
 
Fokus-serien basierte Rekonstruktion von Mikroobjekten (2002)
Fokus-serien basierte Rekonstruktion von Mikroobjekten (2002)Fokus-serien basierte Rekonstruktion von Mikroobjekten (2002)
Fokus-serien basierte Rekonstruktion von Mikroobjekten (2002)
 
Play Squash with Ruby, OpenGL, and a Wiimote - ShRUG Feb 2011
Play Squash with Ruby, OpenGL, and a Wiimote - ShRUG Feb 2011Play Squash with Ruby, OpenGL, and a Wiimote - ShRUG Feb 2011
Play Squash with Ruby, OpenGL, and a Wiimote - ShRUG Feb 2011
 
Computer Vision using Ruby and libJIT - RubyConf 2009
Computer Vision using Ruby and libJIT - RubyConf 2009Computer Vision using Ruby and libJIT - RubyConf 2009
Computer Vision using Ruby and libJIT - RubyConf 2009
 
Real-time Computer Vision With Ruby - OSCON 2008
Real-time Computer Vision With Ruby - OSCON 2008Real-time Computer Vision With Ruby - OSCON 2008
Real-time Computer Vision With Ruby - OSCON 2008
 
Object Recognition and Real-Time Tracking in Microscope Imaging - IMVIP 2006
Object Recognition and Real-Time Tracking in Microscope Imaging - IMVIP 2006Object Recognition and Real-Time Tracking in Microscope Imaging - IMVIP 2006
Object Recognition and Real-Time Tracking in Microscope Imaging - IMVIP 2006
 
Steerable Filters generated with the Hypercomplex Dual-Tree Wavelet Transform...
Steerable Filters generated with the Hypercomplex Dual-Tree Wavelet Transform...Steerable Filters generated with the Hypercomplex Dual-Tree Wavelet Transform...
Steerable Filters generated with the Hypercomplex Dual-Tree Wavelet Transform...
 
Ruby & Machine Vision - Talk at Sheffield Hallam University Feb 2009
Ruby & Machine Vision - Talk at Sheffield Hallam University Feb 2009Ruby & Machine Vision - Talk at Sheffield Hallam University Feb 2009
Ruby & Machine Vision - Talk at Sheffield Hallam University Feb 2009
 

Último

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 

Último (20)

DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 

Machine Vision made easy with Ruby - ShRUG June 2010

  • 1. http://vision.eng.shu.ac.uk/jan/shrug7.pdf Machine Vision made easy with Ruby Machine Vision made easy with Ruby Jan Wedekind Mon Jun 14 19:00:00 BST 2010 c 2010 Jan Wedekind 1/33
  • 2. http://vision.eng.shu.ac.uk/jan/shrug7.pdf Motivation I/II Andrew Wilson: Robust Computer Vision-Based Detection of Pinching for One and Two-Handed Gesture Input http://research.microsoft.com/˜awilson c 2010 Jan Wedekind 2/33
  • 3. http://vision.eng.shu.ac.uk/jan/shrug7.pdf Motivation II/II • subtract background from input image • threshold resulting difference image • connected component labeling • discard components touching border of image • select component of significant size • extract centroid • ... http://bit.ly/b9sCgw c 2010 Jan Wedekind 3/33
  • 4. http://vision.eng.shu.ac.uk/jan/shrug7.pdf Hornetseye Input/Output c 2010 Jan Wedekind 4/33
  • 5. http://vision.eng.shu.ac.uk/jan/shrug7.pdf Hornetseye Malloc Objects m = Malloc.new 10 m.write ’0123456789’ # "0123456789" m.read 5 # "01234" ( m + 2 ).read 5 # "23456" c 2010 Jan Wedekind 5/33
  • 6. http://vision.eng.shu.ac.uk/jan/shrug7.pdf Hornetseye Array Operations I/II operation loop body loop variable write element r[b] =a - read element r =a[b] - write sub-array r[b+i]=a[i] i read sub-array r[i] =a[i+b] i fill r[i] =a i index array r[i] =i i unary function r[i] =f(a[i]) i binary function r[i] =f(a,b[i]) i binary function r[i] =f(a[i],b) i binary function r[i] =f(a[i],b[i]) i accumulate r =f(r,a[i]) i . . . . . . . . . c 2010 Jan Wedekind 6/33
  • 7. http://vision.eng.shu.ac.uk/jan/shrug7.pdf Hornetseye Array Operations II/II operation loop body loop variable . . . . . . . . . warp/mask r[i] =a[b[i]] i unmask r[b[i]]=a[i] i downsampling r[i] =a[b*i] i upsampling r[b*i] =a[i] i integral r[i] =r[i-1]+a[i] i map r[i] =b[a[i]] i histogram r[a[i]]=r[a[i]]+1 i weighted hist. r[a[i]]=r[a[i]]+b[i] i correlation r[i] =r[i]+a[i+j]*b[j] i,j c 2010 Jan Wedekind 7/33
  • 8. http://vision.eng.shu.ac.uk/jan/shrug7.pdf Installation Kubuntu 8.04 • Install required packages: sudo aptitude install ruby1.8 ruby1.8-dev irb1.8 imagemagick librmagick-ruby1.8 g++ ccache libboost-dev libxine-dev libxine1-all-plugins libdc1394-13-dev xorg-dev libfftw3-dev libopenexr-dev bison flex texinfo • Install libJIT: wget http://vision.eng.shu.ac.uk/jan/libjit-0.1.3pre.tar.bz2 tar xjf libjit-0.1.3pre.tar.bz2 cd libjit-0.1.3pre ./configure && make && sudo make install • Download hornetseye-x.x.tar.bz2 from Rubyforge • Install Hornetseye: tar xjf hornetseye-*.tar.bz2 cd hornetseye-* ./configure.ruby18 && make && sudo make install c 2010 Jan Wedekind 8/33
  • 9. http://vision.eng.shu.ac.uk/jan/shrug7.pdf Installation Microsoft Windows • Run Ruby one-click installer • Reboot • Unpack Ghostscript fonts to c:gs (fonts should end up in c:gsfonts) • Run ImageMagick installer • Download RMagick Rubygem and install using the command gem install rmagick-2.6.0-x86-mswin32.gem • Download NSIS installer for Hornetseye from Rubyforge and run it • Optionally install NArray, MPlayer, Qt4 (requires MinGW), and Qt4QtRuby c 2010 Jan Wedekind 9/33
  • 10. http://vision.eng.shu.ac.uk/jan/shrug7.pdf Installation Future: Installation with Rubygems? gem install malloc gem install multiarray gem install hornetseye-xine gem install hornetseye-video4linux gem install hornetseye-video4linux2 gem install hornetseye-x11 ... c 2010 Jan Wedekind 10/33
  • 11. http://vision.eng.shu.ac.uk/jan/shrug7.pdf Interactive Ruby c 2010 Jan Wedekind 11/33
  • 12. http://vision.eng.shu.ac.uk/jan/shrug7.pdf Gesture Recognition Example Background Image input = DC1394Input.new ’’ , 0, 0, DC1394Input::FORMAT VGA NONCOMPRESSED, DC1394Input::MODE 320x240 YUV422 bg = input.read sint c 2010 Jan Wedekind 12/33
  • 13. http://vision.eng.shu.ac.uk/jan/shrug7.pdf Gesture Recognition Example Input Image img = input.read ubyte c 2010 Jan Wedekind 13/33
  • 14. http://vision.eng.shu.ac.uk/jan/shrug7.pdf Gesture Recognition Example Difference diff = img - bg c 2010 Jan Wedekind 14/33
  • 15. http://vision.eng.shu.ac.uk/jan/shrug7.pdf Gesture Recognition Example Thresholding binary = diff <= THRESHOLD c 2010 Jan Wedekind 15/33
  • 16. http://vision.eng.shu.ac.uk/jan/shrug7.pdf Gesture Recognition Example Components components = binary.components n components = components.max + 1 c 2010 Jan Wedekind 16/33
  • 17. http://vision.eng.shu.ac.uk/jan/shrug7.pdf Gesture Recognition Example Compute Area of Components area = components.hist n components c 2010 Jan Wedekind 17/33
  • 18. http://vision.eng.shu.ac.uk/jan/shrug7.pdf Gesture Recognition Example Impose Size Constraint mask area = area.between? RANGE.min * SIZE, RANGE.max * SIZE c 2010 Jan Wedekind 18/33
  • 19. http://vision.eng.shu.ac.uk/jan/shrug7.pdf Gesture Recognition Example Border Pixel border = MultiArray.int( *SHAPE ).fill! 1 border[ 1 ... SHAPE[ 0 ] - 1, 1 ... SHAPE[ 1 ] - 1 ] = 0 c 2010 Jan Wedekind 19/33
  • 20. http://vision.eng.shu.ac.uk/jan/shrug7.pdf Gesture Recognition Example Reject Components touching Border mask border = components. hist weighted( n components, border ).eq 0 c 2010 Jan Wedekind 20/33
  • 21. http://vision.eng.shu.ac.uk/jan/shrug7.pdf Gesture Recognition Example Remaining Component(s) mask = mask area.and mask border map = mask.to ubyte.integral * mask.to ubyte target = components.map map c 2010 Jan Wedekind 21/33
  • 22. http://vision.eng.shu.ac.uk/jan/shrug7.pdf Gesture Recognition Example Centre of Gravity index = MultiArray.int( *SHAPE ).indgen! x, y = index % SHAPE[ 0 ], index / SHAPE[ 0 ] sum target = target.sum.to f x target = x.mask( target.to bool ).sum / sum target y target = y.mask( target.to bool ).sum / sum target x target, y target c 2010 Jan Wedekind 22/33
  • 23. http://vision.eng.shu.ac.uk/jan/shrug7.pdf Other Examples Presentation Software http://www.youtube.com/watch?v=wNFr7RNWeCs c 2010 Jan Wedekind 23/33
  • 24. http://vision.eng.shu.ac.uk/jan/shrug7.pdf Other Examples Camshift Tracking http://www.wedesoft.demon.co.uk/hornetseye-api/files/camshift-txt.html c 2010 Jan Wedekind 24/33
  • 25. http://vision.eng.shu.ac.uk/jan/shrug7.pdf Other Examples Barcode Reader http://www.wedesoft.demon.co.uk/hornetseye-api/files/barcode-txt.html c 2010 Jan Wedekind 25/33
  • 26. http://vision.eng.shu.ac.uk/jan/shrug7.pdf Other Examples Lucas Kanade Tracker http://www.wedesoft.demon.co.uk/hornetseye-api/files/lktracker-txt.html c 2010 Jan Wedekind 26/33
  • 27. http://vision.eng.shu.ac.uk/jan/shrug7.pdf Other Examples Planar Marker Tracking http://rubyconf2009.confreaks.com/ 19-nov-2009-13-15-computer-vision-using-ruby-and-libjit-jan-wedekind.html c 2010 Jan Wedekind 27/33
  • 28. http://vision.eng.shu.ac.uk/jan/shrug7.pdf Future Work Feature Locations and Descriptors http://www.wedesoft.demon.co.uk/hornetseye-api/files/features-txt.html c 2010 Jan Wedekind 28/33
  • 29. Future Work http://vision.eng.shu.ac.uk/jan/shrug7.pdf Inspiration: Probabilistic Feature-based On-line Rapid Model Acquisition http://mi.eng.cam.ac.uk/˜qp202/my_papers/BMVC09 http://mi.eng.cam.ac.uk/˜twd20/ c 2010 Jan Wedekind 29/33
  • 30. http://vision.eng.shu.ac.uk/jan/shrug7.pdf Future Work Inspiration: Bounded Hough Transform http://www.ptgrey.com/newsletters/dec2004.html http://www.ptgrey.com/newsletters/images/GreShaJas04.pdf c 2010 Jan Wedekind 30/33
  • 31. http://vision.eng.shu.ac.uk/jan/shrug7.pdf Future Work Inspiration: SceneLib http://www.doc.ic.ac.uk/˜ajd/ c 2010 Jan Wedekind 31/33
  • 32. http://vision.eng.shu.ac.uk/jan/shrug7.pdf Future Work Inspiration: Avatar http://seqmag.com/2010/01/making-of-avatar/ http://seqmag.com/2010/01/exclusive-45minute-making-of-avatar/ c 2010 Jan Wedekind 32/33
  • 33. http://vision.eng.shu.ac.uk/jan/shrug7.pdf Thanks Credits Aiden Lockwood, Aleksey Demakov, Annemie Wedekind, Arul Nirai Selvan, Ashley Moran, Balasundram Amavasai, Beverly Inkson, Chinwe Lucy Ozoegwu, Damien Douxchamps, Daniel Mart´n Mar´n, G´ raud De La ı ı e Mensbruge, Gerhard Wedekind, Hussein Abdul-Rahman, Jacques Penders, Jag Gill, Jing Jing Wang, Jon Travis, Jong Peng, Juan Roldan, Julien Demarest, Julien Faucher, Julien Lacheray, Ken Dutton, Kim Chuan Lim, Kirill Kononenko, Klaus Treichel, Manuel Boissenin, Martin Howarth, Matthias Stumpf, Michael Doronin, Ralph Gay, Richard Dale, Sonia Fern´ ndez Rodr´guez, Tan Kang Song, Ushakiran Soutapalli, Volkan Karaca, a ı Warren Jasper, Zineb Saghi, ... http://www.wedesoft.demon.co.uk/hornetseye-api/ http://rubyforge.org/projects/hornetseye/ http://sourceforge.net/projects/hornetseye/ http://launchpad.net/hornetseye/ http://raa.ruby-lang.org/project/hornetseye/ http://www.ohloh.net/p/hornetseye/ c 2010 Jan Wedekind 33/33