warp_perspective#
- rlemasklib.RLEMask.warp_perspective(H, output_imshape)[source]#
Apply a perspective warping (homography) transformation to the mask.
The transformation matrix H should be the forward transformation, i.e. the output location of an input pixel is calculated as x_out_homogeneous = H @ x_in_homogeneous.
- Parameters:
- Returns:
A new RLEMask object representing the warped mask.
- Return type:
Examples
Scale by 0.5x and translate (shift output right by 3, down by 2):
.warp_perspective(H, output_imshape=(6, 8)) ==See also