第六天:图像的基本运算
来源:互联网 发布:知乎电子书 编辑:程序博客网 时间:2024/06/11 16:42
图像本质来说就是一个矩阵,所以图像的基本运算与矩阵的运算基本雷同。
eg:
#include "opencv2/opencv.hpp"#include <iostream>using namespace std;using namespace cv;void main(){Mat img1 = imread("1.jpg");Mat img2 = imread("2.jpg");Mat dst; //存储结果imshow("img1", img1);imshow("img2", img2);cout<<"img1 "<<int(img1.at<Vec3b>(10, 10)[0])<<endl;cout<<"img2 "<<int(img2.at<Vec3b>(10, 10)[0])<<endl;//dst = img1 + img2; //加//add(img1, img2, dst);//addWeighted(img1, 0.5, img2, 0.5, 0, dst);//dst = img1 - img2; //减//subtract(img1, img2, dst);//absdiff(img1, img2, dst);//dst = 5 * img1 ; //乘//dst = img1 / 5; //除//bitwise_and(img1, img2, dst); //与//bitwise_or(img1, img2, dst); //或//bitwise_not(img1, dst); //非bitwise_xor(img1, img2, dst); //异或cout<<"dst "<<int(dst.at<Vec3b>(10, 10)[0])<<endl;imshow("dst", dst);waitKey(0);}
阅读全文
0 0
- 第六天:图像的基本运算
- 图像的基本运算
- 图像的基本运算
- 图像的基本运算
- 图像的基本函数运算
- 图像的基本运算f
- OpenCV 学习(图像的基本运算)
- Python: 图像处理的基本运算
- Python: 图像处理的基本运算
- 图像基本运算
- opencv基本图像运算
- 图像形态学基本运算原理
- 图像基本群运算--滤波
- 图像的基本运算——scale, rotation, translation
- 学习Opencv2.4.9(三)---图像的基本运算
- 学习Opencv2.4.9(三)---图像的基本运算
- 特征提取与图像处理:简单基本的图像处理运算
- 图像的运算--点运算
- Linux Centos7安装Oracle12c第二版本
- python学习笔记01
- 多线程编程1
- 盒子中的div垂直居中方法记录
- 非库存采购的自动记帐
- 第六天:图像的基本运算
- 浅析GridView制作九宫格列表
- 代码综合后的电路对比(不定期更新)
- 一文读懂集成学习
- 问题 G: 想上分的鲸鱼
- Linux编程5中IO模型
- unity实现任意多边形三角剖分
- KazaQ's Socks
- Mayor's posters(区间覆盖+点离散化)