darsia.ImageRegistration#
- class ImageRegistration(img_dst, method=None, **kwargs)[source]#
Bases:
objectPatch-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_dst
darsia.Image Reference image, held fixed in the analysis (the destination).
- method
str,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
- img_dst
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:
- img
np.ndarrayordarsia.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.
- img
- Returns:
np.ndarray,optionalTransformed 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:
- scaling
float Scaling parameter to controll the length of the arrows.
- mask
np.ndarray Active mask.
- scaling