Opencv学习——图像融合
2017-10-08 11:06
976 查看
Opencv相关函数:
图像融合基本原理:泊松克隆,与图像的梯度和散度相关,具体的原理可查看
http://blog.csdn.net/hjimce/article/details/45716603
其中,原图如下:
C++: void seamlessClone(InputArray src, InputArray dst, InputArray mask, Point p, OutputArray blend, int flags)
图像融合基本原理:泊松克隆,与图像的梯度和散度相关,具体的原理可查看
http://blog.csdn.net/hjimce/article/details/45716603
图像融合效果:
其中,原图如下:
相关代码:
int main() { // Read images : src image will be cloned into dst Mat src = imread("bird.jpg"); Mat dst = imread("sunset.jpg"); resize(dst, dst, Size(dst.cols/2, dst.rows/2)); // Create an all white mask Mat src_mask = Mat::zeros(src.rows, src.cols, src.depth()); // Define the mask as a closed polygon Point poly[1][4]; poly[0][0] = Point(263, 127); poly[0][1] = Point(257, 265); poly[0][2] = Point(720, 338); poly[0][3] = Point(721, 138); const Point* polygons[1] = { poly[0] }; int num_points[] = { 4 }; // Create mask by filling the polygon fillPoly(src_mask, polygons, num_points, 1, Scalar(255, 255, 255)); // The location of the center of the src in the dst Point center(700, 150); // Seamlessly clone src into dst and put the results in output Mat output; seamlessClone(src, dst, src_mask, center, output, NORMAL_CLONE); imshow("result", output); waitKey(0); return 0; }
相关文章推荐
- opencv学习笔记(十五)——图像融合
- opencv学习笔记之两幅图像显式融合
- opencv学习:安装与图像载入,融合
- opencv学习(十四)之图像颜色通道分离和融合
- Opencv学习笔记(2)模块,图像读取、显示、叠加、融合、颜色分离、亮度、对比度
- OpenCV学习--实现两幅图像的融合
- 【OpenCV图像处理入门学习教程三】基于SIFT特征和SURF特征的微旋转图像拼接与融合生成全景图像的比较
- opencv学习(5)图像像素的访问、颜色通道的分离和融合
- 学习openCV之读取图像和感兴趣区域融合
- OpenCV学习笔记-彩色图像取反
- opencv学习笔记(2017年8月21日)之图像腐蚀操作
- opencv学习笔记-2,图像颜色空间转换
- OpenCV2学习笔记04:图像的读取与显示
- OpenCV系统学习:二、基本图像处理函数
- Python OpenCV学习笔记之:图像Lucas-Kanad流光算法
- 我的OpenCV学习笔记(22):如何区别一幅图像是否是黑白图像
- 模块图像opencv学习之路【四】——opencv文件结构介绍
- 图像的像素点操作【OpenCV学习笔记3】
- OpenCV学习笔记-图像分割
- OpenCV2学习笔记(二):图像的直方图