O'Reilly logo

Mastering openFrameworks: Creative Coding Demystified by Denis Perevalov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using OpenCV functions

OpenCV is a really huge library with hundreds of functions, including optical flow computing, feature detection and matching, and machine learning. Most of these functions are currently not wrapped in the addon ofxOpenCv. You can use these capabilities by calling the OpenCV functions directly, by performing the following steps:

  1. First, in the testApp.h file, add the following line after the line #include "ofxOpenCv.h", which instructs the compiler to use the OpenCV's namespace:
    using namespace cv;
  2. Now you can declare OpenCV's images, which are objects of the type Mat:
    Mat imageCV;
  3. For converting the ofxCv image image into imageCV, call the following function:
    imageCV = Mat( image.getCvImage() );

    Note, this is fast operation that ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required