I installed OpenCV libraries in raspberry pi for my project "Air Hockey Robot" and I'm using python for video processing. I am using PS3 eye camera for video capture at 60 fps. But it seems that video processing is too much slow. Should I use multi-threading or that's the general problem with Raspberry Pi 3?


Honestly, I don't think 60 fps is achievable, even on a Pi 3. While the Pi 3 is fast for a Raspberry Pi, the processor is still only 1.2 GHz. That said, you could do a few things to help and see if it is achievable with some optimisation; OpenCV itself is in C++ which won't experience such large performance problems as Python does.

You can check to see what the cause of your largest delays are using a profiler like cProfile for Python; this would help you to determine which of your functions are taking the longest, and which you should focus on optimising.

You could consider using a lower frame rate instead which could increase your processing time per frame, or experiment to see if multithreading helps. Python is often a little bit problematic to thread due to the general interpreter lock which prevents two threads of the interpreter from running simultaneously.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.