vpi.dynamic_remap

vpi.dynamic_remap(input: vpi.Image, map: vpi.Image, size: Optional[tuple[int, int]] = None, *, out: vpi.Image = None, in_interp: vpi.Interp = vpi.Interp.LINEAR, map_interp: vpi.Interp = vpi.Interp.NEAREST, border: vpi.Border = vpi.Border.CLAMP, align_corners: bool = False, relative_map: bool = False, normalized_map: bool = False, backend: vpi.Backend = vpi.Backend.DEFAULT, stream: vpi.Stream = None) vpi.Image

Dynamic remap the image.

Dynamic remap an input image given a map image.

See also

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

Parameters
  • input (vpi.Image) – The input image.

  • map (vpi.Image) – The map image.

  • size (Tuple[int, int], optional) – The output size (width, height). It is set to be the input size if missing. The size argument is used by the algorithm to create the output (and return it) when not specifying the out argument.

  • out (vpi.Image, optional) – The output for the algorithm. When specified, size argument is ignored.

  • in_interp (vpi.Interp) – The input interpolation used by the algorithm.

  • map_interp (vpi.Interp) – The input interpolation used by the algorithm.

  • border (vpi.Border, optional) – What value to pick if remapped coordinated falls outside input image.

  • align_corners (bool, optional) – The sampling of pixels in continuous spatial domain may be either at top-left corner or at the center. Set this flag to True to define the sampling at the top-left corner. Set it to False (default) to sample at the pixel center.

  • relative_map (bool, optional) – Set this flag to True to consider the map values as relative offsets to be applied to each output position to fetch values from the input. When this flag is True, it forces the normalized_map flag to be also set to True. Set it to False (default) to consider map values as absolute positions in the input.

  • normalized_map (bool, optional) – Set this flag to True to consider the map values as normalized in [-1, 1] range for either absolute positions or relative offsets. Set it to False (default) to consider map values as denormalized.

  • 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 dynamically remapped 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.