multiple camera stitch in detectnet-camera

If I were using opencv, I could just load multiple streams,
capLeft= VideoStream(src=0).start()
then grab the frames
frameLeft =
frameRight =
and stitch together
vis = np.concatenate((frameLeft,frameRight),axis=1)

In, I can grab multiple cameras by varying
camera = jetson.utils.gstCamera(opt.width, opt.height,
but how do I stitch them together in img before feeding it to net.Detect?


Since you are using OpenCV interface, you can check if this function can meet your requirement directly.


  1. I am not looking for smart stitching, as I am using more than 2 cameras and smart stitching starts to get confused after two.
  2. I tried to feed a cv2 “frame” to the (eg net.classify) Nvidia example, but it seems to need more than image values:

Traceback (most recent call last):
File “”, line 59, in
class_idx, confidence = net.Classify(frame, width, height)
Exception: jetson.inference – imageNet.Classify() failed to get image pointer from PyCapsule container

  1. I am working with python, not c++

Really I just need to know how to concatenate multiple nvidia images :
img1, width1, height1 = camera1.CaptureRGBA()
img2, width2, height2 = camera2.CaptureRGBA()

into one


This will require some update for the script.

After getting the image from camera, you can try to concatenate the image together.
And update the width/height (depends on how you stitch the images) for the inference: