I have previously tinkered with images using OpenCV (like cropping an image, change to gray scale or draw squares and texts), but I am still new to jetson.utils.gstCamera.
Are there any ways to
crop img, from the image obtained from:
camera = jetson.utils.gstCamera(1280,720,‘/dev/video0’)
img, width, height = camera.CaptureRGBA()
I have tried img=img[x1:x2,y1:y2] but doesn’t work. Is it related to CUDA images?
is there any way to convert them to a format that can be handled using OpenCV commands?
draw a square or text similar to cv2 commands
cv2.rectangles(image,point1,point2,color,thickness)
cv2.putText(image,text,point,font,…)
Any help would be greatly appreciated
Thank you in advance
Hi,
We suggest check the source code gstCamera.pp in
Around line #144, you can see it is to launch a gstreamer pipeline. For customization, you can leverage gstreamer plugins. Please check gstreamer user guide. For doing crpping/scaling/format conversion, you can use nvvidconv plugin.
If your usecase is to run deep learning inference, suggest you check DeepStream SDK.
@skillet, instead of using gstCamera directly, I would recommend migrating to using the newer videoSource API from jetson-inference - see here for more info:
There are some Python CUDA-based functions available for cropping, color conversion, resizing, ect that you can see used in the cuda-examples.py sample. For more info, see here:
Follow up!
It worked great!! Managed to crop the image and perform a simple test!
I really would not have managed that without your help.
Thanks a LOT!