how far every part of one image moved against another, by phase correlation of tiles

Syntax

u, peak, pos = xcfShift(A, B)

Two arrays, in pixels.

u, peak, pos = xcfShift(mgA, mgB)

Two mapImage, in specimen units.

u, peak, pos = xcfShift(A, B, ROISize=64, numROI=(24, 18))

The tiles given.

T = spatialTransformShift.fit(pos, pos + u, weights=peak)

A transform fitted through the shifts.

Description

The region where both images are finite is divided into a grid of tiles, and each tile of A is phase correlated with the same tile of B. The upsampled peak of the correlation gives the displacement to sub pixel accuracy (Guizar-Sicairos et al.): the feature at pos in A is at pos + u in B.

The peak height is the weight of the tile in a fit, since a tile on featureless background correlates weakly. A tile that holds a non finite value or is flat returns NaN in all three outputs, which every spatialTransform fit drops.

Two mapImage on one grid answer in specimen units, two arrays in pixels, pixel [i, j] at (j, i); a colour image is averaged over its channels. The outputs run over the tiles down the columns of the grid first, as MATLAB’s.

Input

A, B 2d arrays of the same size, or mapImage on one grid

Keywords

keyword default description
ROISize None the tile width in pixels, at least 8; by default 2^ceil(log2(rows/4))
numROI 24 the number of tiles across, or (across, down); a single number is scaled by the aspect ratio for the tiles down
XCFMesh 250 the upsampling factor of the correlation peak

Output

u vector3d, the displacement from A to B of every tile
peak the correlation peak height of every tile, the weight in a fit
pos vector3d, the tile centres in A

References

  • M. Guizar-Sicairos, S. T. Thurman, J. R. Fienup, Efficient subpixel image registration algorithms, Optics Letters 33 (2008) 156-158

See also

pairShifts, mapImage, spatialTransform, trueEbsd, EBSDTrueEbsd

MATLAB’s xcfShift

source

Citing this page. This page is part of the documentation of MTEX, a free and open source MATLAB toolbox for analyzing and modeling crystallographic textures. It was written by The MTEX Developers and is published at https://mtex-toolbox.github.io/xcfShift_py.html. If you use MTEX, or reuse text or figures from this page, in your research, please cite

F. Bachmann, R. Hielscher, H. Schaeben: Texture Analysis with MTEX - Free and Open Source Software Toolbox, Solid State Phenomena 160 (2010), 63-68. 10.4028/www.scientific.net/SSP.160.63

BibTeX
@article{bachmann2010mtex,
  author  = {F. Bachmann and R. Hielscher and H. Schaeben},
  title   = {Texture Analysis with MTEX - Free and Open Source Software Toolbox},
  journal = {Solid State Phenomena},
  volume  = {160},
  pages   = {63-68},
  year    = {2010},
  doi     = {10.4028/www.scientific.net/SSP.160.63},
  url     = {https://doi.org/10.4028/www.scientific.net/SSP.160.63}
}

Other papers describing specific MTEX methods are listed under Publications — please cite the one that best fits your application. The MTEX source code is licensed under the GNU General Public License v2.0; the text and figures of this documentation are licensed under CC BY 4.0, which permits reuse — including by automated systems — provided The MTEX Developers and this page are credited.