Aligning multiple images into one image?

What is a good way to combine images that can have different rotations, exposures, etc., but have the same background or other fixed link?

Adobe Photoshop can do this using the Photomerge function.

How can I do this programmatically? Is there an open source application that does this?

+4
source share
2 answers

You want to find image stitching or image registration , as these are the names that it is also known. This wikipedia article contains helpful information. But I only know commercial libraries that do this, and not any open source.

The main outline of the process (in the commercial library that I know of):

  • First you need to specify a rough alignment of the images, i.e.
    • Image A is located to the left of image B and they overlap by less than 10%.
    • Image C is to the right of image B and overlaps by 10-20%, etc.
  • Based on the parameters in 1), the algorithm will try to find a unique "pattern" in overlapping areas. He will then use the pattern matching to find the pattern in each of the two overlapping images.
  • Paragraph 2) can be repeated several times to give a number of matching places, which can then be used to provide an accurate fit.

In step 3, you can also take into account distortion, such as rotation and distortion of the lens. But in order to allow changes in color step 2, one would have to be more advanced (i.e. not only at the pixel level in shades of gray).

Here's a function request to add this functionality to the AForge library , but at the moment this has not been done, and I do not know the current status.

+4
source

Updating Matt Warren's answer , there is an article in the CodeProject article that explains how automatic image stitching can be done using Accord.NET . It also explains some of the theory of the process.

The Accord.NET Framework is a C # framework that extends the original AForge.NET framework with new tools and libraries.

+4
source

Source: https://habr.com/ru/post/1306200/


All Articles