[][src]Function opencv::imgproc::warp_perspective

pub fn warp_perspective(
    src: &dyn ToInputArray,
    dst: &mut dyn ToOutputArray,
    m: &dyn ToInputArray,
    dsize: Size,
    flags: i32,
    border_mode: i32,
    border_value: Scalar
) -> Result<()>

Applies a perspective transformation to an image.

The function warpPerspective transforms the source image using the specified matrix:

block formula

when the flag #WARP_INVERSE_MAP is set. Otherwise, the transformation is first inverted with invert and then put in the formula above instead of M. The function cannot operate in-place.

Parameters

  • src: input image.
  • dst: output image that has the size dsize and the same type as src .
  • M: inline formula transformation matrix.
  • dsize: size of the output image.
  • flags: combination of interpolation methods (#INTER_LINEAR or #INTER_NEAREST) and the optional flag #WARP_INVERSE_MAP, that sets M as the inverse transformation ( inline formula ).
  • borderMode: pixel extrapolation method (#BORDER_CONSTANT or #BORDER_REPLICATE).
  • borderValue: value used in case of a constant border; by default, it equals 0.

See also

warpAffine, resize, remap, getRectSubPix, perspectiveTransform

C++ default parameters

  • flags: INTER_LINEAR
  • border_mode: BORDER_CONSTANT
  • border_value: Scalar()