opencv
文章平均质量分 71
飞翔在蓝天
这个作者很懒,什么都没留下…
展开
-
opencv坐标系测试
#include //#include //#include #includeusing namespace std;using namespace cv;int main(){ Mat image, image_3c; image.create(Size(256, 256), CV_8UC1); image_3c.create(Size(256, 256),原创 2016-09-06 17:01:37 · 808 阅读 · 0 评论 -
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 · 1474 阅读 · 0 评论 -
OpenCV2Mat属性type,depth,step
在OpenCV2中Mat类无疑使占据着核心地位的,前段时间初学OpenCV2时对Mat类有了个初步的了解,见OpenCV2:Mat初学。这几天试着用OpenCV2实现了图像缩小的两种算法:基于等间隔采样和基于局部均值的图像缩小,发现对Mat中的数据布局和一些属性的认知还是懵懵懂懂,本文对Mat的一些重要属性和数据布局做一个总结。 Mat的作用The class Mat represen原创 2017-06-06 21:49:35 · 480 阅读 · 0 评论 -
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 · 470 阅读 · 0 评论 -
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 · 596 阅读 · 0 评论 -
基于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 · 1211 阅读 · 0 评论 -
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 · 915 阅读 · 0 评论 -
图像特征提取三大法宝:HOG特征,LBP特征,Haar特征
(一)HOG特征1、HOG特征:方向梯度直方图(Histogram of Oriented Gradient, HOG)特征是一种在计算机视觉和图像处理中用来进行物体检测的特征描述子。它通过计算和统计图像局部区域的梯度方向直方图来构成特征。Hog特征结合SVM分类器已经被广泛应用于图像识别中,尤其在行人检测中获得了极大的成功。需要提醒的是,HOG+SVM进行行人检测的方法是法国原创 2017-05-06 16:13:42 · 1071 阅读 · 0 评论 -
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 · 7662 阅读 · 0 评论 -
光流法目标跟踪
#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 · 2102 阅读 · 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 · 7035 阅读 · 0 评论 -
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 · 415 阅读 · 0 评论 -
运动背景建模
#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 · 617 阅读 · 0 评论 -
背景建模检测
#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 · 465 阅读 · 0 评论 -
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 · 875 阅读 · 0 评论 -
OpenCV 行(高)与列(宽)参数顺序问题
OpenCV中行数(rows)和列数(cols)对应高(height)和宽(width),由于OpenCV1.0和OpenCV2.0的代码风格有所不同,所以在处理行和列这个细节上面需要多加注意,特别是函数参数的顺序,到底是先行后列还是先列后行。下面是我总结的一些情况:情况一(定义IplImage*):IplImage*dst = NULL;dst =cvCreate原创 2016-10-21 10:46:11 · 1661 阅读 · 0 评论 -
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 · 819 阅读 · 0 评论