Ruby Bindings for OpenCV (ropencv)
Unlike other OpenCV ruby binding projects like
ruby-opencv
oropencv-ffi
this binding is automatically generated by parsing the OpenCV C++ headers. - D-Alex/ropencv
Install
- Install opencv librairies
- tested with 4.5.4 / releases / release notes
- Install Ruby - no need to
sudo
using rbenv - prerequesite
sudo apt-get install ruby-dev
- needed to compile native gem- set a default python
update-alternatives --install /usr/bin/python python /usr/bin/python3 1
- it will be used to parse the c++ export define for python binding, and recreate the interface for ruby binding
gem install ropencv
The last command will pick the opencv version installed and build binding to it.
Test installation
Test some opencv call in ruby
Known issue
see also
- How OpenCV-Python bindings are generated? - OpenCV generates these wrapper functions automatically from the C++ headers using some Python scripts which are located in modules/python/src2.
- D-Alex/rbind - automatically genereating ffi-bindings for c/c++ libraries
Written on June 3, 2017, Last update on March 11, 2023
ruby
opencv