ImageAlign

ImageAlign[ref,image]

returns a version of image that is aligned with the reference image ref.

ImageAlign[ref,{image1,,imagen}]

gives the result of aligning each of the imagei with the reference image ref.

ImageAlign[{image1,,imagen}]

uses image1 as the reference image.

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:
  • BackgroundAutomaticbackground value
    MethodAutomaticalignment method to use
    TransformationClassAutomaticgeometrical relation between images
  • Possible settings for the Method option are:
  • Automaticautomatically 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 all

Basic Examples  (2)

Align a part of an image with the full image:

Align two 3D volumes:

Scope  (2)

Align a list of three images to a reference image:

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

Three images are returned:

Options  (11)

Background  (1)

By default, a transparent background is used:

Specify a different background color:

Method  (5)

By default, ImageAlign uses an automatic combination of methods and initializations:

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

Use "KAZE" keypoints:

Use all keypoints detected by multiple methods:

The "MeanSquareGradientDescent" method uses dense distances between images:

This method typically needs a large initial overlap between images:

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

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

TransformationClass  (5)

Restrict the transformation to only translation:

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

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

Allow any affine transformation:

Perspective transformation:

Applications  (3)

Align an image with its mirror image:

Overlay the aligned images:

Align two different images of the same object:

Properties & Relations  (2)

For aligning images using a specific set of corresponding points, use FindGeometricTransform:

Transform the image with ImagePerspectiveTransformation:

Use FindGeometricTransform to find the geometric transformation that aligns images:

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

Introduced in 2010
 (8.0)
 |
Updated in 2014
 (10.0)
2015
 (10.2)
2016
 (11.0)
2017
 (11.1)