OpenCV图像处理之重映射

 

void cv::remap(InputArray src,
  OutputArray dst,
  InputArray map1,
  InputArray map2,
  int interpolation,
  int borderMode = BORDER_CONSTANT,
  const Scalar & borderValue = Scalar() 
 )

 

将一个通用的几何变换应用于图像。

 

 

重映射将运用特定的映射对源图像进行转换:

 

dst(x,y)=src(mapx(x,y),mapy(x,y))

 

This function cannot operate in-place.

Parameters

src源图像
dst目标图像与源图像大小和通道数相同
map1The 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.
map2y方向的映射参数. 注意 map_y 和 map_x 与 src 的大小一致 CV_16UC1, CV_32FC1, or none (empty map if map1 is (x,y) points), respectively.
interpolation插值 (see cv::InterpolationFlags). 不支持 INTER_AREA ;非整数像素坐标插值标志. 这里给出的是默认值(双线性插值)
borderMode像素外推方法(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值,默认为0

interpolation algorithm

Enumerator
INTER_NEAREST 

nearest neighbor interpolation

INTER_LINEAR 

bilinear interpolation

INTER_CUBIC 

bicubic interpolation

INTER_AREA 

resampling using pixel area relation. It may be a preferred method for image decimation, as it gives moire'-free results. But when the image is zoomed, it is similar to the INTER_NEAREST method.

INTER_LANCZOS4 

Lanczos interpolation over 8x8 neighborhood

INTER_MAX 

mask for interpolation codes

WARP_FILL_OUTLIERS 

flag, fills all of the destination image pixels. If some of them correspond to outliers in the source image, they are set to zero

WARP_INVERSE_MAP 

flag, inverse transformation

For example, polar transforms:

  • flag is not set: dst(ϕ,ρ)=src(x,y)
  • flag is set: dst(x,y)=src(ϕ,ρ)

 

 

 

enum cv::BorderTypes

Various border types, image boundaries are denoted with |

See also

borderInterpolatecopyMakeBorder

Enumerator
BORDER_CONSTANT 

iiiiii|abcdefgh|iiiiiii with some specified i

BORDER_REPLICATE 

aaaaaa|abcdefgh|hhhhhhh

BORDER_REFLECT 

fedcba|abcdefgh|hgfedcb

BORDER_WRAP 

cdefgh|abcdefgh|abcdefg

BORDER_REFLECT_101 

gfedcb|abcdefgh|gfedcba

BORDER_TRANSPARENT 

uvwxyz|absdefgh|ijklmno

BORDER_REFLECT101 

same as BORDER_REFLECT_101

BORDER_DEFAULT 

same as BORDER_REFLECT_101

BORDER_ISOLATED 

do not look outside of ROI

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

女王の专属领地

您的鼓励是我最大的动力!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值