craftutils.observation.image.register(source, target, fill_value=None, propagate_mask=False, max_control_points=50, detection_sigma=5, min_area=5)

Transform source to coincide pixel to pixel with target.

Parameters

source

A 2D NumPy, CCData or NDData array of the source image to be transformed.

target

A 2D NumPy, CCData or NDData array of the target image. Used to set the output image shape as well.

fill_value

A value to fill in the areas of aligned_image where footprint == True.

propagate_maskbool

Wether to propagate the mask in source.mask onto footprint.

max_control_points

The maximum number of control point-sources to find the transformation.

detection_sigmaint

Factor of background std-dev above which is considered a detection.

min_areaint

Minimum number of connected pixels to be considered a source.

Returns

aligned_image, footprint

aligned_image is a numpy 2D array of the transformed source. footprint is a mask 2D array with True on the regions with no pixel information.

Raises

TypeError

If input type of source or target is not supported.

ValueError

If it cannot find more than 3 stars on any input.

MaxIterError

If no transformation is found.