自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(62)
  • 收藏
  • 关注

原创 stl:find _first_of与search用法

#include #include #include using namespace std; int main() { string str("i love you"); string str1 = "youf"; string::iterator ix = search(str.begin(), str.end(), str1.begin

2017-06-21 09:02:52 574

原创 c++ 11多线程例子 opencv读入视频设置滚动条

#include #include #include#includeusing namespace cv;using namespace std;#define WINDOW_NAME "video"int g_frame = 1;int g_max_frame;bool flag = false;void on_Trackbar(int, void*){ flag

2017-06-09 14:25:55 1452

原创 OpenCV2Mat属性type,depth,step

在OpenCV2中Mat类无疑使占据着核心地位的,前段时间初学OpenCV2时对Mat类有了个初步的了解,见OpenCV2:Mat初学。这几天试着用OpenCV2实现了图像缩小的两种算法:基于等间隔采样和基于局部均值的图像缩小,发现对Mat中的数据布局和一些属性的认知还是懵懵懂懂,本文对Mat的一些重要属性和数据布局做一个总结。 Mat的作用The class Mat represen

2017-06-06 21:49:35 472

原创 CvArr、Mat、CvMat、IplImage、BYTE转换(总结而来)

一、Mat类型:矩阵类型,Matrix。    在openCV中,Mat是一个多维的密集数据数组。可以用来处理向量和矩阵、图像、直方图等等常见的多维数据。    Mat有3个重要的方法:         1、Mat mat = imread(const String* filename);            读取图像         2、imshow(const string 

2017-06-06 21:48:54 459

原创 OPENCV获取相应区域,加滚动条C++版

#include#includeusing namespace std;using namespace cv;#define WINDOW_NAME "video"#define LEFT_NAME "left"#define RIGHT_NAME "right"int g_frame=1;int g_max_frame;bool flag = false;void on

2017-06-06 19:43:12 584

原创 opencv相关函数c++版

C++版本的好处:1、在于可以尽量避免使用指针这种危险的东西;2、不用费心去release资源了,因为在其destructor里面,系统会自动帮你搞定。3、在某些情况下会比C版本运行速度快。在文件中包含 using namespace cv;1.        imread(cvLoadImage):loads an image from a file;

2017-05-26 11:05:56 870

原创 基于Hog特征的行人检测

1、先建立相应的txt文件F:\pedestrian\image_00000101_0.pngF:\pedestrian\image_00000105_0.pngF:\pedestrian\image_00000108_0.pngF:\pedestrian\image_00000110_0.pngF:\pedestrian\image_00000115_0.pngF:\pe

2017-05-09 17:08:58 1196

原创 Vibe背景建模

1、" ViBe.h"#pragma once #include #include "opencv2/opencv.hpp" using namespace cv; using namespace std; #define NUM_SAMPLES 20 //每个像素点的样本个数 #define MIN_MATCHES 2 //#min

2017-05-09 17:06:26 797

原创 图像特征提取三大法宝:HOG特征,LBP特征,Haar特征

(一)HOG特征1、HOG特征:方向梯度直方图(Histogram of Oriented Gradient, HOG)特征是一种在计算机视觉和图像处理中用来进行物体检测的特征描述子。它通过计算和统计图像局部区域的梯度方向直方图来构成特征。Hog特征结合SVM分类器已经被广泛应用于图像识别中,尤其在行人检测中获得了极大的成功。需要提醒的是,HOG+SVM进行行人检测的方法是法国

2017-05-06 16:13:42 1058

原创 给定一个字符串,问是否能够通过添加一个字母将其变成“回文串”

题目描述 给定一个字符串,问是否能够通过添加一个字母将其变成“回文串”。 “回文串”是指正着和反着读都一样的字符串。如:”aa”,”bob”,”testset”是回文串,”alice”,”time”都不是回文串。#include#include#include#includeusing namespace std;bool check(char *str)//判断

2017-05-06 11:29:04 2702 1

原创 翻转数组

题目描述 给定一个长度为n的整数数组a,元素均不相同,问数组是否存在这样一个片段,只将该片段翻转就可以使整个数组升序排列。其中数组片段[l,r]表示序列a[l], a[l+1], ..., a[r]。原始数组为a[1], a[2], ..., a[l-2], a[l-1], a[l], a[l+1], ..., a[r-1], a[r], a[r+1], a[r+2], ...,

2017-04-28 11:21:48 337

原创 C++重写(覆盖)、重载、重定义、多态

1 重写(覆盖)override  override是重写(覆盖)了一个方法,以实现不同的功能。一般用于子类在继承父类时,重写(覆盖)父类中的方法。函数特征相同,但是具体实现不同。重写需要注意:被重写的函数不能是static的,必须是virtual的重写函数必须有相同的类型,名称和参数列表重写函数的访问修饰符可以不同。尽管virtual是private的,派生类中重写改写为

2017-04-22 18:51:18 609

原创 10.排序及相关操作

序号功能函数名称说明1排序Sort以很好的平均效率排序stable_sort排序,并维持相同元素的原有顺序partial_sort将序列的前一部分排好序partial_sort_copy复制的同时将序列的前一部分

2017-03-22 09:29:49 385

原创 9.变异算法

1、copy#include#includeusing namespace std;int main(){ int a[] = { 1, 2, 3, 4, 5 }; int b[5]; copy(a, a + 5, b); copy(a, a + 5, ostream_iterator(cout, " ")); cout << endl; copy(b, b + 5, o

2017-03-21 12:31:52 1918

原创 8.非变异算法

1、for_each#include#include#includeusing namespace std;class Print{private: int sum; int max; int min; int count;public: Print() :count(0), sum(0) {} int GetSum() { return sum; } int

2017-03-20 20:26:48 529

原创 7.通用容器

1、bitset用法#include#include#includeusing namespace std;int main(){ bitsets1; cout << "初始化内存空间内容:" << s1.to_string() << endl; cout << s1.size() << " " << s1.count() << endl; s1.set(2,true);

2017-03-20 19:32:35 331

原创 3.迭代器

#include#includeusing namespace std;int main(){ cout << "input data" << endl; istream_iteratora(cin); istream_iteratorb; while (1) { cout << *a << endl; a++; if (a == b) { break;

2017-03-19 20:28:17 265

原创 排序算法-类编写

#include#include#define N 1000class SqList{public: void BubbleSort(SqList *L); //冒泡排序 void BubbleSort2(SqList *L); //改进的冒泡排序 void SelectSort(SqList *L); //选择排序 void InsertSort(SqList *L)

2017-03-18 10:32:53 435

原创 获取时间和计算时间差的几种方法总结

获取时间和计算时间差的几种方法总结转载自:http://blog.csdn.net/coder_xia/article/details/6566708一、标准C和C++都可用1、获取时间用time_t time( time_t * timer ),计算时间差使用double difftime( time_t timer1, time_t timer0 )。 精确到秒。

2017-03-17 09:17:01 4803

原创 多线程例子

#include #include using namespace std;DWORD WINAPI Fun1Proc( LPVOID lpParameter // thread data);DWORD WINAPI Fun2Proc( LPVOID lpParameter // thread data);int index=0;int tickets=100;

2017-02-25 09:03:12 533

原创 定时自动打开网页并截图

由于工作原因,需要定时获取某个网站的信息,改程序可以提供无人监管的自动截图1、主程序#include #include#include "stdafx.h"#include "SC.h"#include using namespace std;int main(){ while(1){ SYSTEMTIME ct; GetLocalTime(&ct)

2017-01-09 10:53:36 3898

原创 删除字符串中空格

#include#includeusing namespace std;string erasespace(string s){ string str = s; int count = 0; for (int i = 0; i < s.size(); i++) { if (s[i] != ' ') str[i-count] = s[i]; else coun

2017-01-08 15:25:27 333

原创 不用+、-、×、÷对两个整数求和

不用+、-、×、÷对两个整数求和。思路: 主要分成3步: 第一步不考虑进位,对每一位相加。0加0与1加1的结果都0,0加1与1加0的结果都是1。我们可以注意到,这和异或的结果是一样的。对异或而言,0和0、1和1异或的结果是0,而0和1、1和0的异或结果是1。 接着考虑第二步进位,对0加0、0加1、1加0而言,都不会产生进位,只有1加1时,会向前产生一个进位。此时我们可以想象成是

2016-12-14 22:05:41 870

原创 c++ string与数值类型(如int)相互转换

string与数值类型相互转换有以下几种方法:方法一,使用stringstream流进行转换C++中将形如"1234"的string字符串转化为int型整数”里所介绍的方法其实是将string字符串先转换为C风格的字符串,再利用C语言提供的库函数atoi将字符串转换为整型数。这种方法严格来说不是C++的做法,因为C++本身就提供了字符串与整型数之间的互换,那就是利用stri

2016-12-10 16:53:55 4545

原创 c++类的简单实例

输入学生的学号,以及三门课程成绩,输出平均成绩,并输出是否通过(假如任意一门成绩小于60则没通过)#include #include using namespace std;class Student{public: void setStudent(string num, int chi, int mat, int eng) { number = num; Chi

2016-12-09 14:16:25 18177

原创 C语言字符串操作总结大全

1)字符串操作 strcpy(p, p1) 复制字符串 strncpy(p, p1, n) 复制指定长度字符串 strcat(p, p1) 附加字符串 strncat(p, p1, n) 附加指定长度字符串 strlen(p) 取字符串长度 strcmp(p, p1) 比较字符串 strcasecmp忽略大小写比较字符串strncmp(p, p1, n) 比较指定长

2016-12-06 09:04:04 408

原创 光流法目标跟踪

#include #include #include #include #include #include using namespace std;using namespace cv;void tracking(Mat &frame, Mat &output);bool addNewPoints();bool acceptTrackedPoint(int i);//

2016-12-03 14:58:06 2085 1

原创 光流法 HS与LK

1、HS算法#include "cv.h"#include "highgui.h"#include #include #include "opencv2/legacy/legacy.hpp"#define CVX_GRAY50 cvScalar(100)#define CVX_WHITE cvScalar(255)int main(int argc, char** argv)

2016-12-03 14:55:33 7003

原创 Kalman跟踪

#include "cv.h"#include "highgui.h"#include int main(int argc, char** argv){ /* A matrix data */ const float A[] = { 1, 1, 0, 1 }; IplImage* img = cvCreateImage( cvSize(500,500), 8,

2016-12-03 14:52:20 406

原创 运动背景建模

#include "cv.h"#include "highgui.h"#include #include #include #include // various tracking parameters (in seconds)const double MHI_DURATION = 0.5;const double MAX_TIME_DELTA = 0.5;const doub

2016-12-03 14:50:56 602

原创 背景建模检测

#include #include #include int main( int argc, char** argv ){ //声明IplImage指针 IplImage* pFrame = NULL; IplImage* pFrImg = NULL; IplImage* pBkImg = NULL; CvMat* pFrameMat = NULL; CvMa

2016-12-03 14:49:53 456

原创 opencv自带的haar分类器进行人脸识别

1、识别一幅图片中的人脸个数,这里采用的是绝对路径,可自行修改   #include #include #include #include #include #include #include using namespace std;using namespace cv;int main(int argc, char* argv[]){

2016-11-28 14:46:45 7607

原创 图像缩放双立方插值

一直都在看别人用双三次插值,一直都没有概念,今天百度了一下,感觉和双三次样条原理类似,只不过计算简单点,自己也比较了两者的计算时间,双三次样条的时间确实要长些。一:数学原理如果已知一个函数f(x)以及它在x=0,x=1处的导数,那么函数可以在[0,1]之间插值,当函数表达为三次多项式时我们称之谓立方插值。一个三次多项式及其导数:        f

2016-11-19 14:34:41 1192

原创 OPENCV HS算法源码

#include "_cv.h"#define CONV( A, B, C) ( (float)( A + (B<<1) + C ) )typedef struct{ float xx; float xy; float yy; float xt; float yt; float alpha; /* alp

2016-11-19 14:33:15 1183

原创 Bumblebee双目测量基本原理

Bumblebee双目测量基本原理;见文件

2016-11-19 14:22:34 1275

原创 matlab学习

12天的努力,我看完了586页书,学了MATLAB,过得很累,但我心里很舒坦。我不用再为别的事情烦心了,因为我在一门心思的学习,我花了我将近所有的课余时间。只有这样,我才能用自己身体上的累来掩盖我自己心里面的累。这么多年了,几乎每天我都在自己的挣扎中度过。还好,一切就快过去,我有我自己的生活。我不要可怜,我不要虚心假意,我只要我自己过得好。别人能那么自私的对我,我为什么还要那样对他,值得吗?其实,

2016-11-19 14:17:37 7478 3

原创 OpenCV自带方法遍历目录下文件

Directory定义于contrib.hpp(v2.0以上),定义很简单就三个函数:class CV_EXPORTS Directory { public: static std::vector GetListFiles ( const std::string& path, const std::string & exten = "*", bool addPath = tr

2016-11-19 14:11:29 864

原创 OpenCV 行(高)与列(宽)参数顺序问题

OpenCV中行数(rows)和列数(cols)对应高(height)和宽(width),由于OpenCV1.0和OpenCV2.0的代码风格有所不同,所以在处理行和列这个细节上面需要多加注意,特别是函数参数的顺序,到底是先行后列还是先列后行。下面是我总结的一些情况:情况一(定义IplImage*):IplImage*dst = NULL;dst =cvCreate

2016-10-21 10:46:11 1610

原创 找出字符串中首先出现3次的字符

#include using namespace std;int main(){ char str[100]; cin.get(str, 100); int ch[26] = { 0 }; int i = 0; while (str[i] != '\0') { if (str[i] >= 'a'&&str[i] <= 'z') { int temp = str[i]

2016-10-10 14:57:38 1503 1

原创 6.函数对象 适配器的用法

#include#include#include#includeusing namespace std;int main(){ vector v; for (int i = 0; i < 10; i++) { v.push_back(i); } //小于5的个数 int ncount = count_if(v.begin(), v.end(), bind2nd(le

2016-10-04 19:11:07 267

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除