warp_affine#
- rlemasklib.RLEMask.warp_affine(M, output_imshape)[source]#
Apply an affine warping transformation to the mask.
The transformation matrix M should be the forward transformation, i.e. the output location of an input pixel is calculated as x_out = M @ x_in_homogeneous.
- Parameters:
- Returns:
A new RLEMask object representing the warped mask.
- Return type:
Examples
Translation by (2, 1) moves the mask right and down:
.warp_affine(M, output_imshape=(4, 6)) == # M = [[1,0,2],[0,1,1]]See also