[][src]Function opencv::imgproc::warp_affine

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

Applies an affine transformation to an image.

The function warpAffine 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 #invertAffineTransform 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 (see #InterpolationFlags) and the optional flag #WARP_INVERSE_MAP that means that M is the inverse transformation ( inline formula ).
  • borderMode: pixel extrapolation method (see #BorderTypes); when borderMode=#BORDER_TRANSPARENT, it means that the pixels in the destination image corresponding to the "outliers" in the source image are not modified by the function.
  • borderValue: value used in case of a constant border; by default, it is 0.

See also

warpPerspective, resize, remap, getRectSubPix, transform

C++ default parameters

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