Ask Your Question

Revision history [back]

Basically it is normal that adding more functionality, and thus requiring more computational time, will increase the time between each framegrab and thus reduce the FPS.

I suggest trying the following:

  1. Start by compiling in release and not in debug. It removes tons of overhead and unneccesary checks once you know the function is working correctly.
  2. Try using GPU enabled counterparts of the functions. You will need to build openCV with CUDA or OpenCL support for that, but it works expecially well for larger images due to block processing.
  3. You are limiting your capture speed to 30 FPS, which I think is pretty low for an industrial cam.Most of them go easily to 60 FPS. Make sure it is enabled at the highest speed possible.
  4. Just don't expect that a combo of object tracking and detection will run at like 30 FPS. We have complete PhD studies about these problems, which all reach about 25FPS with tons of optimalisations.
  5. Last but not least, if you have a multicore system, this might be the good time to consider using threads and pushing threads to different cores to reduce the calculation time. However this is a step further and does require a good knowledge on parallelization.