unbuntu 安装:http://blog.csdn.net/cocoaqin/article/details/78163171
windows 安装:https://jingyan.baidu.com/article/64d05a025a686bde54f73b54.html
1.图片读取
http://blog.csdn.net/hujingshuang/article/details/47184717
include <iostream>
#include <opencv2/highgui/highgui.hpp> using namespace cv;
using namespace std; int main()
{
//①老版
IplImage *pic = cvLoadImage("lena.jpg", );
cvShowImage("load", pic);
cvWaitKey();
//②新版
Mat img = imread("lena.jpg");
imshow("read", img);
waitKey(); return ;
}
2.颜色空间转换
http://www.360doc.com/content/13/1202/14/10724725_333867110.shtml
3.视频读取
基本操作,其中 capture>>frame; if (frame.empty()){break;}语句等效于if (!captrue.read(frame))。
#include <cv.h>
#include "stdafx.h"
#include <opencv2\opencv.hpp>
using namespace cv; int _tmain(int argc, _TCHAR* argv[])
{
VideoCapture capture;
capture.open("E:\\Workspace\\OpenCV\\test\\video\\video.avi");
while(true)
{
Mat frame;
capture>>frame; if (frame.empty())
{
break;
}
imshow("readvideo",frame);
waitKey();
}
return ;
}
4.直方图
5.矩阵Mat
http://blog.csdn.net/yc461515457/article/details/48720165
MAT矩阵计算:http://blog.csdn.net/iracer/article/details/51296631
6.计算时间
GetTickcount函数:它返回从操作系统启动到当前所经的计时周期数。
getTickFrequency函数:返回每秒的计时周期数。
http://blog.csdn.net/u013476464/article/details/42419831
7.Mat, vector<point2f>,Iplimage等等常见类型转换
http://www.cnblogs.com/SevenTien/archive/2013/01/29/2882066.html