随笔分类 -  opencv

摘要:CamShift的原理还是比较简单的,跟踪直方图特征搜索出目标进行跟踪,相对于meanShift,解决的尺度问题。代码如下:#include "opencv2/video/tracking.hpp"#include "opencv2/imgproc/imgproc.hpp"#include "opencv2/highgui/highgui.hpp"#include <iostream>#include <ctype.h>using namespace cv;using namespace std;Mat ima 阅读全文
posted @ 2012-11-02 21:02 行远_ 阅读(1783) 评论(0) 推荐(0)
摘要:opencv实现批量读图像序列,以函数的形式实现如下:void readImageSequenceFiles(char* imgFilePath,vector <string> &imgNames)//用vector <string>做存贮文件名的容器{ imgNames.clear(); int i=0; char tmpDirSpec[MAX_PATH+1]; char tmpDirPath[40]; sprintf (tmpDirSpec, "%s/*", imgFilePath);//*任意文件名 正则表达式 WIN32_FIND_D 阅读全文
posted @ 2012-10-19 21:30 行远_ 阅读(2866) 评论(0) 推荐(0)
摘要:#include <iostream>#include <vector>#include <opencv2/core/core.hpp>#include <opencv2/imgproc/imgproc.hpp>#include <opencv2/highgui/highgui.hpp>using namespace std;using namespace cv;int main(){ // Read input binary image Mat image= imread("./binaryGroup.bmp", 阅读全文
posted @ 2012-10-15 22:49 行远_ 阅读(41434) 评论(1) 推荐(2)
摘要://本代码为在视频帧中标记帧数,在第一帧鼠标取框的功能性测试程序#include <opencv2/core/core.hpp>#include <opencv2/highgui/highgui.hpp>#include <iostream>#include <stdio.h>#include <string.h>using namespace cv;using namespace std;Rect box; bool drawing_box = false;bool gotBB = false; void mouseHandler( 阅读全文
posted @ 2012-10-08 21:57 行远_ 阅读(1915) 评论(0) 推荐(0)
摘要:#include <opencv2/core/core.hpp>#include <opencv2/highgui/highgui.hpp>#include <iostream>#include <stdio.h>#include <string.h>using namespace cv;using namespace std;int main(){void draw_framecount(Mat Frame,int framecount);namedWindow("text");for (int count=1; 阅读全文
posted @ 2012-10-08 21:04 行远_ 阅读(6691) 评论(0) 推荐(0)
摘要:一、Opencv的Mat存贮图像是按照BGR来存的 M.create(4,4, CV_8UC3);for(int i=0;i<M.rows;i++){for (int j=0;j<M.cols;j++){M.at<Vec3b>(i,j)[0]=0;M.at<Vec3b>(i,j)[1]=0;M.at<Vec3b>(i,j)[2]=255;}}cout << "M = "<< endl ... 阅读全文
posted @ 2012-09-22 10:18 行远_ 阅读(375) 评论(0) 推荐(0)