VideoCapture Read inconsistent speed

asked 2019-03-26 05:52:40 -0600

updated 2019-03-26 06:48:28 -0600

Hello,

I'm running a small high speed c++ program reading frames, checking for IR laser. Program runs at 187FPS (could go higher if so, speed of the program is well above this) I need Millisecond timing of what I'm doing.

The problem I have is that time passed when doing the single code line cap.read(frame) differs. It's either 1-2 ms (most of the time) or it's 12ms, not anything else, not inbetween, it's always 12 when its taking a long time.

This makes my program kind of useless since I cannot know for sure when the last frame was from..

I know the system works if it was not for this issue as I have written for another camera not using opencv and there it works nicely.

Any ideas why this happenening and if there is any workaround?

//Fredrik

edit retag flag offensive close merge delete

Comments

I need Millisecond timing of what I'm doing.

then don't use opencv's VideoCapture class, but your own code. you can easily construct a cv::Mat from your pixels, and use opencv to process it

berak gravatar imageberak ( 2019-03-26 09:22:46 -0600 )edit