[][src]Function opencv::imgproc::remap

pub fn remap(
    src: &dyn ToInputArray,
    dst: &mut dyn ToOutputArray,
    map1: &dyn ToInputArray,
    map2: &dyn ToInputArray,
    interpolation: i32,
    border_mode: i32,
    border_value: Scalar
) -> Result<()>

Applies a generic geometrical transformation to an image.

The function remap transforms the source image using the specified map:

block formula

where values of pixels with non-integer coordinates are computed using one of available interpolation methods. inline formula and inline formula can be encoded as separate floating-point maps in inline formula and inline formula respectively, or interleaved floating-point maps of inline formula in inline formula, or fixed-point maps created by using convertMaps. The reason you might want to convert from floating to fixed-point representations of a map is that they can yield much faster (~2x) remapping operations. In the converted case, inline formula contains pairs (cvFloor(x), cvFloor(y)) and inline formula contains indices in a table of interpolation coefficients.

This function cannot operate in-place.

Parameters

  • src: Source image.
  • dst: Destination image. It has the same size as map1 and the same type as src .
  • map1: The first map of either (x,y) points or just x values having the type CV_16SC2 , CV_32FC1, or CV_32FC2. See convertMaps for details on converting a floating point representation to fixed-point for speed.
  • map2: The second map of y values having the type CV_16UC1, CV_32FC1, or none (empty map if map1 is (x,y) points), respectively.
  • interpolation: Interpolation method (see #InterpolationFlags). The method #INTER_AREA is not supported by this function.
  • borderMode: Pixel extrapolation method (see #BorderTypes). When borderMode=#BORDER_TRANSPARENT, it means that the pixels in the destination image that corresponds 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.

Note: Due to current implementation limitations the size of an input and output images should be less than 32767x32767.

C++ default parameters

  • border_mode: BORDER_CONSTANT
  • border_value: Scalar()