ECC Image Alignment

This webpage provides the code of the ECC image alignment algorithm (for details see [1],[2]). ECC is used in a wide range of applications such as image registration, mosaicing, object tracking, super-resolution, visual surveillance etc. ECC is also used by many medical applications.

In short, ECC image alignment algorithm estimates the geometric transformation (warp) between the input and the template image and it returns the warped input image which must be close to the template one, as it is shown below. The estimated transformation is the one that maximizes the correlation coefficient between the template and the warped input image.

Find please below both Matlab and C++ implementations of the ECC algorithm. Note that the code is provided "as is" without any kind of warranty. The use and the redistribution of the code is only permitted for academic purposes.

ECC algorithm is an OpenCV function from OpenCV release 3.0 and on. Please cite [1,2] even if you are using ECC from OpenCV library.

Matlab Code

Find forwards-additive and inverse-compositional Matlab implementations of ECC algorithm at Image Alignment Toolbox.

C++ Code (OpenCV)

OpenCV function: The use of ECC via the latest stable version of the OpenCV library (3.x) is recommended. The name of the function that implements the algorithm is findTransformECC (see the documentation HERE). The OpenCV trunk also contains a sample (samples/cpp/image_alignment.cpp) that shows how the function can be used. Here is the LINK to the sample file in OpenCV Github repository.

Stand-alone implementation: If you want to use your old OpenCV trunk, you can find here a C/C++ implementation of the ECC algorithm which is compatible with OpenCV 2.1 or newer versions (2.4.x). Find the source code HERE. (Many thanks to Mark Asbach (Pixolus) for code refactoring). Please see the provided README file to see how the executable is called.

Tracking Examples with ECC

Tracking known pattern

daqriPatternTracking.avi

Tracking unknown pattern (detected, warped and tracked)

unkonwnPatternTrackingConcatHor.avi

References

[1] G. D. Evangelidis , E. Z. Psarakis, "Parametric Image Alignment using Enhanced Correlation Coefficient Maximization", IEEE Transaction on Pattern Analysis & Machine Intelligence , Vol. 30, No. 10, pp. 1858-1865, 2008. (pdf)

[2] G. D. Evangelidis E. Z. Psarakis, "Projective Image Alignment by using ECC Maximization", in Proc. Int. Conf. on Computer Vision Theory and Applications (VISSAP), January 2008, Madeira, Portugal. (pdf)

Contact

For any bugs, questions or help, please contact the author

e-mail: george dot evangelidis at gmail dot com