ofxCvPiCam is a minimal grabber for the Raspberry Pi Camera module. It uses the MMAL interface to grab frames and convert them the cv::Mat type which can be processed using the typical opencv calls.
Switch branches/tags
Nothing to show
Clone or download
Latest commit 7e8af0a Jul 28, 2016
Permalink
Failed to load latest commit information.
example-ofxCvPiCam-allSettings addded simpler colour handling,settings and more examples Apr 10, 2014
example-ofxCvPiCam-calibration added calibration Apr 13, 2014
example-ofxCvPiCam-contours-advanced addded simpler colour handling,settings and more examples Apr 10, 2014
example-ofxCvPiCam-contours-basic addded simpler colour handling,settings and more examples Apr 10, 2014
example-ofxCvPiCam-edge addded simpler colour handling,settings and more examples Apr 10, 2014
example-ofxCvPiCam-face-follow use ofxCv ObjectFinder update method Apr 12, 2014
example-ofxCvPiCam-face-zoom use ofxCv ObjectFinder update method Apr 12, 2014
example-ofxCvPiCam-face use ofxCv ObjectFinder update method Apr 12, 2014
example-ofxCvPiCam-flow-distort added flow and undistortion examples Apr 13, 2014
example-ofxCvPiCam-flow-keypoints added flow and undistortion examples Apr 13, 2014
example-ofxCvPiCam-flow added flow and undistortion examples Apr 13, 2014
example-ofxCvPiCam-threshold addded simpler colour handling,settings and more examples Apr 10, 2014
example-ofxCvPiCam-undistortion added flow and undistortion examples Apr 13, 2014
example-ofxCvPiCam addded simpler colour handling,settings and more examples Apr 10, 2014
example-ofxCvPiCamSimple added example Apr 2, 2014
libs/mmal/src/interface addded simpler colour handling,settings and more examples Apr 10, 2014
src fix missing definition Oct 4, 2015
addon_config.mk added files Apr 2, 2014
license.md added files Apr 2, 2014
ofxaddons_thumbnail.png added files Apr 2, 2014
readme.md use ofxCv ObjectFinder update method Apr 12, 2014

readme.md

Introduction

ofxCvPiCam is a minimal grabber for the Raspberry Pi Camera module. It uses the MMAL interface to grab frames and convert them the cv::Mat type which can be processed using the typical opencv calls.

I warmly recommend using Kyle McDonalds' ofxCv addon: it makes writing modern opencv code so much easier. The examples included uses ofxCv's drawMat() to display cv::Mat objects in OpenFrameworks. You can of course use your prefered method. In fact, excluding example-ofxCvPiCam and example-ofxCvPiCam-allSettings, examples are from ofxCv

Since this addon is intended for computer vision, you'll get the best results with the grayscale image (which you will need most of the time). If you simply want to use the Pi Camera module in OpenFrameworks without any computer vision please use Jason van Cleave's ofxRPiCameraVideoGrabber addon (GPU accelerated using OMX)

Installation

Either clone out the source code using git:

> cd openFrameworks/addons/
> git clone https://github.com/orgicus/ofxCvPiCam.git

Or download the source from GitHub here, unzip the folder, rename it from ofxCvPiCam-master to ofxCvPiCam and place it in your openFrameworks/addons folder.

Working with ofxCvPiCam

First initialize the grabber by passing the width,height and color mode(boolean: color = true, grayscale = false). Use the grab() method fetch a cv::Mat frame then carry on processing it

Note sometimes frames can be skipped so it's best to check if the returned matrix is not empty.

Credits

This wrapper is mostly done by putting together the work of

Samarth Manoj Brahmbhatt, University of Pennsyalvania -> cv::Mat wrapper listed in his book: Practical OpenCV

Jason Van Cleave -> captureApplication mmal openframeworks demo

Developed at Hirsch&Mann

ofxCvPiCam threhshold ofxCvPiCam settings ofxCvPiCam faces