ImageAlign
✖
ImageAlign
gives the result of aligning each of the imagei with the reference image ref.
Details and Options


- ImageAlign[image1,image2] finds a transformation of image2 that registers it with image1 and returns the result of applying this transformation to image2.
- ImageAlign works with arbitrary 2D and 3D images.
- Resulting images have the same dimensions as the reference image.
- Use FindGeometricTransform to compute the geometric transformation used for alignments.
- The following options can be specified:
-
Background Automatic background value Method Automatic alignment method to use TransformationClass Automatic geometrical relation between images - Possible settings for the Method option are:
-
Automatic automatically choose a suitable method "Keypoints" use corresponding keypoints {"Keypoints",method} use an ImageCorrespondingPoints method "MeanSquareGradientDescent" minimize the mean square distance of corresponding pixels "Fourier" Fourier-based registration "FourierBlurInvariant" blur invariant Fourier-based registration - With the default setting TransformationClass->Automatic, ImageAlign attempts to find the simplest possible transformation.
- Possible transformations in order of increasing complexity are:
-
"Translation" translation only "Rigid" translation and rotation "Similarity" translation, rotation, and scaling "Affine" linear transformation and translation "Perspective" linear fractional transformation
Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Scope (2)Survey of the scope of standard use cases
Align a list of three images to a reference image:

https://wolfram.com/xid/0enzd2xpm-rfeddb

Align a list of three images, using the first image as the reference:

https://wolfram.com/xid/0enzd2xpm-wlldk4


https://wolfram.com/xid/0enzd2xpm-82hrp2

Options (11)Common values & functionality for each option
Background (1)
Method (5)
By default, ImageAlign uses an automatic combination of methods and initializations:

https://wolfram.com/xid/0enzd2xpm-fsm0e

The "Keypoints" method works well with natural 2D photos:

https://wolfram.com/xid/0enzd2xpm-c66q0o

https://wolfram.com/xid/0enzd2xpm-jbgwtf


https://wolfram.com/xid/0enzd2xpm-sz539y

Use all keypoints detected by multiple methods:

https://wolfram.com/xid/0enzd2xpm-11mhtc

The "MeanSquareGradientDescent" method uses dense distances between images:

https://wolfram.com/xid/0enzd2xpm-skf6dp

This method typically needs a large initial overlap between images:

https://wolfram.com/xid/0enzd2xpm-bzow31

The "Fourier" method can align images even with a small overlap:

https://wolfram.com/xid/0enzd2xpm-e5mu21

https://wolfram.com/xid/0enzd2xpm-qmewqx


https://wolfram.com/xid/0enzd2xpm-mvfdaj

Use the "FourierBlurInvariant" method in the presence of noise and motion blur:

https://wolfram.com/xid/0enzd2xpm-xwlt7k

https://wolfram.com/xid/0enzd2xpm-tx3zii


https://wolfram.com/xid/0enzd2xpm-ejdcez

TransformationClass (5)
Restrict the transformation to only translation:

https://wolfram.com/xid/0enzd2xpm-ep3lv6

"Rigid" transformation allows for rotations in addition to translations:

https://wolfram.com/xid/0enzd2xpm-qtlqce

"Similarity" transforms allow for translation, rotation, and scaling:

https://wolfram.com/xid/0enzd2xpm-r220px

Allow any affine transformation:

https://wolfram.com/xid/0enzd2xpm-m6qev


https://wolfram.com/xid/0enzd2xpm-fpmf4e

Applications (4)Sample problems that can be solved with this function
Align an image with its mirror image:

https://wolfram.com/xid/0enzd2xpm-ldb13y


https://wolfram.com/xid/0enzd2xpm-y2icvj

https://wolfram.com/xid/0enzd2xpm-n6yrlc

Align two different images of the same object:

https://wolfram.com/xid/0enzd2xpm-c8rukx

Align images before performing focus stacking:

https://wolfram.com/xid/0enzd2xpm-qvdolq

https://wolfram.com/xid/0enzd2xpm-obr97t


https://wolfram.com/xid/0enzd2xpm-85kl62

Compare with the stacking without alignment:

https://wolfram.com/xid/0enzd2xpm-y83vom

Properties & Relations (2)Properties of the function, and connections to other functions
For aligning images using a specific set of corresponding points, use FindGeometricTransform:

https://wolfram.com/xid/0enzd2xpm-rnltof

https://wolfram.com/xid/0enzd2xpm-hs3u7g

Transform the image with ImagePerspectiveTransformation:

https://wolfram.com/xid/0enzd2xpm-evg88m

Use FindGeometricTransform to find the geometric transformation that aligns images:

https://wolfram.com/xid/0enzd2xpm-wy0w9v

https://wolfram.com/xid/0enzd2xpm-gepm7n

Stitch images together by transforming one and composing on top of the other one:

https://wolfram.com/xid/0enzd2xpm-jsa2w0

Wolfram Research (2010), ImageAlign, Wolfram Language function, https://reference.wolfram.com/language/ref/ImageAlign.html (updated 2021).
Text
Wolfram Research (2010), ImageAlign, Wolfram Language function, https://reference.wolfram.com/language/ref/ImageAlign.html (updated 2021).
Wolfram Research (2010), ImageAlign, Wolfram Language function, https://reference.wolfram.com/language/ref/ImageAlign.html (updated 2021).
CMS
Wolfram Language. 2010. "ImageAlign." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/ImageAlign.html.
Wolfram Language. 2010. "ImageAlign." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/ImageAlign.html.
APA
Wolfram Language. (2010). ImageAlign. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ImageAlign.html
Wolfram Language. (2010). ImageAlign. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ImageAlign.html
BibTeX
@misc{reference.wolfram_2025_imagealign, author="Wolfram Research", title="{ImageAlign}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/ImageAlign.html}", note=[Accessed: 08-July-2025
]}
BibLaTeX
@online{reference.wolfram_2025_imagealign, organization={Wolfram Research}, title={ImageAlign}, year={2021}, url={https://reference.wolfram.com/language/ref/ImageAlign.html}, note=[Accessed: 08-July-2025
]}