image-align-master

所属分类:Windows编程
开发工具:C/C++
文件大小:228KB
下载次数:0
上传日期:2023-06-01 11:39:31
上 传 者32Wu9tL5eW
说明:  图像对齐与配准功能实例,对初学图像配准的同学有帮助。
(this is an algorithm for image matching and registration)

文件列表:
CMakeLists.txt (1587, 2017-01-19)
etc (0, 2017-01-19)
etc\euclidean.gif (133813, 2017-01-19)
etc\sympy-jacobian-similarity.txt (360, 2017-01-19)
examples (0, 2017-01-19)
examples\align.cpp (7834, 2017-01-19)
examples\optical_flow.cpp (8010, 2017-01-19)
inc (0, 2017-01-19)
inc\imagealign (0, 2017-01-19)
inc\imagealign\align_base.h (10535, 2017-01-19)
inc\imagealign\config.h (1236, 2017-01-19)
inc\imagealign\forward_additive.h (6132, 2017-01-19)
inc\imagealign\forward_compositional.h (8176, 2017-01-19)
inc\imagealign\gradient.h (1899, 2017-01-19)
inc\imagealign\image_pyramid.h (3015, 2017-01-19)
inc\imagealign\imagealign.h (931, 2017-01-19)
inc\imagealign\inverse_compositional.h (8624, 2017-01-19)
inc\imagealign\sampling.h (4946, 2017-01-19)
inc\imagealign\warp.h (24758, 2017-01-19)
inc\imagealign\warp_image.h (2380, 2017-01-19)
src (0, 2017-01-19)
src\unused.cpp (716, 2017-01-19)
tests (0, 2017-01-19)
tests\algorithms.cpp (11944, 2017-01-19)
tests\catch.hpp (336879, 2017-01-19)
tests\regression.cpp (2536, 2017-01-19)
tests\sampling.cpp (2307, 2017-01-19)
tests\warp.cpp (3383, 2017-01-19)

# About this library **Image Align** is a C++ library providing variants of the classic image alignment algorithm by Lucas-Kanade. ![Image Align under Euclidean Motion](etc/euclidean.gif) The project emerged while working on [AAM](https://www.github.com/cheind/aam), an active appearance models library. Fitting active appearance models is similar to the classic image alignment problem: > The goal of image alignment is to find the locally 'best' transform between a template image and a target image by minimizing an energy function measuring the fitness of the alignment. -- Ian Matthews # Algorithms and Features All image alignment algorithms implemented in this library are based on the original formulation of [Lucas-Kanade](#Lucas81): - Forward additive algorithm - Forward compositional algorithm - Inverse compositional algorithm For convergence and runtime reasons all algorithms support **multi-level hierarchical** matching. The alignment algorithms are independent of the chosen warp function. Currently the library provides the following warp modes: - 2D Translational Warp - 2D Euclidean Warp - 2D Similarity Warp - 2D Affine Warp User defined warp functions can be easily added. # Usage **Image Align** is quite simple to use. Start by including the necessary headers ```C++ #include ``` Next, declare the type / precision of warp, and the alignment variant you wish to use ```C++ namespace ia = imagealign; // Use a double precision warp describing a similarity motion // (rotation, translation and uniform scale). typedef ia::WarpSimilarityD WarpType; // Use Inverse Compositional algorithm for image alignment. typedef ia::AlignInverseCompositional AlignType; ``` Given a template image and a target image you can now perform alignment ```C++ cv::Mat tpl; // The template image cv::Mat target; // The target image namespace ia = imagealign; // Instance necessary objects WarpType w; AlignType a; // Prepare for alignment using 3 levels of hierarchy a.prepare(tpl, target, w, 3); // Perform iterative alignment over all levels in hierarchy. a.align(w, 30, 0.003); ``` When alignment has finished, ``w`` will hold the warp that best aligns the template image with the target image. Please note, Lucas-Kanade methods are locally operating methods that require a good guess of true warp parameters to converge. To provide a guess, simple adjust the parameters of ``w`` using methods such as ``w.setParameters()`` and similar before calling ``a.align()``. **Image Align** comes with a couple of examples that illustrate further usage. you can find these in the [examples directory](examples/). Additionally [these unit tests](tests/) might provide in-depth information. # Building from source **Image Alignment** requires the following pre-requisites - [CMake](www.cmake.org) - for generating cross platform build files - [OpenCV 2.x / 3.x](www.opencv.org) - for image processing related functions To build from source 1. Point CMake to the cloned git repository 1. Click CMake Configure 1. Point `OpenCV_DIR` to the directory containing the file `OpenCVConfig.cmake` 1. Activate / Deactivate `IMAGEALIGN_USE_OPENMP` 1. Click CMake Generate Although **Image Alignment** should build across multiple platforms and architectures, tests are carried out on these systems - Windows 8/10 MSVC10 / MSVC12 x*** - OS X 10.10 XCode 7.x x*** If the build should fail for a specific platform, don't hesitate to create an issue. # References 1. Lucas, Bruce D., and Takeo Kanade. "An iterative image registration technique with an application to stereo vision." IJCAI. Vol. 81. 1***1. 2. Baker, Simon, and Iain Matthews. "Equivalence and efficiency of image alignment algorithms." Computer Vision and Pattern Recognition, 2001. CVPR 2001. Proceedings of the 2001 IEEE Computer Society Conference on. Vol. 1. IEEE, 2001. 3. Baker, Simon, and Iain Matthews. Lucas-Kanade 20 years on: A unifying framework: Part 1. Technical Report CMU-RI-TR-02-16, Carnegie Mellon University Robotics Institute, 2002. 4. Baker, Simon, and Iain Matthews. Lucas-Kanade 20 years on: A unifying framework: Part 2. Technical Report CMU-RI-TR-03-01, Carnegie Mellon University Robotics Institute, 2003. 4. Baker, Simon, et al. "Lucas-Kanade 20 years on: A unifying framework: Part 3." The Robotics Institute, Carnegie Mellon University (2003). # License ``` This file is part of Image Alignment. Copyright Christoph Heindl 2015 Image Alignment is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Image Alignment is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Image Alignment. If not, see . ```

近期下载者

相关文件


收藏者