What state is ofxSpinnaker in?


#1

@elliotwoods
Hi Elliot.
It interesting to see that you started working on a spinnaker implementation.
Is it working?
Do you think it would work for this camera since it is listed to use Spinnaker SKD?

What’s your general experience in OF with it; speed, frame size, fps, etc?

thanks,
stephan.


#2

It’s likely to work.
I used ofxSpinnaker for a stereo tracking system
2 cameras, each 1280x800 @ 60Hz on one system (synced)

It ran very stable

Note this is built on top of ofxMachineVision, so you’ll need to get familiar with that. That handles all the threading, frame pooling, parameters, etc etc

The only thing is that I probably built ofxSpinnaker as a DLL plugin for to use with the ofxMachineVision external plugin framework. You don’t need to do that (if can be a bit crazy using the plugin approach).


#3

Thanks for the fast reply.
I hope to get my hands on the camera tomorrow and will give it a try.

I mainly use OS X so I am not sure if visual studio gives me the option to build for DLL or not.
I will just hit compile and see what happens :slight_smile:


#4

for which OF version are ofxMachineVision and ofSpinnaker build?
trying it with 0.9.8 and get a whole bunch of build error.
I also see files are still named testApp.h which must mean it’s 0.8.x?

I’m trying to simply build the simpleCamera example in ofxMachineVision.
but it needs ofxUVC, which needs ofxYML, also ofPlugin, ofxSingelton and ofxLiquidEvent.
i.e. not compiling for now.

would you happen to have an example for ofxSpinnaker, one that is not a ofxSpinnakerLib, but with a nice main.cpp, ofApp.cpp and ofApp.h file ?

sorry for all these questions.
but the promise of using those nice cameras is just too tempting.


#5

You can rip out ofxUVC from the equation
But you’ll need liquidevent, plugin, Singleton


#6

I’m not using 10.0, i’m still on late 0.9.8 or something like that
i just haven’t renamed any testApp’s in the time being.

example would be like:

#include "ofxSpinnaker.h"
class ofApp {
...
ofxMachineVision::SimpleGrabber<ofxMachineVision::Device::Spinnaker> camera;

}
setup() {
    camera.open();
    camera.startCapture();
}

update() {
    camera.update();
}

draw() {
    camera.draw(0, 0);
}

the concept of ofxMachineVision is that it completely abstracts away the idiosyncrasies of the camera driver from your application. It works with Canon EDSDK, Ximea, IDS UEye, Point Grey/FLIR Spinnaker, VideoInput, UVC Capture, BlackMagic, Still Images, Video Files, Null Device, Kinect RGB camera, and a couple more I can’t remember right now

so for each camera driver you just right a very thin class which describes the camera to ofxMachineVision, then ofxMachineVision does all the boilerplate code for you. This is supposed to mean you’re getting the best implementation of a threading camera class or whatever, and at the same time all that boilerplate (including the examples) are all in one code base.

Using the Factory model (and plugins if you like), it’s then also possible to list all devices of all types attached to the system, and switch between them.


#7

Hi guys!

I’ve tried to compile it (with VS2015 & OF0.9.8) but some issues there :confused:
I’ve posted my errors and steps here -> issues ofxMachineVision Github.


#8

Hi :slight_smile: !
Anyone wanna try the addon? Just the simple exaple with the webcam devide. I’m curious of what I’m doing wrong or if there is something missing.
Cheers!


#9

@charli_e

I also try “ofxMachine” & “ofxSpinnaker” but it doesn’t work. so i try write my own code with this wrapper(https://github.com/zimpha/spinnaker-wrapper), works fine.


#10

I gave it a shot in OF 1.0 and after changing few lines it worked.

But I dont have a FLIR camera to test…


#11

Hi,
I’ve also added a fork ( including the fix discovered by @Jordi) in case somebody else wants to try it in the 0.9.8. Include one example of Spinnaker working with VS2015 ( thanks to @elliotwoods to help me to build the libraries working ). Check this issue for more info.


#12

Btw, I’m wondering if there is a huge difference in terms of image quality between this 2 cameras:


#13

It probably makes sense to put questions related to camera recommendations into a separate thread.

Also it’s good to put up a sketch of what you’re trying to do, as different cameras have different strengths in different scenarios.


#14

Did anyone have any luck with this. I am trying with a blackfly. I have everything compiling, but I dont get any image. I would expect I needed to give an IP address or serial number.

I have only this code

ofApp.h

	#pragma once

#include "ofMain.h"
#include "ofxSpinnaker.h"
#include "ofxMachineVision.h"

class ofApp : public ofBaseApp{

	public:
		void setup();
		void update();
		void draw();

		void keyPressed(int key);
		void keyReleased(int key);
		void mouseMoved(int x, int y );
		void mouseDragged(int x, int y, int button);
		void mousePressed(int x, int y, int button);
		void mouseReleased(int x, int y, int button);
		void mouseEntered(int x, int y);
		void mouseExited(int x, int y);
		void windowResized(int w, int h);
		void dragEvent(ofDragInfo dragInfo);
		void gotMessage(ofMessage msg);

		ofxMachineVision::SimpleGrabber<ofxMachineVision::Device::Spinnaker> camera;
};

And ofApp.cpp:


#include "ofApp.h"

//--------------------------------------------------------------
void ofApp::setup(){


	ofSetLogLevel(OF_LOG_VERBOSE);
	
	if (camera.getIsDeviceExists())
	{
		cout << "device exists" << endl;
		cout << ofToString(camera.getManufacturer())<< endl;
		camera.open();
	}
	if (camera.getIsDeviceOpen())
	{
		camera.startCapture();
		cout << "device started capture" << endl;

	}
}

//--------------------------------------------------------------
void ofApp::update(){
	if (camera.getIsDeviceOpen())
	{
		camera.update();
	}
}

//--------------------------------------------------------------
void ofApp::draw(){
	if (camera.getIsDeviceOpen())
	{
		camera.draw(0, 0);
	}
}

and this is the console when I try launch the app

[ error ] ofxMachineVision::Grabber::Simple::stopCapture:  Method cannot be called whilst device is not open
device exists

[ error ] ofxMachineVision::Grabber::Simple::stopCapture:  Method cannot be called whilst device is not open
[ error ] ofxMachineVision: Couldn't open device : Spinnaker: NULL pointer dereferenced. [-1015]
[ error ] ofxMachineVision::Grabber::Simple::stopCapture:  Method cannot be called whilst device is not open
[ error ] ofxMachineVision::Grabber::Simple::open: Failed to open device

Any hints? I am on vs2017 and of 0.10, I have update the targets for all the solutions and everything is compiling fine…


#15

Hi @fresla,
I had same issue. I’ve thought I could fix it adding some settings parameters.

I’ve got them working with ofxFlyCapture, but because for my project was better capture first via TouchDesigner (TD recently added flyCapture & spinnaker) I use camera (via flycapture component) texture via Spout.


#16

Same problem here, I was able to make it all compile with some tweaks under vs2010 and of0.10 but something is wrong. The camera is actually acquiring images and the status light is correct but the texture is not allocated


#17

Have you checked the pixel format? I was getting back pixels in PixelFormat_BayerRG8 which was not accounted for when converting to OF pixels.


#18

Do you have spinnaker working? If so with what version of OF?


#19

Yeah but I’m not sure how!

I’m using this fork with the spinnaker example.


#20

You were right ! Thank you so much ! BayerRG8 was the default of my cam.

Thank you !