opecv3
OOPABC
这个作者很懒,什么都没留下…
展开
-
模板匹配
/*在一副图像中寻找另一幅图像最匹配(相似)部分的技术通过在输入图像上华东图像块,对实际图像块和输入图像进行匹配Void mathcTemplate(inputarray image,//带搜索图像 8位或者32位 浮点图像 Inputarray temp1,//搜索模板 一样的数据类型,不能大于原图尺寸 Outputarray result,//比较结果的映射图像,必须为...原创 2018-12-11 19:41:05 · 259 阅读 · 0 评论 -
寻找凸包
#include <opencv2/opencv.hpp>#include <opencv2/highgui/highgui.hpp>#include <opencv2/imgproc/imgproc.hpp>using namespace cv;using namespace std;int main(){ system("color 1A...原创 2018-12-07 18:57:56 · 180 阅读 · 0 评论 -
查找并且绘制轮廓
#include <opencv2/opencv.hpp>#include <opencv2/highgui/highgui.hpp>#include <opencv2/imgproc/imgproc.hpp>using namespace cv;using namespace std;#define WINDOW_NAME1 "【原始图窗口】"...原创 2018-12-07 18:57:13 · 135 阅读 · 0 评论 -
绘制轮廓drawContours
#include <opencv2/opencv.hpp>#include <opencv2/highgui/highgui.hpp>#include <opencv2/imgproc/imgproc.hpp>using namespace cv;using namespace std;int main(){ system("color 1A"...原创 2018-12-07 18:56:45 · 1473 阅读 · 0 评论 -
直方图均衡化equalizeHist
#include <opencv2/opencv.hpp>#include <opencv2/highgui/highgui.hpp>#include <opencv2/imgproc/imgproc.hpp>using namespace cv;using namespace std;int main(){ system("color 1A"...原创 2018-12-07 18:55:50 · 1150 阅读 · 0 评论 -
仿射变换
#include <opencv2/opencv.hpp>#include <opencv2/highgui/highgui.hpp>#include <opencv2/imgproc/imgproc.hpp>using namespace cv;using namespace std;#define WINDOW_NAME1 "【原始图窗口】"...原创 2018-12-07 18:55:16 · 167 阅读 · 2 评论 -
多重映射
#include <opencv2/opencv.hpp>#include <opencv2/highgui/highgui.hpp>#include <opencv2/imgproc/imgproc.hpp>using namespace cv;using namespace std;#define WINDOW_NAME "【程序窗口】"M...原创 2018-12-07 18:54:48 · 876 阅读 · 0 评论 -
重映射remap
图像几何变换#include <opencv2/opencv.hpp>#include <opencv2/highgui/highgui.hpp>#include <opencv2/imgproc/imgproc.hpp>using namespace cv;using namespace std;int main(){ syste...原创 2018-12-07 18:53:57 · 296 阅读 · 0 评论 -
霍夫概率变换
#include <opencv2/opencv.hpp>#include <opencv2/highgui/highgui.hpp>using namespace cv;using namespace std;int main(){ Mat srcImage = imread("C:/Users/hasee-pc/Desktop/women.jpg");...原创 2018-12-01 14:29:10 · 389 阅读 · 0 评论 -
霍夫线变换
#include <opencv2/opencv.hpp>#include <opencv2/highgui/highgui.hpp>using namespace cv;using namespace std;int main(){ Mat srcImage = imread("C:/Users/hasee-pc/Desktop/women.jpg");...原创 2018-12-01 14:28:46 · 165 阅读 · 2 评论 -
图像变换:scharr滤波器
#include <opencv2/opencv.hpp>#include <Windows.h>#include <opencv2/highgui/highgui.hpp>using namespace cv;using namespace std;int main(){ Mat grad_x, grad_y; Mat abs_grad_x...原创 2018-12-01 14:28:06 · 675 阅读 · 0 评论 -
寻找并绘制凸包
#include <iostream>#include <opencv2//highgui/highgui.hpp>#include <opencv2/imgproc/imgproc.hpp>using namespace std;using namespace cv;#define WINDOW_NAME1 "【原始图窗口】"#define W...原创 2018-12-07 18:58:44 · 567 阅读 · 0 评论 -
包围轮廓的矩形边界
#include <opencv2//highgui/highgui.hpp>#include <opencv2/imgproc/imgproc.hpp>using namespace std;using namespace cv;//*********************************// 创建包围轮廓的矩形边界//************...原创 2018-12-07 18:59:09 · 498 阅读 · 0 评论 -
反向投影
/*记录给定图像中的像素点如何适应直方图模型像素分布方式的一种方法,计算某一特征的直方图模型,然后使用模型去去寻炸哦图像中存在的该特征的方法反向投影用于在大图像中寻找特定小图像 最匹配点或者区域,也就是定位模板图像出现输入图像的位置计算反向投影Void calcBackProject(const Mat *images,//输入图 CV_8U CV_32F 通道任意 int...原创 2018-12-11 19:38:37 · 215 阅读 · 0 评论 -
对比直方图
比较两个直方图相似度Double compareHist(inputarray H1,inputayyay H2,int mehtod)Double compareHist(const Sparesemat& H1,const SpareseMat& H2,int mehod)Mehtod 相关 mehod=CV_COMP_CORREL 1 卡方 me...原创 2018-12-11 19:37:46 · 497 阅读 · 0 评论 -
绘制RGB 三色直方图
#include <opencv2//highgui/highgui.hpp>#include <opencv2/imgproc/imgproc.hpp>#include <opencv2/opencv.hpp>#include <opencv2/photo/photo.hpp>using namespace std;using name...原创 2018-12-11 19:36:49 · 1380 阅读 · 0 评论 -
计算并且绘制 一维直方图
#include <opencv2//highgui/highgui.hpp>#include <opencv2/imgproc/imgproc.hpp>#include <opencv2/opencv.hpp>#include <opencv2/photo/photo.hpp>using namespace std;using name...原创 2018-12-11 19:35:51 · 342 阅读 · 0 评论 -
图像直方图
/*通过标记帧与帧之间显著的边缘和颜色的统计变化来检测视频场景的变化Dims : 需要统计的特征数目bins:每个特征区间子区段的数目range:每个特征空间的取值范围计算直方图void calcHist( const Mat* images,//输入数组 CV_8U 或者 CV_32F 相同深度 相同尺寸 int nimages,// 输入数组的个数,也就是一个参...原创 2018-12-11 19:35:00 · 150 阅读 · 0 评论 -
图像修补
/*利用已经被破坏区域的边缘, 颜色和结构 来繁殖和混合到破损的图像中Void inpaint( Inputarray src,//原图 八位单通道 或者三通道 必须 Inputarray inpainMask,//修复掩膜 八位单通道图像 非零表示修补 Outputarray dst,//输出图 Double inpaintRadius,// 需要修补点的圆形邻域,修复...原创 2018-12-11 19:34:14 · 366 阅读 · 0 评论 -
分水岭算法
/*分割目标图像传给函数之前需要大致勾画标记出图像中的期望进行分割的区域,被标记为正指数Void watershed(inputarray image,//输出图像 八位三通道彩色 Inputoutputarray markers//计算结果 ) */ #include <opencv2//highgui/highgui.hpp>#include <o...原创 2018-12-11 19:32:59 · 257 阅读 · 0 评论 -
图像的矩
/*模式识别 目标分类 目标识别 方位估计 图像编码重构使用moments计算图像所有的矩 最高3阶使用contourArea 计算轮廓面积使用arcLength计算轮廓或曲线长度矩的计算 Moments moments (inputarray array,// 可以是光栅图像 单通道 8位或浮点的二位数组 Bool binaryImage=false// 默认fal...原创 2018-12-11 19:32:06 · 215 阅读 · 0 评论 -
Opencv344函数分析(由于学习阶段本章内容五天更新一次)
imread(const string&filename,int flap): 读取文件 filename:图文件名称 flags: 读取方式 **OpenCV可读取文件种类 ·BMP:Windows位图文件 ·PBM,PGM,PPM:可移植图文件格式 ·SR、RAS:Sun的图文件格式 ·JPEG、JPG、JPE:JPEG图文件格式 ·TIFF、TIF:TIFF图文件格...原创 2018-12-11 19:26:08 · 208 阅读 · 0 评论 -
包围轮廓的圆形边界
#include <opencv2//highgui/highgui.hpp>#include <opencv2/imgproc/imgproc.hpp>using namespace std;using namespace cv;//*********************************// 创建包围轮廓的圆形边界//************...原创 2018-12-07 18:59:35 · 338 阅读 · 0 评论 -
边缘检测综合示例
#include <opencv2/opencv.hpp>#include <Windows.h>#include <opencv2/highgui/highgui.hpp>using namespace cv;using namespace std;Mat g_srcImage, g_srcGrayImage, g_dstImage;//Ca...原创 2018-12-01 14:27:41 · 248 阅读 · 0 评论 -
图像变换:Laplacian算子
#include <iostream>#include <opencv2/opencv.hpp>#include <Windows.h>#include <opencv2/highgui/highgui.hpp>using namespace cv;using namespace std;int main(){ Mat src, ...原创 2018-12-01 14:27:16 · 775 阅读 · 0 评论 -
边缘检测sobel算子
#include <iostream>#include <iostream>#include <opencv2/opencv.hpp>#include <Windows.h>#include <opencv2/highgui/highgui.hpp>using namespace cv;using namespace std...原创 2018-12-01 14:26:53 · 180 阅读 · 0 评论 -
Xml Yaml 进行读写
#include <iostream>#include <time.h>#include <string>#include <opencv2/opencv.hpp>using namespace cv;using namespace std;int main(){ system("color 6E"); FileStorage ...原创 2018-11-30 15:58:13 · 236 阅读 · 0 评论 -
离散傅里叶变换
//---------离散傅里叶变换-----------------//#include <iostream>#include <opencv2/opencv.hpp>#include <Windows.h>#include <opencv2/highgui/highgui.hpp>using namespace cv;using ...原创 2018-11-30 15:57:20 · 251 阅读 · 0 评论 -
图像对比度调节,亮度调节
#include <opencv2/opencv.hpp>#include <Windows.h>#include <opencv2/highgui/highgui.hpp>using namespace cv;using namespace std;static void on_ContrastAndBright(int, void *);st...原创 2018-11-26 13:52:08 · 555 阅读 · 0 评论 -
多通道图像混合
#include <iostream>#include <opencv2/opencv.hpp>#include <Windows.h>#include <opencv2/highgui/highgui.hpp>using namespace cv;using namespace std;bool ROI_AddImage();bo...原创 2018-11-26 13:51:26 · 302 阅读 · 0 评论 -
初级图像混合
#include <opencv2/opencv.hpp>#include <Windows.h>#include <opencv2/highgui/highgui.hpp>using namespace cv;using namespace std;/*利用addweight 实现图像混合*/bool LinearBlending(){...原创 2018-11-26 13:50:58 · 146 阅读 · 0 评论 -
访问图像像素几种方法
#include <iostream>#include <opencv2/opencv.hpp>#include <Windows.h>#include <opencv2/highgui/highgui.hpp>using namespace cv;using namespace std;/*-------------------...原创 2018-11-26 13:50:28 · 140 阅读 · 0 评论 -
鼠标操作
#include <opencv2/opencv.hpp>#include <opencv2/highgui/highgui.hpp>using namespace cv;#define WINDOW_NAME "【程序窗口】"void on_MouseHandle(int event, int x, int y, int flags, void *para...原创 2018-11-26 13:48:50 · 172 阅读 · 0 评论 -
生成轨迹条
#include <opencv2/opencv.hpp>#include <opencv2/highgui/highgui.hpp>using namespace cv;#define WINDOW_NAME "[XianXingHunHe]"const int g_nMaxAlphaValue = 100;int g_nAlphaValueSlider...原创 2018-11-26 13:48:23 · 858 阅读 · 0 评论 -
生成png图片
#include <opencv2/opencv.hpp>using namespace std;using namespace cv;void createAlphaMat(Mat &mat){ for (int i = 0; i < mat.rows; ++i) { for (int j = 0; j < mat.cols; ++j) {...原创 2018-11-26 13:46:35 · 1139 阅读 · 0 评论 -
摄像头采集图像
#include <opencv2/highgui/highgui.hpp>#include <opencv2/opencv.hpp>#include <opencv2/imgproc/imgproc.hpp>//图像处理头文件using namespace cv;//摄像头视频采集//实例化,初始化int main(){ //从摄像头读入视...原创 2018-11-26 13:45:37 · 574 阅读 · 0 评论 -
方框滤波
#include <opencv2/opencv.hpp>#include <opencv2/highgui/highgui.hpp>#include <opencv2/imgproc/imgproc.hpp>using namespace std;using namespace cv;//***********************// ...原创 2018-11-30 15:59:22 · 777 阅读 · 0 评论 -
均值滤波
#include <opencv2/opencv.hpp>#include <opencv2/highgui/highgui.hpp>#include <opencv2/imgproc/imgproc.hpp>using namespace std;using namespace cv;//***********************// ...原创 2018-11-30 15:59:51 · 335 阅读 · 0 评论 -
边缘检测Canny
#include <opencv2/opencv.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> using namespace std; using namespace cv; //**********************...原创 2018-12-01 14:26:16 · 100 阅读 · 0 评论 -
图像阈值化
#include <iostream>#include <opencv2/opencv.hpp>#include <opencv2/highgui/highgui.hpp>#include <opencv2/imgproc/imgproc.hpp>using namespace std;using namespace cv;//*...原创 2018-12-01 14:25:29 · 113 阅读 · 0 评论