OpenCV for openFrameworks without the baggage
A wrapper that wants you to graduate to raw OpenCV, not stay dependent on its abstractions.

What it does
ofxCv is an openFrameworks addon that makes OpenCV 2 available without inventing a parallel type system. It provides toCv() and toOf() conversion functions, helper wrappers for common operations, and classes like Calibration—but the core idea is letting you use native OF types (ofImage, ofPixels) alongside native OpenCV Mat objects.
The interesting bit
Most wrappers trap you; this one tries to make itself obsolete. The README explicitly encourages direct OpenCV usage, provides clean internal implementations as “stepping stones,” and uses overloaded names (ofxCv::Canny() vs cv::Canny()) so you can write Canny() and let argument types pick the right path. The imitate() function is a small gem: it lazily allocates buffers matching a prototype’s dimensions, working across Mat, ofImage, ofVideoGrabber, or anything extending ofBaseHasPixels.
Key highlights
- Zero-copy conversion for images via
toCv(); deep copies viaclone()orcopy() drawMat()for quick-and-dirty previewing, with clear guidance on the efficient texture path- Overloaded function names let you migrate from wrappers to native OpenCV gradually
- Explicit namespace usage (
cv::,ofxCv::) documented, including theRect/Pointcollision withMacTypes.hon macOS - Branch-matching required:
stablefor OF 0.9.8,masterfor 0.10.0
Caveats
toCv()can’t always be used inline; non-const reference parameters will fail to compiledrawMat()creates a texture every frame—documented as convenient, not optimal- README warns it may “fall out of date”; examples are the ground truth
Verdict
Worth a look if you’re doing computer vision in openFrameworks and want a smoother on-ramp to OpenCV without committing to ofxCvImage-style abstractions. Skip if you’re already comfortable with cv::Mat and don’t need conversion helpers or the Calibration wrapper.