full_transform

sofia_redux.toolkit.image.warp.full_transform(coordinates, transform)[source]

Apply a metric transform to the supplied coordinates.

A standard correlation matrix transform, or homography (planar) transform may be applied. For 2-dimensions, the homography transform is given as:

| x' |     |x|   |h11 h12 h13| |x|
| y' | = H |y| = |h21 h22 h23| |y|
| 1  |     |1|   |h31 h32 h33| |1|

where H is the transform matrix. The h13 and h23 elements represent a translation, and the h31 and h32 represent relative scaling. The h33 element provides and overall scaling factor to the results. For the standard transformation h11, h12, h31, h32 are zero, and h33 is 1. Alternatively, the standard transform may be invoked by supplying a matrix of shape (n_dimensions, n_dimensions).

Parameters:
coordinatesnumpy.ndarray (float)

An array of shape (n_dimensions, shape) where shape may be arbitrary.

transformnumpy.ndarray (float)

The transform array of shape (n_dimensions + 1, n_dimensions + 1) to fully represent a homography transform.

Returns:
transformed_coordinatesnumpy.ndarray (float)

The coordinates transformed by transform with the same shape as coordinates. Note however, that if a one-dimensional coordinates was supplied, the output will be of shape (1, coordinates.size).