opencv 学习入门篇

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", 1);  
    cvShowImage("load", pic);  
    cvWaitKey(0);  
    //②新版  
    Mat img = imread("lena.jpg");  
    imshow("read", img);  
    waitKey(0);  
  
    return 0;  
}  

 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(10);  
    }  
     return 0;     
}  

 

4.直方图

http://www.opencv.org.cn/opencvdoc/2.3.2/html/doc/tutorials/imgproc/histograms/histogram_calculation/histogram_calculation.html

5.矩阵Mat

http://www.opencv.org.cn/opencvdoc/2.3.2/html/doc/tutorials/core/mat%20-%20the%20basic%20image%20container/mat%20-%20the%20basic%20image%20container.html

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

posted @ 2017-09-14 11:15  amazingym  阅读(305)  评论(0编辑  收藏  举报