Can desktop Java provide more than 16 FPS?
I'm testing USB camera Logitech WebCam500 over Java API, Windows 7 x64, 4 core processor at 3 GHz. Measured frame per second rate is 12-16, no more. Resolution 320x240, 640x480 or 1280x1024, no real difference by this parameter. Reading of frames goes in infinite cycle, with no real delay, by calling CamController.capture() there. Profiler shows almost all the time is spent in org.opencv.highgui.VideoCapture.read(Mat). Windows TaskManager indicates pretty low 1-3-5-9% total load. Peaks of 9% were noticed only for 1280x1024. I went to conclusion that read(Mat) simply stands in Object.wait(timeout) to provide "stable" max FPS=16. Is that true? Is there any way to unleash FPS? Some guys here report they achieve 30 FPS. It could be fine for me, but I have no idea how to reach it.
OpenCV v.2.4.10.
Below is excerpt from the code:
public CamController( int id )
{
videocapture = new VideoCapture( 0 );
matCam = new Mat();
}
public byte[] capture()
{
if( videocapture.read( matCam ) )
{
matCam.get( 0, 0, out );
return out;
}
return null;
}
A simple explanation can be read here. Your camera is simply configured to output HD frames at 15FPS, which seems real time to peoples brain. If you want to increase it than you will have to set the properties of the cameras so that it actually allows you to read 30 FPS.