Panorama stitching video frames for multiple cameras

I have 3 cameras that are fixed in place – they cannot move. I’m currently using cv::Stitcher to create a panorama image from the 3 camera mats.

This works great so far, except:

  1. I suspect it is much slower than it has to be, since at every video frame I have to re-calculate everything necessary to stitch the frames.
  2. The stitching results differs slightly from one video frame to the next. This causes the output mat size to be quite different, and causes things to move around between frames, preventing me from using the resulting image to output a new video file.

I suspect this is a common issue when it comes to stitching video frames, and that if I calculate everything needed once for stitching and cache those results, I can then re-use those same calculations throughout the entire video and hopefully solve both problems at once.

Am I thinking about this correctly? Can someone point me in the right direction?

Hi may be you can try Traitement_d-images_et_de_videos_avec_OpenCV4_en_Python/panorama.py at master · D-BookeR/Traitement_d-images_et_de_videos_avec_OpenCV4_en_Python · GitHub