Challenge: I want to run three USB cameras 1600x1300@ 60 fps on a jetson Xavier NX using python. Now there are some ways of doing this but my approach has been:
Main -> Camera1 Thread -> Memory 1 -> Visualization thread 1.
The main starts up three Camera threads and three visualizations. The problem is the latency. I store the images from camera 1 in Memory 1 which is shared with the visualization thread. There are thread-lock on both the memory and cv2.imshow in the visualization thread.
- Is there a way of speeding up the camera visualization. I get about 16fps. Is it better to have 1 visualization thread showing all three images in one view or as I have now, three separate.
The input capture is:
cv2.VideoCapture(Gstreamer_string, cv2.CAP_GSTREAMER)
The output to disc with the Gstreamer string is by branching the stream to a multifilesink and an appsink. The file-sink writes all three at 60FPS. Its just the visualization on screen that takes for-ever.
I have tried also to visualize directly after the capture in the camera thread, without the memory, not much difference. I have a tendency to think that the imshow thread-lock I need in order not to crash/freeze the GUI is the reason. Perhaps combining all three into one is faster.