OpenCV GLib is a wrapper library for OpenCV. OpenCV GLib provides C API.
OpenCV GLib supports GObject Introspection. It means that you can create language bindings at runtime or compile time.
For example, you can use OpenCV from Ruby by OpenCV GLib and gobject-introspection gem with the following code:
# Generate bindings at runtime
require "gi"
CV = GI.load("CV")
# TODO
You can use packages or build by yourself to install OpenCV GLib. It's recommended that you use packages.
You can install packages from https://packages.red-data-tools.org/ . See https://github.com/red-data-tools/packages.red-data-tools.org#readme for details.
OpenCV GLib users should use released source archive to build OpenCV GLib:
% OPENCV_GLIB_VERSION=1.0.0
% wget https://github.com/red-data-tools/opencv-glib/releases/download/${OPENCV_GLIB_VERSION}/opencv-glib-${OPENCV_GLIB_VERSION}.tar.gz
% tar xf opencv-glib-${OPENCV_GLIB_VERSION}.tar.gz
% cd opencv-glib-${OPENCV_GLIB_VERSION}
You need to install the followings before you install OpenCV GLib:
You can build and install OpenCV GLib after you install them:
% mkdir -p build
% meson build --buildtype=release
% (cd build && ninja)
% (cd build && sudo ninja install)
You need to install the followings before you install OpenCV GLib:
You can install them by the followings:
On Debian GNU/Linux or Ubuntu:
% sudo apt install -y -V meson ninja-build gtk-doc-tools libgirepository1.0-dev
On Fedora:
sudo dnf install -y meson ninja-build gtk-doc gobject-introspection-devel
On CentOS 7 or later:
% sudo yum install -y gtk-doc gobject-introspection-devel
% sudo pip install -y meson ninja
On macOS with Homebrew:
% brew install -y gtk-doc gobject-introspection meson ninja
You can build and install OpenCV GLib after you install them:
% mkdir -p build
% meson build -Dgtk_doc=true
% (cd build && ninja)
% (cd build && sudo ninja install)
TODO
You can find API reference in the
/usr/local/share/gtk-doc/html/opencv-glib/
directory. If you
specify --prefix
to configure
, the directory will be different.
TODO: Examples
TODO
The 3-Clause BSD license. See LICENSE for details.
(Kouhei Sutou has a right to change the license including contributed patches.)