重映射
1 void remap(InputArray src,OutputArray dst,InputArray map1,InputArray map2,int interpolation,int borderMode=BORDER_CONSTANT,const Scalar&borderValue=Scalar())
include<opencv2/opencv.hpp>
include
using namespace cv;
int main()
{
Mat srcImage,dstImage;
Mat map_x, map_y;
srcImage = imread("D:/jianji.jpg",1);
imshow("原始图", srcImage);
dstImage.create(srcImage.size(), srcImage.type());
map_x.create(srcImage.size(), CV_32FC1);
map_y.create(srcImage.size(), CV_32FC1);
for (int j = 0; j < srcImage.rows; j++)
{
for (int i = 0; i < srcImage.cols; i++)
{
//改变map_x&map_y的值
map_x.at
map_y.at
}
}
remap(srcImage, dstImage, map_x, map_y, INTER_LINEAR, BORDER_CONSTANT, Scalar(0, 0, 0));
imshow("【程序窗口】", dstImage);
waitKey();
return 0;
}