Issues with Raspberry Pi 4 OpenCV

asked 2019-08-05 20:59:08 -0500

I have been using OpenVINO + NCS2 on a raspberry Pi 3b+ with no issues for an IP camera security application (object detection). I then upgraded to Pi 4 looking for better performances. The object identification is actually faster on the Pi 4 but I am having issues with OpenCV acquiring the IP camera stream. In my code in python I have a thread for acquiring the frames (every 0.x seconds, aligned to the NCS2 performance) but while the same code (even from the same SD card) works on the Pi 3B+ it instead creates lags in the Pi 4, and the grab() or read() eventually become unresponsive when the buffer grows too much. I isolated the issue to the fact that while in the Pi 3B+ the frames I don't use are discarded quickly (using grab()), with the Pi 4 even just repeated grab()s take too long (specifically 80ms when the frame rate is 20 FPS on a 640x480 video stream, so each second of realtime video take 1600ms to be grabbed, this even if I disable any other activity). Anybody having similar issues? I tried both Gstreamer and ffmpeg backends with similar results.

I am using OpenCV 4.1.1-openvino (already built as downloaded from OpenVINO website)

edit retag flag offensive close merge delete