Stitching without Image Transforming

I have IR videos from a drone with very little image distortion or rotation. The video follows small prey (rabbits) and dogs in a field. I am careful not to change the heading or altitude of the drone, and at the height I am using there is no significant distortion. The video is basically orthographic. The background is brush with mowed lanes, so there are no sharp features. I pull the video apart into 0.5 fps images.

I want to stitch them together. When I use cv2.Stitcher.create(cv2.Stitcher_PANORAMA). (I also tried Stitcher_SCANS, too.) It work to a point, about 20 images, then images are stitched in at different rotation angles, so the result is warped, with some misplaced images.

I looked for stitching with image transformation, and the only thing I could come up with is hstack, vstack, and grid. The problem is that the video is following the random movements of prey and dog, so I can’t organize them into a grid.

Question: How can I use Stitcher without a step of rotation, skew, or scale of the images? I just want to slide them horizontally and vertical until they match, then blend.

I am using python3, cv2 version 4.12.0.

that is appropriate.

can you provide a set of data and code that reproduces the issue?

my guess: the images are too featureless for automatic stitching.

you should also expect moving objects (animals) in the pictures to possibly confuse the stitcher. not saying it’s necessarily the case, but it’s a possibility. depends on the data.

Here is an example of a frame. The black is where I have masked out drone information. In the middle grid you can see the white (hot) of a person, a dog (elongated) and a rabbit (a dot). I don’t think those interfere with the stitching because they are a small part of the image. You can see the field has few sharp features that traditional feature extraction would work on.

The stitching works well with some groups of frames, then adding a few more will drastically distort the output.

Works stitching frames 1 - 40

Fails stitching 21 - 60.

Sorry, I am a new user, so I can only attach one media.

Here are the first five overlapping stitches

TC-101325-12_stitched(001-040).jpg

TC-101325-12_stitched(021-060).jpg

The first, works ok. The second has a lot of rotated frames. It went on from there. Some were fine, others a mess.

Perhaps I should dig into how to use stitcher_detail pipeline?

might be a good idea.

all the masked out stuff probably confuses the module. see if you can find a way to pass these masks explicitly. it’s not going to treat “black” to be anything other than regular image content.

you should look for a way get a “clean feed” of the drone view.

also have a look at GitHub - OpenStitching/stitching: A Python package for fast and robust Image Stitching which is based on OpenCV’s stitching module

Thanks. I am working on getting s clean feed right off of the drone instead of the controller.

I’ll look at the link. I am having trouble finding good documentation/tutorials. For example the documentation mentions Stitcher_PANORAMA or Stitcher_SCANS, but I can’t find details of what each flag does in detail.

yes, that is unfortunately a known problem.

besides the API docs (and subpages), there is OpenCV: High level stitching API (Stitcher class), the corresponding sample code, and perhaps some more sample code

the OpenStitching repo and its author might be able to help with some of that.