cudaToNumpy -> cv2.imshow not responding, no video output, no Error - csi camera

OK, I did a test, and what I found is that if there is no call to cv2.waitKey(), then cv.imshow() never shows a window. However if you just do cv2.waitKey(1), it returns almost immediately (in 1ms), without actually waiting for user to press a key.

This camera test works for me:

import cv2

import jetson.inference
import jetson.utils

input_stream = jetson.utils.videoSource("csi://0")

while True:
	cuda_img = input_stream.Capture()
	jetson.utils.cudaDeviceSynchronize()
	print(cuda_img)
	cv_img_rgb = jetson.utils.cudaToNumpy(cuda_img)
	cv_img_bgr = cv2.cvtColor(cv_img_rgb, cv2.COLOR_RGB2BGR)
	cv2.imshow("Video Feed", cv_img_bgr)
	cv2.waitKey(1)
1 Like