ImageFile.Stoner__Image__imagefuncs__correct_drift

ImageFile.Stoner__Image__imagefuncs__correct_drift(ref, **kargs)

Align images to correct for image drift.

Parameters:

ref (ImageArray) – Reference image with assumed zero drift

Keyword Arguments:
  • threshold (float) – threshold for detecting imperfections in images (see skimage.feature.corner_fast for details)

  • upsample_factor (float) – the resolution for the shift 1/upsample_factor pixels registered. see skimage.feature.register_translation for more details

  • box (sequence of 4 ints) – defines a region of the image to use for identifyign the drift defaults to the whol image. Use this to avoid drift calculations being confused by the scale bar/annotation region.

  • do_shift (bool) – Shift the image, or just calculate the drift and store in metadata (default True, shit)

Returns:

A shifted image with the image shift added to the metadata as ‘correct drift’.

Detects common features on the images and tracks them moving. Adds ‘drift_shift’ to the metadata as the (x,y) vector that translated the image back to it’s origin.