0

I have a set of images collected from a drone that I now want to stitch together. The approach I started going towards is to rotate all the images to the proper orientation, then try to stitch those together. However since the rotated images are no longer rectangular, I have large empty areas with no image data. As expected, these dark areas have caused poor stitching results.

I have seen the api for stitch:

Status  stitch (InputArrayOfArrays images, const std::vector< std::vector< Rect > > &rois, OutputArray pano)

I like that there is an "ROI" parameter, however the data type is a "Rect" instead of something like a "RotatedRect" or a mask. So this looks like it won't work either.

The only other approach I can think of is to further crop the image to remove the no-data areas of the image (which would require more images to make up for the lost data).

I am not an expert in OpenCV nor in image stitching, so I'm looking for some awesome ideas. Is there a better way to approach this?

Noremac
  • 3,445
  • 5
  • 34
  • 62
  • you should create a mask by finding all pixels that are non-zero. Then fill the inner-pixels of the mask that are zero by contour extraction and filled-drawing. Then use alpha-blending and give each non-mask pixel alpha value zero. For more detail, please upload two oriented images with that black border, ready to stitch. – Micka Jul 15 '16 at 06:21
  • I can do that later today, but I'm not seeing how I can use a mask with the stitch function call. Can you give me a hint so I have more motivation to do what you ask? – Noremac Jul 15 '16 at 08:33
  • sorry, didnt see that you are using the opencv highlvl stitcher. This won't work there, you'll have to stitch "manually" by 1. registration and transformation computation 2. warping 3. blending. Maybe the stitcher can compute 1 and 2 for you and you just perform 3 manually, not sure... never used the high-lvl stitcher :) – Micka Jul 15 '16 at 09:26
  • Ok, I'm hoping the same thing that I'll just need to do #3 manually. I'll give it a shot. – Noremac Jul 15 '16 at 09:44

0 Answers0