vpi.Image.perspwarp

Image.perspwarp(out: vpi.Image = None, *, grid: vpi.WarpGrid = None, interp: vpi.Interp = vpi.Interp.LINEAR, border: vpi.Border = vpi.Border.ZERO, backend: vpi.Backend = vpi.Backend.DEFAULT, stream: vpi.Stream = None) vpi.Image
Image.perspwarp(size: Tuple[int, int], *, grid: vpi.WarpGrid = None, interp: vpi.Interp = vpi.Interp.LINEAR, border: vpi.Border = vpi.Border.ZERO, backend: vpi.Backend = vpi.Backend.DEFAULT, stream: vpi.Stream = None) vpi.Image

Applies a perspective warp on the image.

See also

Refer to the algorithm explanation for more details and usage examples.

Parameters
  • xform (2D array of float) – Transform to be applied. Expects 3x3 matrix.

  • out (vpi.Image, optional) – The output image where warped image is written to (dimensions may be different from input). Use input dimensions for the output if missing.

  • size (Tuple[int, int]) – The tuple with the desired output dimensions (width, height) used instead of the output argument.

  • grid (vpi.WarpGrid, optional) – Grid on the output to establish performance/quality trade-offs. A dense grid will result in best quality, albeit slower performance. Grid must be set depending on the perf/quality criteria needed. Use dense grid if missing.

  • interp (vpi.Interp, optional) – Interpolation mode to be used when source coordinate doesn’t fall exactly on pixel center.

  • border (vpi.Border, optional) – The border extension used by the algorithm.

  • backend (vpi.Backend, optional) – The backend to be used by the algorithm.

  • stream (vpi.Stream, optional) – The stream to be used by the algorithm.

Returns

The resulting warped image.

Return type

vpi.Image

Caution

Restrictions to several arguments may apply. Check the C API references of the submit function and the group concepts for more details.