darsia.ImageRegistration#

class ImageRegistration(img_dst, method=None, **kwargs)[source]#

Bases: object

Patch-wise registration of an image onto a fixed destination image.

Estimates a displacement field (e.g. from sand settling or compaction) that can be evaluated at arbitrary points or applied to another image.

Set up the image registration.

Parameters:
img_dstdarsia.Image

Reference image, held fixed in the analysis (the destination).

methodstr, optional

Registration method.

**kwargs

Multiscale parameters, each a value or a list (one entry per level):

N_patches      list of two int -- patches in x and y
rel_overlap    float -- relative patch overlap per direction
max_features   int -- max features in the feature detection
tol            float -- tolerance
mask           ndarray -- ROI in which features are considered

Methods

apply(img[, reverse])

Apply computed transformation onto arbitrary image.

evaluate(coords[, reverse, units])

See evaluate in DiffeomorphicImageRegistration.

plot(scaling[, mask])

Plot the dislacement stored in the current image registration.

apply(img, reverse=False)[source]#

Apply computed transformation onto arbitrary image.

Parameters:
imgnp.ndarray or darsia.Image

Image.

reversebool

Flag whether the translation is understood as from the test image to the baseline image, or reversed. The default is the latter.

Returns:
np.ndarray, optional

Transformed image, if input is array; no output otherwise.

evaluate(coords, reverse=False, units='metric')[source]#

See evaluate in DiffeomorphicImageRegistration.

plot(scaling, mask=None)[source]#

Plot the dislacement stored in the current image registration.

Parameters:
scalingfloat

Scaling parameter to controll the length of the arrows.

masknp.ndarray

Active mask.