I want to use jetson inference for object detection and some OpenCV functions.
First of all, I use jetson.inference.gstCamera and CaptureRGBA() method to get my image.
Then, I want to ask user to define a ROI by clicking on an image, so I get a first image with CaptureRGBA(), then I would like to use OpenCV Mouse event function to display an image and ask the user to click on it.
My problem is the image I try to display is blank. But when I use the same image with method net.Detect() and jeston.utils.glDisplay().RenderOnce(), the image is correct.
Here my code :
net = jetson.inference.detectNet("ssd-mobilenet-v2", threshold=0.5) camera = jetson.utils.gstCamera(1280, 720, "0") display = jetson.utils.glDisplay() imgFromCamera, width, height = camera.CaptureRGBA(zeroCopy=1) img = jetson.utils.cudaToNumpy(imgFromCamera, width, height, 4) cv2.imshow("image", img)
With that code, I get a white image in my opencv show window.
I try the function cv2.cvtColor(img, cv2.COLOR_RGBA2RGB) or with cv2.COLOR_RGBA2GRAY), I always have the same result.
Can anyone help me ?