ofxVideoGrabberPtgrey (or Point Grey cameras on new Windows systems in general)

Hi, everyone! I’m not exactly sure where this question should go, so I’m going to post it here until someone points me in the right direction?

I’m trying to use the ofxVideoGrabberPtgrey extension (found at https://code.google.com/p/ofxvideograbberptgrey/) to get my Point Grey camera to work with OpenFrameworks 0072 on Windows 7. I’m using Code::Blocks 10.05, not that that should make a difference. Anyway, I’ve got the linking working, but I guess the ofxVideoGrabberPtgrey extension is fairly old, and it doesn’t seem to implement the right things for the new version of OpenFrameworks. Below is what I see when I try to compile code (all I’ve done is take the example videograbber code and replace the videograbber with a videograbberptgrey):

  
Compiling: src\main.cpp  
In file included from C:\Users\Valkyrie\projects\libraries\openframeworks\examples\video\videoGrabberExample\src\main.cpp:2:  
C:\Users\Valkyrie\projects\libraries\openframeworks\examples\video\videoGrabberExample\src\testApp.h:22:  
error: cannot declare field 'testApp::vidGrabber' to be of abstract type 'ofxVideoGrabberPtgrey' ..\..\..\addons\ofxVideoGrabberPtgrey\src/ofxVideoGrabberFlyCapture.h:15:  
note:   because the following virtual functions are pure within 'ofxVideoGrabberPtgrey': ..\..\..\libs\openFrameworks\types/ofBaseTypes.h:99:  
note: 	ofPixels_<PixelType>& ofBaseHasPixels_<T>::getPixelsRef() [with T = unsigned char]  

Has anyone had success with this library? I am pretty new to C++ and brand new to OpenFrameworks. I didn’t really find any resolutions to questions about using Point Grey cameras with the new versions of Windows, Code::Blocks, or OpenFrameworks (all the results I’m finding where people had success with the Point Grey cameras in the OFX fora are from ~3 years ago). Any pushes in the right direction would be helpful.

Thanks!

I ran into this same error on Linux and was able to work around it. This was with a recent GigaE Blackfly. Hopefully when I get a moment I can document how. But in case I forget the steps involved…

  1. Changing the ofxVideoGrabberPtgrey. to default to the FlyCapture header rather than the dc1394.
  2. moving entirely from the example codeblocks project into a project I created from scratch using the OF ‘projectGenerator’.
  3. Creating a addon_config.mk for the ofxVideoGrabberPtygrey addon and setting it so that it ignores the libs/FlyCapture directory it came with and instead loads the includes from /usr/lib/flycapture (the pointgrey installed sdk location).
  4. Modify ofxVideoGrabberFlyCapture.cpp/.h to reference getPixelsRef. This is the reason for the error you ran into.
  5. Modified ofxVideoGrabberFlyCapture.cpp and commented out all of the camera settings changes (leaving with the standard defaults).

from addon_config.mk

linux64:
    ADDON_SOURCES_EXCLUDE += src/ofxVideoGrabberDc1394.cpp
    ADDON_INCLUDES_EXCLUDE += libs/FlyCapture/%
    ADDON_INCLUDES += src
    ADDON_CFLAGS = -I/usr/include/flycapture
    ADDON_LDFLAGS = -lflycapture

From addons/ofxVideoGrabberPtgrey/src/ofxVideGrabberPtgrey.h

#if defined( TARGET_OSX ) || defined( TARGET_LINUX )
#include "ofxVideoGrabberFlyCapture.h"
//#include "ofxVideoGrabberDc1394.h"
#elif defined( TARGET_WIN32 )
#include "ofxVideoGrabberFlyCapture.h"
#endif

to ofxVideoGrabberFlyCapture.h:

ofPixels & getPixelsRef();

to ofxVideoGrabberFlyCapture.cpp

ofPixels & ofxVideoGrabberPtgrey::getPixelsRef(){
    // return videoPixels;
}

FYI to use on OSX…

(items I’m not certain were essential have * at end)

  • brew install libdc1394
  • add /usr/local/include to xcode headers search path *
  • add addons/ofxVideoGrabberPtgrey sources to xcode items. Be sure to add ofxVideoGrabberDc1394.cpp to projects target build phase so it is compiled on build
  • add the lib/osx/libdc1394.a found in the addons lib dir to the project target build phase
  • modify the ofxVideoGrabberDc1394.cpp/.h to include
    the getPixelsRef() stub as shown above for the Linux instructions

Currently this compiles and shows a frame but it is unable to detect the GigE camera. If has a solution for getting libdc1394 to work with GigE cameras please point me in the right direction. The Pointgrey site indicates libdc1394 supports GigE but some mailinglist posts on the dc1394 mailinglist differ

Hi guys, has somebody been able at the end to display a video with OpenFrameworks and Flea3 camera on Mac?