Ask Your Question

Revision history [back]

Raspberry Pi video tracking performance is slow

Hello!

I've been working on a sentry gun project I found on youtube a while back, and I've run into a huge issue. Code I'm using can be found here: https://github.com/atainter/Tracking-Turret/blob/master/turret.py

When nothing is moving in front of the camera, the framerate is good (20+ FPS), but when I move my hand in front of the camera, and it detects it (and draws a bounding box around it) the framerate drops to something like 1 frame per 2 seconds. On the YouTube video itself: https://youtu.be/HoRPWUl_sF8?t=33m57s it shows their turret running at a reasonably high framerate (15+ FPS). The RPi has to process each frame that the camera sends to it, and from the information on the frame, sends a command to the motors on the turret. The problem I have with the framerate is that if its running at 1 frame every 3 seconds then my turret is practically useless because its making one small adjustment every 3 seconds. I'm running OpenCV 3.1.0. Might upgrading OpenCV solve this issue?