• Stars
    star
    139
  • Rank 262,954 (Top 6 %)
  • Language
    C++
  • Created almost 9 years ago
  • Updated almost 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Variants of the classic Lucas-Kanade image alignment algorithm

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

The project emerged while working on 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:

  • 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

#include <imagealign/imagealign.h>

Next, declare the type / precision of warp, and the alignment variant you wish to use

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<WarpType> AlignType;

Given a template image and a target image you can now perform alignment

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. Additionally these unit tests might provide in-depth information.

Building from source

Image Alignment requires the following pre-requisites

  • CMake - for generating cross platform build files
  • OpenCV 2.x / 3.x - for image processing related functions

To build from source

  1. Point CMake to the cloned git repository
  2. Click CMake Configure
  3. Point OpenCV_DIR to the directory containing the file OpenCVConfig.cmake
  4. Activate / Deactivate IMAGEALIGN_USE_OPENMP
  5. 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 x64
  • OS X 10.10 XCode 7.x x64

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. 1981.
  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.
  5. 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 <http://www.gnu.org/licenses/>.

More Repositories

1

py-motmetrics

πŸ“Š Benchmark multiple object trackers (MOT) in Python
Python
1,331
star
2

pytorch-blender

πŸ’¦ Seamless, distributed, real-time integration of Blender into PyTorch data pipelines
Python
527
star
3

dest

🐼 One Millisecond Deformable Shape Tracking Library (DEST)
C++
284
star
4

poisson-image-editing

Poisson image editing for seamless cloning and other operations
C++
244
star
5

py-thin-plate-spline

Code for computing interpolating / approximating thin plate splines.
Jupyter Notebook
156
star
6

inpaint

✏️ Inpaint is a C++ library providing image inpainting algorithms
C++
151
star
7

py-lapsolver

Fast linear assignment problem (LAP) solvers for Python based on c-extensions
Python
136
star
8

tf-matplotlib

Seamlessly integrate matplotlib figures as tensorflow summaries.
Python
119
star
9

mesh-deform

🍭 Physically plausible interactive 3D mesh deformation based on as rigid as possible constraints.
C++
73
star
10

pytorch-debayer

Convolutional PyTorch debayering / demosaicing layers
Python
56
star
11

autoregressive

πŸ₯ Autoregressive Models in PyTorch.
Python
56
star
12

pydantic-numpy

Seamlessly integrate numpy arrays into pydantic models.
Python
48
star
13

cppopt

Numerical optimization in C++
C++
38
star
14

parsley

Low-cost 3D scanner using Laser Triangulation
C#
35
star
15

sdftoolbox

Vectorized Python methods for creating, manipulating and tessellating signed distance fields.
Python
33
star
16

pure-torch-ngp

A pure PyTorch based implementation of "Instant Neural Graphics Primitives with a Multiresolution Hash Encoding" with tweaks.
Python
29
star
17

py-style-transfer

🎨 Artistic neural style transfer with tweaks in PyTorch
Jupyter Notebook
25
star
18

reconstructme-qt

ReconstructMe Qt UserInterface - Reference Implementation
C++
22
star
19

aam

Active Appearance Models in C++
C++
21
star
20

rgbd-correction

Code and data accompanying our work on spatio-thermal depth correction of RGB-D sensors based on Gaussian Process Regression in real-time.
Python
16
star
21

supershape

Python code to compute 3D parametric supershapes; additional Blender mesh generation support
Python
15
star
22

py-cgraph

🍊 Intro to symbolic computation in Python including applications to function optimization, physics simulation and more. Includes notebooks on back-propagation, auto-diff and more.
Python
14
star
23

py-minexr

Minimal, standalone, fast Python OpenEXR reader for single-part, uncompressed scan-line files as produced by Blender.
Python
12
star
24

rmds

Ruby Multidimensional Scaling Library
Ruby
12
star
25

py-control

PID controller playground in Python
Python
11
star
26

8point

8 Point algorithm for estimating fundamental matrix.
C++
11
star
27

python-hls-stream

Minimal HLS streaming demo with dynamic marker support in Python
Python
10
star
28

torch-spherical-harmonics

Real Spherical Harmonics for PyTorch
Python
10
star
29

py-globalflow

Python implementation of "Global Data Association for MOT Tracking using Network Flows"
Python
9
star
30

tikz-calibration-patterns

Latex, TikZ calibration pattern generation.
TeX
7
star
31

volplay

Manipulating, rendering and interacting with volumetric data
C++
6
star
32

gcsl

Implementation of "Learning to Reach Goals via Iterated Supervised Learning"
Python
5
star
33

sympy-nondim

Non-dimensionalization of physical equations using sympy.
Python
5
star
34

pytorch-blender-dr

Jupyter Notebook
5
star
35

py-probabilistic-robotics

Probabilistic robot localization
Python
4
star
36

gpu-bake

GPU vertex color baking
C++
4
star
37

py-microdots

A modern Python library to work with Anoto dot patterns.
Python
4
star
38

BilateralBlueNoisePointcloudSampling

C++
4
star
39

robot-pose

Estimate robot poses from 2d images
4
star
40

py-mass-springs

Fast simulation of mass-spring systems
Python
4
star
41

magic-texture

Generates psychedelic color textures in the spirit of Blender's magic texture shader using Python/Numpy
Python
4
star
42

py-rest-angularjs

Blueprint code for projects combining flask/aiohttp and AngularJS in a single web application
Python
3
star
43

motion-blend

Temporal blending of projectile motion estimates in 1D
Python
3
star
44

image-babble

ImageBabble is a lightweight C++ library to send and receive images
C++
3
star
45

py-classic-ai

Various classic artificial intelligence algorithms applied to common problems.
Python
3
star
46

py-dimensional-analysis

Dimensional analysis and modeling in Python
Python
3
star
47

bone-solve-ik

Fitting kinematic parameters to best align with set of noisy anchor points in Python.
Python
2
star
48

defocus

Structure from accidential motions for rendering synthetic apparature effects (focus change)
C++
2
star
49

qcv

Automatically exported from code.google.com/p/qcv
C#
2
star
50

jtypes

Bringing ECMAScript 5 types to C++
C++
2
star
51

py-gaussian-process

Gaussian processes samples
Python
2
star
52

monte-carlo-integration

Theory and implementation of Monte Carlo integration techniques
Python
2
star
53

score-matching

Jupyter Notebook
2
star
54

cpp-restify

A framework for exposing RESTful APIs from C++
C++
2
star
55

proximity-fusion

Code for "Enhanced Human-Machine Interaction by Combining Proximity Sensing with Global Perception" IROS 2019
Jupyter Notebook
2
star
56

py-videotime

Detect and extract time overlays in videos.
Python
1
star
57

pl-git-callback

A PyTorch-Lightning callback to increase model reproducibility through enforcing consistent git repository states upon training and validation.
Python
1
star
58

semi-supervised-em

Code for 'Notes on Semi-Supervised Expectation Maximization'
Jupyter Notebook
1
star
59

kdmap

Automatically exported from code.google.com/p/kdmap
C#
1
star
60

py-mcmc

Exemplary implementations of statistical methods for sampling from probability distributions
Jupyter Notebook
1
star
61

py-tonedetect

Capture tone sequences from real-time audio streams in Python
Jupyter Notebook
1
star
62

IoT-Scopes

Turns your Arduino into a software logic analyzer
C++
1
star
63

rpmk

Implementation of the 'Pyramide Match Kernel' in Ruby
Ruby
1
star
64

py-irdebug

Utilities for infrared signal debugging
C++
1
star
65

projective_circles

Experiments involving projective geometry of circles and how that affects computer vision tasks
Jupyter Notebook
1
star