The core opencv-ffi library4 represents a “pure” mapping of OpenCV functions and primitives into
Ruby through FFI. It does contain some syntactic sugar for cases where the FFI syntax is awkward, e.g., creating and dereferencing pointers-to-pointers. This library allows the creation of Ruby scripts which appears quite similar to the equivalent OpenCV C programs. This layer provides the most control over code performance as it retains the strongly typed core OpenCV primitives, without transparent translation.