Opencv实现播放视频/连接rtsp流/打开摄像头

#ifndef OPENCV_H
#define OPENCV_H
#include 
#include 
#include 
#include 

using namespace std;
using namespace cv;

int myOpencv()
{
 
    VideoCapture cap;

    cap.open("http://ivi.bupt.edu.cn/hls/cctv5phd.m3u8");//打开流

     // cap.open(0);//打开摄像头
      if(!cap.isOpened())
      {
          cout<<"can not filed"<<endl;
      }
    Mat frame;
    while (1)
    {
          cap >> frame;
        if (frame.empty())
        {
         break;
        }
        imshow("Exameple2",frame);
        if (waitKey(33) >= 0) break;
    }

    return 0;
}
#endif // OPENCV_H

你可能感兴趣的:(人脸识别)