-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Mastering openFrameworks: Creative Coding Demystified
By :
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:
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;
Now you can declare OpenCV's images, which are objects of the type Mat:
Mat imageCV;
For converting the ofxCv image image into imageCV, call the following function:
imageCV = Mat( image.getCvImage() );
Note, this is fast operation that does not involve copying of data. imageCV and image will share the same memory region with pixel values. So, we would suggest only using imageCV for reading and not for changing.
We do not suggest the use of the setNativeScale() function for images...
Change the font size
Change margin width
Change background colour