Title :
A machine vision extension to the Ruby programming language using OpenCV and FFI
Author :
Marburg, Aaron ; Hayes, Michael P. ; Bainbridge-Smith, Andrew
Author_Institution :
Dept. of Electr. & Comput. Eng., Univ. of Canterbury, Christchurch, New Zealand
Abstract :
This paper introduces the OpenCV-FFI software package, which exposes datatypes and functions from the OpenCV computer vision library into the Ruby programming language. OpenCV-FFI uses the foreign function interface (FFI) to produce a Ruby API which mirrors the OpenCV C API; further layers of complexity are then built on that core API. Example code and benchmarking results show the effectiveness of using OpenCV-FFI for scripting OpenCV code within Ruby, as well as demonstrating the pitfalls of incautious use of Ruby iteration. Finally, there is a discussion of the relative advantages and disadvantages of the FFI-based approach versus a bespoke extension library written in Ruby-C or the use of an automatic wrapper generation packages (e.g., SWIG).
Keywords :
application program interfaces; computer vision; object-oriented languages; FFI-based approach; OpenCV C API; OpenCV code; OpenCV computer vision library; OpenCV-FFI software package; Ruby API; Ruby iteration; Ruby programming language; automatic wrapper generation packages; bespoke extension library; foreign function interface; machine vision extension; Arrays; Complexity theory; Computer languages; Computer vision; Libraries; Syntactics;
Conference_Titel :
Image and Vision Computing New Zealand (IVCNZ), 2013 28th International Conference of
Conference_Location :
Wellington
Print_ISBN :
978-1-4799-0882-0
DOI :
10.1109/IVCNZ.2013.6727013