- 博客(52)
- 资源 (7)
- 收藏
- 关注
原创 OpenCV Mahalanobis例子
//包含OpenCV的头文件#include <opencv2/opencv.hpp>#include <opencv2/core/mat.hpp>#include <iostream>#include <time.h>using namespace std;//使用OpenCV的命名空间using namespace cv;...
2019-04-23 21:28:31 997 1
原创 OpenCV LUT
//包含OpenCV的头文件#include <opencv2/opencv.hpp>#include <opencv2/core/mat.hpp>#include <iostream>#include <time.h>using namespace std;//使用OpenCV的命名空间using namespace cv;/...
2019-04-14 22:18:16 690
原创 OpenCV 常用函数使用例子和说明(2)
1、目录cv::determinant() 计算方形矩阵的行列式 cv::divide() 两个数组逐元素相除 cv::eigen() 计算方形矩阵的特征值和特征向量 cv::exp() 逐元素求指数 cv::filp() 翻转矩阵 cv::gemm() 两个数组逐元素相乘 cv::filp() 翻转矩阵 cv::ge...
2019-04-14 21:48:18 1319
原创 OpenCV 常用函数使用例子和说明
1,操作例子目录操作 描述 cv::abs() 返回所有元素的绝对值 cv::absdiff() 返回两个元素数组差的绝对值 cv::add() 最元素相加 cv::addWeighted() 添加两个每个元素的权值 cv::bitwise_and() 两个数组逐元素求与操作 cv::bitwise_not() 数组逐元素求非...
2019-04-10 23:11:58 1550
原创 OpenCV Rect操作
1,OpenCV Rect 常用操作符注意:坐标系是标准的笛卡尔坐标系,X方向向右为正,Y方向向上为正 操作 例子 默认构造函数 cv::Rect r 赋值构造函数 cv::Rect r2(r1) 带参数构造函数 cv::Rect(x,y,w,h) 原始点和Size构造函数 cv::Rect(p,sz) 两个角点构造函数 cv::R...
2019-04-07 15:36:12 5178
原创 OpenCV Point类型操作
1,常用操作总结操作 例子 默认构造函数 cv::Point2i p; cv::Point3f p; 赋值构造函数 cv::Point3f p2(p1); 带参构造函数 cv::Point2i p(x0,x1); cv::Point3f p(x0,x1,x2); 转换为Vec3f类型 cv::Vec3f p; 成员对象的访问 p...
2019-04-07 13:57:40 22695
原创 OpenCV Sobel 边缘检测
Sobel算子检测方法对灰度渐变和噪声较多的图像处理效果较好,sobel算子对边缘定位不是很准确,图像的边缘不止一个像素;当对精度要求不是很高时,是一种较为常用的边缘检测方法。 OpenCV中sobel过滤因子的原型为void cv::Sobel( InputArray _src, OutputArray _dst, int ddepth, int dx, int dy, ...
2019-03-31 23:11:25 10142
原创 OpenCV 高斯模糊
高斯滤波器能够有效的抑制噪声,平滑图像。高斯滤波器相比于均值滤波器对图像个模糊程度较小。高斯公式matlab代码clear;a=0;sigma=0.8; x=-10:0.0001:10;figure(1)y=(1/((sqrt(2*pi))*sigma))*exp(-((x-a).^2)/(2*sigma.^2));plot(x,y,'b','LineWidth',1.5)...
2019-03-27 16:26:05 7913
原创 OpenCV 二值化
//包含OpenCV的头文件//参照github https://github.com/yoyoyo-yo/Gasyori100knock #include <opencv2/opencv.hpp>#include <iostream>using namespace std;//使用OpenCV的命名空间using namespace cv;//频...
2019-03-24 19:27:00 3033 1
原创 OpenCV 彩色影像转换为灰度影像
//包含OpenCV的头文件//参照github https://github.com/yoyoyo-yo/Gasyori100knock #include <opencv2/opencv.hpp>#include <iostream>using namespace std;//使用OpenCV的命名空间using namespace cv;//将彩色影像...
2019-03-24 11:59:49 1814
原创 OpenCV 频道改变
参照Github项目:https://github.com/yoyoyo-yo/Gasyori100knock//包含OpenCV的头文件//参照github https://github.com/yoyoyo-yo/Gasyori100knock #include <opencv2/opencv.hpp>#include <iostream>using n...
2019-03-24 11:49:37 145 1
原创 OpenCV 影像融合
//包含OpenCV的头文件#include <opencv2/opencv.hpp>#include <iostream>using namespace std;//使用OpenCV的命名空间using namespace cv;int main(){ //读取两幅影像 Mat Img1 = imread("C:/Users/GuSheng/Desk...
2019-03-24 09:10:53 348
原创 OpenCV 显示视频
第一版//包含OpenCV的头文件#include <opencv2/opencv.hpp>#include <iostream>using namespace std;//使用OpenCV的命名空间using namespace cv;int main(){ //创建一个窗口,用来显示视频影像 namedWindow("Example", WIN...
2019-03-23 21:56:17 1564
原创 OpenCV 显示影像
//包含OpenCV的头文件#include <opencv2/opencv.hpp>#include <iostream>using namespace std;//使用OpenCV的命名空间using namespace cv;int main(){ //读取一幅文件 //imread支持BMP,DIB,JPEG,GPE,PNG,PBM,PGM,P...
2019-03-23 20:55:31 453
原创 《离散数学及其应用》第七章 第一节
//持续更新中chaper71.h#pragma once//组合函数 计算 C(n,m)//从m个数据集中无序的选择n个样本的方法数__int64 Combination(int n, int m);//排列函数 计算A(n,m)//从m个数据集中有序的选择n个样本的方法数__int64 Permutation(int n, int m);chapter72.cpp...
2019-03-08 18:01:48 402
原创 十进制数据相减(大数据)
#ifndef UNICODEtypedef string _tstring;#elsetypedef wstring _tstring;#endif //!bool isSmaller(_tstring str1, _tstring str2) { int n1 = str1.length(), n2 = str2.length(); if (n1 < n2) { r...
2018-11-28 11:57:36 855
原创 十进制数据相加(大数据)
#ifdef UNICODEtypedef wstring _tstring;#elsetypedef string _tstring;#endif/***********************************************************************函数名称 :AddBigData函数功能 :两个大数据进行相加(必须为正整数 )函数参...
2018-11-28 11:56:55 1052
原创 十进制数据相乘(大数据)
#ifdef UNICODEtypedef wstring _tstring;#elsetypedef string _tstring;#endif/***********************************************************************函数名称 :AddBigDataAux函数功能 :两个大数据进行相加(必须为正整数 )...
2018-11-28 11:56:07 1060
原创 应用密码学-第十一章
一条消息M的信息量可通过它的熵(entropy)来度量,表示为H(M)。公式为,n是消息所有等可能的值。假设所有消息是等可能的,对消息中所有可能的值进行编码所需要的最少位数。例如:"一周中每一天",一共包含7种等可能的事件,这一字段包含不超过3位的信息,因为此消息可以用3位进行编码000 = 周日001 = 周一010 = 周二011 = 周三100 = 周四1...
2018-10-03 21:06:43 266
原创 应用密码学 学习笔记-第二章
协议(protocol)是一系列步骤,它包括两方或者多方,设计它的目的是要完成一项任务。“一系列步骤”:意味着协议从开始到结束的一个序列,每一步骤必须一次执行,在前一步完成之前,后面的步骤都不能执行“包括两方或者多方”:意味着完成这个协议至少需要两个人“设计它的目的是要完成一项任务”:意味着协议必须做一些事情。计算机仲裁者有下面几个问题:1,如果你知道后对方是谁,并能见到他的面,那么很...
2018-10-03 19:56:48 772
原创 Qt Spliiter类
#include "qstackWidget.h"#include #include #include #include int main(int argc, char *argv[]){ QApplication a(argc, argv);// qstackWidget w;// w.show(); QFont font("Times", 18); a.setFont
2017-05-03 22:28:13 350
原创 LBP
#include #include #include using namespace std;using namespace cv;using namespace cv::ml;//LBP local binary pattern//是一种局部纹理提取,纹理分析和人脸检测int GetTranslate(int num){ int data[8];//保存每个数据 memse
2017-05-03 00:17:44 338
原创 HOG+SVM
#include #include #include using namespace std;using namespace cv;using namespace cv::ml;int main(){ //文件路径的前缀 string PrePath = "C:/Users/GuSheng/Desktop/photo/pedestrians128x64/"; //文件名字的前缀
2017-05-02 22:29:22 614
原创 DFT
#include #include #include using namespace std;using namespace cv;int main(){ string filename = "C:/Users/Administrator/Desktop/标准测试图片/dota/big432000.jpg"; Mat img = imread(filename, IMREAD_G
2017-04-17 09:48:00 673
原创 opencv 的几种边界
CV_EXPORTS_W void copyMakeBorder(InputArray src, OutputArray dst, int top, int bottom, int left, int right, int borderType, const Scal
2017-04-16 18:58:59 1145
原创 opencv 绘制矩形,提取矩形区域的直方图
#include #include #include using namespace std;using namespace cv;Mat g_img;//全局变量,以便在mouse函数中进行使用string tile("窗口");//全局的窗口名字void Mouse(int event, int x, int y, int flag, void *){ static Poi
2017-04-16 00:20:36 1383
原创 opencv 创建鼠标消息的问题
1.opencv 中可以创建鼠标消息,但是有一个需要注意的问题namedWindow(tile);setMouseCallback(tile, Mouse, NULL);//创建鼠标回调函数这两个函数一定不能写反了,或者省略第一条语句(我们知道,即使不使用nameWindow函数,我们也可以直接调用imshow函数)一个具体的例子功能:使用opencv,在鼠标左键按下的时候,显示
2017-04-15 23:03:00 351
原创 opencv PCA算法
#include <iostream>#include <opencv2/opencv.hpp>#include <sstream>using namespace std;using namespace cv;//PCA算法的实现和总结int main(){ //文件路名的前缀 string filename = "C:/Users/Adm...
2017-04-14 03:16:23 1034
原创 opencv SVD算法
参照:https://www.cnblogs.com/pinard/p/6251584.html#include <iostream>#include <opencv2/opencv.hpp>using namespace std;using namespace cv;//SVD算法int main(){ string filename = "C:/...
2017-04-13 19:05:13 4278
原创 模拟相机捕捉影像 将影像进行保存
1.开启摄影头,当按下 Space 按键的时候,捕获影像,并将其按照时间格式进行保存#include #include #include#includeusing namespace cv;using namespace std;int main(){ VideoCapture capture(0); Mat img; //判断摄影头是否打开 if (!capture.i
2017-04-12 20:53:57 481
原创 旋转矩阵,旋转影像
#include #include using namespace std;using namespace cv;int g_angle = 45;int g_MaxAngle = 360;Mat img;void Tracker(int pos, void *){ double angle = g_angle; double a = 3.1415926 * angle / 1
2017-04-11 19:58:04 281
原创 LK动态捕捉
#include #include #include using namespace std;using namespace cv;//创建鼠标消息Point2f g_point;//保存鼠标获取的特征点bool g_AddRemovePt;//是否添加移动点void MouseEvent(int event, int x, int y, int, void *){ if (
2017-04-11 19:54:22 304
原创 以任意字符分割字符串
#include #include #include #include //头文件#include #include using namespace cv; //包含cv命名空间using namespace std;int main(){ ifstream is; is.open("1.txt", ifstream::in); if (!is.good()) {
2017-04-11 19:52:38 945
原创 OpenCV相机标定
#include #include #include #include //头文件#include using namespace cv; //包含cv命名空间using namespace std;//棋盘标靶中每块的宽和高int g_Height = 100;int g_Width = 100;int g_InnerHeigh = 6;int g_InnerWidt
2017-04-10 03:32:12 424
原创 findChessboardCorners
对着findChessboardCorners这个函数,最容易出错的地方,就是param patternSize这个参数了,根据OpenCV文档的定义Number of inner corners per a chessboard row and column是棋盘的内部角点个数,而非棋盘中黑白块的个数从上面可以看出,影像的行数是6,而非白块+黑块的大小7.(内部角点)测试
2017-04-08 09:53:21 4105
原创 DualTVL1OpticalFlow
#include #include #include //头文件#include using namespace cv; //包含cv命名空间using namespace std;//string filename="C:\\Users\\Administrator\\Desktop\\标准测试图片"int main(){ string filename1 = "C:\\
2017-04-08 04:58:33 1794
原创 calcOpticalFlowFarneback
//函数原型void calcOpticalFlowFarneback( InputArray prev, InputArray next, InputOutputArray flow, double pyr_scale, int levels, int winsize,
2017-04-08 04:16:10 2572 1
原创 opencv_contrib 配置中常见问题的解决
在opencv3.0中,如果需要SIFT,SURF等算法的时候,需要配置opencv_contrib .罗列一下自己在配置的过程中遇到的问题:1. CMake Error at D:/opencv_contrib-3.2.0/modules/dnn/cmake/download_protobuf.cmake:23 (ocv_download): Unknown CMake c
2017-04-07 08:30:47 4208
原创 单精度浮点数 二进制的转换 C++实现
//将单精度浮点数,转换为十进制string MySystem::FloatToBinaryByMemory(float num){ //只用内存中的结构来输出二进制结果 unsigned char *p = (unsigned char *)(&num); string Result(""); for (int i = sizeof(num)-1;i>=0;--i)
2016-10-31 19:26:50 8324 1
原创 不使用乘号 除号 计算两个数字的乘 和 除
//不使用*操作符,计算两个int类型的乘法int MySystem::Multi(int x1, int x2){ //先将其转换为大数,因为INT_MAX 的绝对值不能转换为INT_MIX,转换的结果的为INT_MAX+1,这将导致正溢出,变为负值 INT_MIN long long Lx1 = static_cast(x1); long long Lx2 = static_cast
2016-10-30 00:15:17 2001
计算文件或者字符串HASH,SHA1,SHA256,CRC32,MD5值
2018-11-21
绘制B样条曲线,并根据X坐标,反求Y坐标。稍加改动,可根据Y坐标,反求X坐标
2018-11-21
windows 截屏工具 封装的类
2018-10-03
window核心编程书籍 源代码
2017-04-07
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人