pub fn remap(
src: &impl GMatTraitConst,
map1: &impl MatTraitConst,
map2: &impl MatTraitConst,
interpolation: i32,
border_mode: i32,
border_value: Scalar,
) -> Result<GMat>
Expand description
Applies a generic geometrical transformation to an image.
The function remap transforms the source image using the specified map:
where values of pixels with non-integer coordinates are computed using one of available
interpolation methods. and
can be encoded as separate floating-point maps
in
and
respectively, or interleaved floating-point maps of
in
, 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,
contains pairs (cvFloor(x),
cvFloor(y)) and
contains indices in a table of interpolation coefficients.
Output image must be of the same size and depth as input one.
Note:
- Function textual ID is “org.opencv.core.transform.remap”
- Due to current implementation limitations the size of an input and output images should be less than 32767x32767.
§Parameters
- src: Source image.
- map1: The first map of either (x,y) points or just x values having the type CV_16SC2, CV_32FC1, or CV_32FC2.
- 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 cv::InterpolationFlags). The methods [INTER_AREA] and [INTER_LINEAR_EXACT] are not supported by this function.
- borderMode: Pixel extrapolation method (see cv::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.
§C++ default parameters
- border_mode: BORDER_CONSTANT
- border_value: Scalar()