问题
What is a good method to align images together that may have different rotations, exposures, etc, but have the same background or other fixed reference?
Adobe Photoshop can do this with its "Photomerge" feature.
How can I do this programatically? Is there an Open Source application that does it?
回答1:
You want to search for image stitching
or image registration
as these are the names that it's also known by. This wikipedia article has some useful information. But I only know of commercial libraries that do it, not any open source ones.
The basic outline of the process (in the commercial library I know of) is this:
- Initially you have to specify the rough alignment of the images, i.e.
- Image A is to the left of image B and they overlap by less that 10%.
- Image C is to the right of image B and they overlap by 10-20% etc.
- Based on the parameters in 1) the algorithm will attempt to find unique a "template" in the overlapping regions. It will then use a template matching technique to locate the template in each of the 2 overlapping images.
- Item 2) can be repeated several times to give a series of matching locations, that can then be used to provide an exact fit.
In step 3 you can also take account of distortion such as rotation and lens distortion. But to allow for changes in colour step 2 would need to be more advanced (i.e. not just based on the greyscale pixel level).
There's an feature request to add this functionality to the AForge library, but at the moment it's not been done and I don't know the current status.
回答2:
Updating the answer by Matt Warren, there is an article on CodeProject explaining how automatic image stitching could be done using Accord.NET. It also explains some of the theory behind the process.
The Accord.NET Framework is a framework written in C# which extends the original AForge.NET Framework with new tools and libraries.
来源:https://stackoverflow.com/questions/2590220/aligning-multiple-images-into-one-image