Why is there a delay when using opencv to call CSI cameras to deploy real-time object detection algorithms?

hello user116921,

because it need internal process to convert the CSI camera sources formats as OpenCV’s input format, and, there’s process time for the object detection algorithms.

Is there any way to reduce this part of the delay?

hello user116921,

had you tried using nvpmodel GUI to modify the power mode as maximum performance mode for testing.
what’s the camera resolution and frame-rates? you could also lower the resolution and reduce frame-rate for testing.
please share the background for reference, for example, which JetPack release you’re using?
you may also share the current latency, thanks

I’m already using 10w mode, the camera is CSI219, and the jetpack version is 4.5.1

please see-also GitHub - amirhosseinh77/JetsonYolo: Simple process for camera installation, software and hardware setup, and object detection using Yolov5 and openCV on NVIDIA Jetson Nano.. it was achieved 12-fps.

Hello, I just tried this method, there will still be a certain delay

hello user116921,

you never mention what’s the delay you seen. please profile the frames and share the results.

For example, the time you display on your phone is 48s, but the time you see through camera plus recognition algorithm processing is 47s.

hello user116921,

is that capture-to-display latency you’re talking about?
for example,
are you having your camera target the stopwatch, and checking the timestamp difference on the display monitor to evaluate the latency?

This is the display delay

hello user116921,

it’s reasonable results with 130-180ms for capture-do-display latency, it’ll increasing if you’ve post-processing executed.
please check this commands to enable camera preview frames, $ gst-launch-1.0 nvarguscamerasrc sensor-id=0 ! 'video/x-raw(memory:NVMM),width=1920, height=1080, framerate=30/1, format=NV12' ! nvoverlaysink -ev

There is no delay in doing so

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.