isFrameNew should be new

Hi all,

Me and a couple of other guys are working on some computer vision for tracking balls on a pool table using IR-light. In the effort of getting as good a input as possible, we acquired a PS3 Eye cam that runs up to 180 fps (this is configured from the settings dialog).

The camera works splendidly, the output image is great with only very little blur on images with fast movements.

We’ve however encountered a problem that was a little surprising to us. When grabbing the frame, isFrameNew only returns around 30 times per second.

Its called here:

  
void testApp::update(){  
	  
    vidGrabber.grabFrame();  
    // HERE IS THE FPS around 1000  
	  
    if (vidGrabber.isFrameNew()){  
	     // HERE IS THE FPS around 30  
	    processImage();  
    }  
}  

This code was what we used to calculate the framerate:

  
// fps calculation:  
timeNow = ofGetElapsedTimef();  
double diff = timeNow-timeThen;  
if( diff  > 0.0f ) {  
	fps = 1.0 / diff;  
	frameRate *= 0.9f;  
	frameRate += 0.1f*fps;  
}  
timeThen = timeNow;  

Is there a good reason to, why the camera apparently doesn’t deliver more that 30fps, when its actually recording 180fps?

Thanks in advance,
Jonas

OpenFrameworks’ videoInput uses DirectShow on Windows. I’m assuming you’re using Windows since I haven’t seen anyone on other platforms mention 180 fps yet.

The PS3Eye DirectShow driver only runs at 125 fps http://codelaboratories.com/products/eye/driver/

If you want to get the full 187 fps you’ll need to write code against the CL-Eye API directly rather than using videoInput.

Disclaimer: I haven’t done anything >120 fps with OF yet :slight_smile:

Hi kylemcdonald,

Sorry for the late reply. No I’m not at windows, I’m on mac :frowning:

I haven’t used maccam unfortunately… it looks like this is a known issue http://nuigroup.com/forums/viewthread/6444/ So I would recommend posting on maccam forums.

the problem is not in openFrameworks. looks like the problem is the driver, like kyle mentioned.

tried this on linux with driver from here http://bear24rw.blogspot.com/2009/11/ps-…-patch.html and your calculation for the fps.

i get 320x240@125fps!

The problem seemed to be a mix of the driver, and the fact that we got fooled by the processor requirements of our own algorithm.

Thank you for the feedback, benben and kyle!