Pharo VX

Dmitry Matveev
Dmitry MatveevSenior software engineer at Itseez
PharoVX
Accelerated computer vision in Pharo
Dmitry Matveev // ESUG 2015 // Brescia
About
Me:
● A C++ programmer
● Playing with Smalltalk since 2009
● Itseez employee since 2013
PharoVX:
● An interface to OpenVX from Pharo
Cool, but… What is OpenVX?
OpenVX
● A standard for accelerated computer vision
● Released by Khronos group
● Specifies a set of optimized functions
● Hardware vendors will implement it for
various platforms
https://www.khronos.org/openvx/
Companies behind OpenVX
Itseez is the OpenVX working group chair
OpenVX Concepts
1. Express your computer vision task as a
graph
a. Operate with nodes and kernels
b. Each node (kernel) represents a single accelerated
operation
2. Ask hardware to perform the task
3. That’s it!
OpenVX Example
Convert to
YUV
Extract “Y”
Gaussian
blur
Canny
edge
detector
OpenVX Example
Convert to
YUV
Extract “Y”
Gaussian
blur
Canny
edge
detector
Source and destination images are available in the host
(application memory)
OpenVX Example
Convert to
YUV
Extract “Y”
Gaussian
blur
Canny
edge
detector
Source and destination images are available in the host
(application memory)
Intermediate data is somewhere in the
hardware memory (inaccessible)
OpenVX Example
Convert to
YUV
Extract “Y”
Gaussian
blur
Canny
edge
detector
Source and destination images are available in the host
(application memory)
Intermediate data is somewhere in the
hardware memory (inaccessible)
How it is executed - God (vendor) only
knows!
OpenVX
1. Reference implementation is available on
the Khronos website
2. More optimized vendor implementations to
come…
3. But we can play with it right now!
PharoVX
PharoVX
● Binding to core OpenVX functions
● Built with NativeBoost
● Provides interface to standard nodes (VX
1.0)
● Works with Khronos implementation
● ...Highly experimental: written in a week!
http://smalltalkhub.com/#!/~DmitryMatveev/PharoVX
Demo
Sample code: running Canny
runCanny
| ctx g in yuv y blr t out |
ctx := VXContext new.
g := VXGraph new: ctx.
t := VXThreshold new: ctx thresholdType: VX_THRESHOLD_TYPE_RANGE dataType: VX_TYPE_UINT8.
t lower: 64; upper: 200.
in := (Form fromFileNamed: '/tmp/lena.jpg') asVXImage: ctx.
yuv := VXImage virtual: g format: VX_DF_IMAGE_YUV4.
y := VXImage virtual: g.
blr := VXImage virtual: g.
out := VXImage new: ctx width: in width height: in height format: VX_DF_IMAGE_U8.
g colorConvert: in to: yuv;
channelExtract: yuv channel: VX_CHANNEL_Y to: y;
gaussian3x3: y to: blr;
canny: blr threshold: t gradSize: 3 normType: VX_NORM_L2 to: out.
g verify; process.
^out asForm
Status: OpenVX 1.0
AbsDiff Channel extr. Gaussian pyr. Multiply Table lookup
Accumulate Color convert HalfScale Gauss. Not Threshold
AccumulateW Convert depth Harris corners OptFlowPyrLK Warp affine
AccumulateSqr Convolve Histogram Or Warp perspecive
Add Dilate3x3 Integral Phase
And EqualizeHist Magnitude Remap
Box3x3 Erode3x3 MeanStdDev Scale
Canny FAST corners Median3x3 Sobel3x3
Channel comb. Gaussian 3x3 MinMaxLoc Subtract
Status: PharoVX 16/Jul/2015
AbsDiff Channel extr. Gaussian pyr. Multiply Table lookup
Accumulate Color convert HalfScale Gauss. Not Threshold
AccumulateW Convert depth Harris corners OptFlowPyrLK Warp affine
AccumulateSqr Convolve Histogram Or Warp perspecive
Add Dilate3x3 Integral Phase
And EqualizeHist Magnitude Remap
Box3x3 Erode3x3 MeanStdDev Scale
Canny FAST corners Median3x3 Sobel3x3
Channel comb. Gaussian 3x3 MinMaxLoc Subtract
Summary
● PharoVX is currently a prototype:
○ Provides core objects and almost all standard
kernels
○ Fragile, buggy, and so on - yes!
○ Pretty close to plain C API - probably needs to be
“Smalltalkized”
● Computer vision in Smalltalk is fun!
● Feel free to join :-)
Questions
Contacts and resources
Dmitry Matveev
● dmitry.matveev@itseez.com
● http://linkedin.com/in/dmitrym
PharoVX/OpenVX
● http://dmitrymatveev.co.uk/pharovx/
● http://smalltalkhub.com/#!/~DmitryMatveev/PharoVX
● http://khronos.org/openvx/
● http://itseez.com/
Thanks!
1 of 21

Recommended

P2P2
P2Anand Khandare
182 views10 slides
Live in shellLive in shell
Live in shellTiến Nguyễn
21 views12 slides
Loops (1)Loops (1)
Loops (1)esmail said
20 views15 slides

More Related Content

What's hot(20)

Inc decsourcefileInc decsourcefile
Inc decsourcefile
heartplusbrain201 views
2 19-2018-mean of all runs2 19-2018-mean of all runs
2 19-2018-mean of all runs
Alexander Bitar20 views
Untitled presentation(4)Untitled presentation(4)
Untitled presentation(4)
chan20kaur157 views
Basic Intro to WinDbgBasic Intro to WinDbg
Basic Intro to WinDbg
Emad Alashi703 views
3 rd animation3 rd animation
3 rd animation
divyalakshmi7750 views
Python 3 - tutorialPython 3 - tutorial
Python 3 - tutorial
Andrews Medina1.8K views
Bitcoin:NextBitcoin:Next
Bitcoin:Next
Felix Crisan92 views
PerimeterPerimeter
Perimeter
Mike Lee393 views
C coroutineC coroutine
C coroutine
Chien-Wei Huang450 views
CodeCode
Code
Lay Chan Dara Raksmey68 views
Dev day linux reduDev day linux redu
Dev day linux redu
Tarcisio Coutinho417 views
201801 CSE240 Lecture 12201801 CSE240 Lecture 12
201801 CSE240 Lecture 12
Javier Gonzalez-Sanchez99 views
Open GL Programming Training Session IOpen GL Programming Training Session I
Open GL Programming Training Session I
NEEVEE Technologies310 views
Ns tutorialNs tutorial
Ns tutorial
SAMMMATHEW394 views

Similar to Pharo VX(20)

Andes open cl for RISC-VAndes open cl for RISC-V
Andes open cl for RISC-V
RISC-V International237 views
Xdebug from a to xXdebug from a to x
Xdebug from a to x
Gennady Feldman2.6K views
GNURAdioDoc-8GNURAdioDoc-8
GNURAdioDoc-8
tutorialsruby1.5K views
GNURAdioDoc-8GNURAdioDoc-8
GNURAdioDoc-8
tutorialsruby1.5K views
wxPython and wxFormBuilderwxPython and wxFormBuilder
wxPython and wxFormBuilder
Jenny Liang13K views
Introduction to XdebugIntroduction to Xdebug
Introduction to Xdebug
Abid Malik218 views
3-sdn-lab.pdf3-sdn-lab.pdf
3-sdn-lab.pdf
Vijesh Kannan Devan Nair2 views
Debugging node in prodDebugging node in prod
Debugging node in prod
Yunong Xiao186.8K views
Programming in cProgramming in c
Programming in c
Ashutosh Srivasatava266 views
BookBook
Book
luis_lmro541 views
100 bugs in Open Source C/C++ projects 100 bugs in Open Source C/C++ projects
100 bugs in Open Source C/C++ projects
Andrey Karpov1.2K views
LCA13: Xen on ARMLCA13: Xen on ARM
LCA13: Xen on ARM
Linaro1.9K views
Deploying Prometheus stacks with JujuDeploying Prometheus stacks with Juju
Deploying Prometheus stacks with Juju
J.J. Ciarlante282 views
Getting started with wxWidgets Getting started with wxWidgets
Getting started with wxWidgets
Iulian-Nicu Şerbănoiu2K views
Berlin sigma-2017Berlin sigma-2017
Berlin sigma-2017
Alex Chepurnoy445 views
Anomalies in X-Ray EngineAnomalies in X-Ray Engine
Anomalies in X-Ray Engine
PVS-Studio50 views

Pharo VX

  • 1. PharoVX Accelerated computer vision in Pharo Dmitry Matveev // ESUG 2015 // Brescia
  • 2. About Me: ● A C++ programmer ● Playing with Smalltalk since 2009 ● Itseez employee since 2013 PharoVX: ● An interface to OpenVX from Pharo
  • 3. Cool, but… What is OpenVX?
  • 4. OpenVX ● A standard for accelerated computer vision ● Released by Khronos group ● Specifies a set of optimized functions ● Hardware vendors will implement it for various platforms https://www.khronos.org/openvx/
  • 5. Companies behind OpenVX Itseez is the OpenVX working group chair
  • 6. OpenVX Concepts 1. Express your computer vision task as a graph a. Operate with nodes and kernels b. Each node (kernel) represents a single accelerated operation 2. Ask hardware to perform the task 3. That’s it!
  • 7. OpenVX Example Convert to YUV Extract “Y” Gaussian blur Canny edge detector
  • 8. OpenVX Example Convert to YUV Extract “Y” Gaussian blur Canny edge detector Source and destination images are available in the host (application memory)
  • 9. OpenVX Example Convert to YUV Extract “Y” Gaussian blur Canny edge detector Source and destination images are available in the host (application memory) Intermediate data is somewhere in the hardware memory (inaccessible)
  • 10. OpenVX Example Convert to YUV Extract “Y” Gaussian blur Canny edge detector Source and destination images are available in the host (application memory) Intermediate data is somewhere in the hardware memory (inaccessible) How it is executed - God (vendor) only knows!
  • 11. OpenVX 1. Reference implementation is available on the Khronos website 2. More optimized vendor implementations to come… 3. But we can play with it right now!
  • 13. PharoVX ● Binding to core OpenVX functions ● Built with NativeBoost ● Provides interface to standard nodes (VX 1.0) ● Works with Khronos implementation ● ...Highly experimental: written in a week! http://smalltalkhub.com/#!/~DmitryMatveev/PharoVX
  • 14. Demo
  • 15. Sample code: running Canny runCanny | ctx g in yuv y blr t out | ctx := VXContext new. g := VXGraph new: ctx. t := VXThreshold new: ctx thresholdType: VX_THRESHOLD_TYPE_RANGE dataType: VX_TYPE_UINT8. t lower: 64; upper: 200. in := (Form fromFileNamed: '/tmp/lena.jpg') asVXImage: ctx. yuv := VXImage virtual: g format: VX_DF_IMAGE_YUV4. y := VXImage virtual: g. blr := VXImage virtual: g. out := VXImage new: ctx width: in width height: in height format: VX_DF_IMAGE_U8. g colorConvert: in to: yuv; channelExtract: yuv channel: VX_CHANNEL_Y to: y; gaussian3x3: y to: blr; canny: blr threshold: t gradSize: 3 normType: VX_NORM_L2 to: out. g verify; process. ^out asForm
  • 16. Status: OpenVX 1.0 AbsDiff Channel extr. Gaussian pyr. Multiply Table lookup Accumulate Color convert HalfScale Gauss. Not Threshold AccumulateW Convert depth Harris corners OptFlowPyrLK Warp affine AccumulateSqr Convolve Histogram Or Warp perspecive Add Dilate3x3 Integral Phase And EqualizeHist Magnitude Remap Box3x3 Erode3x3 MeanStdDev Scale Canny FAST corners Median3x3 Sobel3x3 Channel comb. Gaussian 3x3 MinMaxLoc Subtract
  • 17. Status: PharoVX 16/Jul/2015 AbsDiff Channel extr. Gaussian pyr. Multiply Table lookup Accumulate Color convert HalfScale Gauss. Not Threshold AccumulateW Convert depth Harris corners OptFlowPyrLK Warp affine AccumulateSqr Convolve Histogram Or Warp perspecive Add Dilate3x3 Integral Phase And EqualizeHist Magnitude Remap Box3x3 Erode3x3 MeanStdDev Scale Canny FAST corners Median3x3 Sobel3x3 Channel comb. Gaussian 3x3 MinMaxLoc Subtract
  • 18. Summary ● PharoVX is currently a prototype: ○ Provides core objects and almost all standard kernels ○ Fragile, buggy, and so on - yes! ○ Pretty close to plain C API - probably needs to be “Smalltalkized” ● Computer vision in Smalltalk is fun! ● Feel free to join :-)
  • 20. Contacts and resources Dmitry Matveev ● dmitry.matveev@itseez.com ● http://linkedin.com/in/dmitrym PharoVX/OpenVX ● http://dmitrymatveev.co.uk/pharovx/ ● http://smalltalkhub.com/#!/~DmitryMatveev/PharoVX ● http://khronos.org/openvx/ ● http://itseez.com/