I need a command-line tool that can take 2 or 3 videos (mpeg/h.264), stitch them together into a single panoramic video, then draw a frame around every moving object in the panorama and output a separate video for each object, so that it appears as if each object had a panning & tilting camera following them.
For example, imagine three stationary cameras pointed at a race track where multiple cars are driving past, from left to right, over the course of 30 seconds. The cameras have overlapping fields of view; camera #1 on the left has a slight overlap with camera #2 in the middle, which has a slight overlap with camera #3 on the right. I need a panorama to be created from the video files created by each camera, and then for each car that drives by I want to draw a frame around that car as it moves through the panorama. So if 10 cars all drove in front of my three cameras, I would have 10 different output videos, one for each car, and it would look as if a panning/tilting camera was focused on each car the whole time.
The program should use OpenCV and can be written in the language you're most comfortable with (python, C++, C# preferred). It should take as inputs either two or three video files (i.e., it should work with two or three adjacent cameras) as well as an optional input file containing homographies for the cameras (one homography for a pair of cameras, or two homographies for a trio of cameras). I would also like to have input parameters to define the size of the frame to draw around each moving object, as well as the sensitivity of the motion detector. The panorama should follow the general OpenCV image stitching pipeline and include wave correction and blending to remove seams.
There should be a separate output video for every moving object that was detected in the panorama. If no homography file was included, the homographies should be calculated and saved in a file for future use. You can assume that the videos are all synchronized within a frame, and all have the same framerate (30 fps). Performance is important but this will NOT be running in real-time; video quality is more important than processing speed.
I can provide sample footage as needed.