{"id":17222939,"url":"https://github.com/cheind/image-align","last_synced_at":"2025-10-13T07:36:03.344Z","repository":{"id":66174963,"uuid":"47497034","full_name":"cheind/image-align","owner":"cheind","description":"Variants of the classic Lucas-Kanade image alignment algorithm","archived":false,"fork":false,"pushed_at":"2017-01-19T12:35:32.000Z","size":584,"stargazers_count":162,"open_issues_count":5,"forks_count":53,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-09-10T01:33:42.497Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cheind.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2015-12-06T13:06:46.000Z","updated_at":"2025-07-24T06:45:29.000Z","dependencies_parsed_at":"2023-02-20T23:15:58.348Z","dependency_job_id":null,"html_url":"https://github.com/cheind/image-align","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cheind/image-align","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheind%2Fimage-align","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheind%2Fimage-align/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheind%2Fimage-align/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheind%2Fimage-align/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cheind","download_url":"https://codeload.github.com/cheind/image-align/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheind%2Fimage-align/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279014107,"owners_count":26085463,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T04:06:45.663Z","updated_at":"2025-10-13T07:36:03.310Z","avatar_url":"https://github.com/cheind.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# About this library\n\n**Image Align** is a C++ library providing variants of the classic image alignment algorithm by Lucas-Kanade.\n\n![Image Align under Euclidean Motion](etc/euclidean.gif)\n\nThe project emerged while working on [AAM](https://www.github.com/cheind/aam), an active appearance models library. Fitting active appearance models is\nsimilar to the classic image alignment problem:\n\n\u003e 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. -- \u003ccite\u003eIan Matthews\u003c/cite\u003e\n\n# Algorithms and Features\n\nAll image alignment algorithms implemented in this library are based on the original formulation of [Lucas-Kanade](#Lucas81):\n\n - Forward additive algorithm\n - Forward compositional algorithm\n - Inverse compositional algorithm\n\nFor convergence and runtime reasons all algorithms support **multi-level hierarchical** matching.\n\nThe alignment algorithms are independent of the chosen warp function. Currently the library provides the following warp modes:\n\n - 2D Translational Warp\n - 2D Euclidean Warp\n - 2D Similarity Warp\n - 2D Affine Warp\n\nUser defined warp functions can be easily added.\n\n# Usage\n\n**Image Align** is quite simple to use. Start by including the necessary headers\n\n```C++\n#include \u003cimagealign/imagealign.h\u003e\n```\n\nNext, declare the type / precision of warp, and the alignment variant you wish to use\n\n```C++\nnamespace ia = imagealign;\n\n// Use a double precision warp describing a similarity motion\n// (rotation, translation and uniform scale).\ntypedef ia::WarpSimilarityD WarpType;\n\n// Use Inverse Compositional algorithm for image alignment.\ntypedef ia::AlignInverseCompositional\u003cWarpType\u003e AlignType;\n```\n\nGiven a template image and a target image you can now perform alignment\n\n```C++\n\ncv::Mat tpl;    // The template image\ncv::Mat target; // The target image\n\nnamespace ia = imagealign;\n\n// Instance necessary objects\nWarpType w;\nAlignType a;\n\n// Prepare for alignment using 3 levels of hierarchy\na.prepare(tpl, target, w, 3);\n\n// Perform iterative alignment over all levels in hierarchy.\na.align(w, 30, 0.003);\n```\n\nWhen alignment has finished, ``w`` will hold the warp that best aligns the template image with the target image.\n\nPlease 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()``.\n\n**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.\n\n# Building from source\n**Image Alignment** requires the following pre-requisites\n\n - [CMake](www.cmake.org) - for generating cross platform build files\n - [OpenCV 2.x / 3.x](www.opencv.org) - for image processing related functions\n\nTo build from source\n\n 1. Point CMake to the cloned git repository\n 1. Click CMake Configure\n 1. Point `OpenCV_DIR` to the directory containing the file `OpenCVConfig.cmake`\n 1. Activate / Deactivate `IMAGEALIGN_USE_OPENMP`\n 1. Click CMake Generate\n\nAlthough **Image Alignment** should build across multiple platforms and architectures, tests are carried out on these systems\n - Windows 8/10 MSVC10 / MSVC12 x64\n - OS X 10.10 XCode 7.x x64\n\nIf the build should fail for a specific platform, don't hesitate to create an issue.\n\n# References\n\n 1. \u003ca name=\"Lucas81\"\u003e\u003c/a\u003eLucas, Bruce D., and Takeo Kanade. \"An iterative image registration technique with an application to stereo vision.\" IJCAI. Vol. 81. 1981.\n 2. \u003ca name=\"Baker01\"\u003e\u003c/a\u003eBaker, 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.\n 3. \u003ca name=\"Baker02\"\u003e\u003c/a\u003eBaker, 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.\n 4. \u003ca name=\"Baker03\"\u003e\u003c/a\u003eBaker, 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.\n 4. \u003ca name=\"Baker04\"\u003e\u003c/a\u003eBaker, Simon, et al. \"Lucas-Kanade 20 years on: A unifying framework: Part 3.\" The Robotics Institute, Carnegie Mellon University (2003).\n\n# License\n```\nThis file is part of Image Alignment.\n\nCopyright Christoph Heindl 2015\n\nImage Alignment is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nImage Alignment is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with Image Alignment.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheind%2Fimage-align","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcheind%2Fimage-align","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheind%2Fimage-align/lists"}