标签:name str namespace ini init std cap struct 学习笔记
#include <iostream> #include "opencv2/opencv.hpp" using namespace std; using namespace cv; int main( int argc, char** argv ) { /* VideoCapture cap(0); //open the default camera */ VideoCapture cap( "test.flv" ); if ( !cap.isOpened() ) { cerr << "Can not open a camera or file." << endl; return(-1); } Mat edges; namedWindow( "edges", 1 ); namedWindow( "frame", 1 ); for (;; ) { Mat frame; cap >> frame; //get a new frame from cap if ( frame.empty() ) break; imshow( "frame", frame ); cvtColor( frame, edges, CV_BGR2GRAY ); Canny( edges, edges, 0, 30, 3 ); imshow( "edges", edges ); if ( waitKey( 30 ) >= 0 ) break; } /* the camera will be deinitialized automatically in VideoCapture destructor */ return(0); }
标签:name str namespace ini init std cap struct 学习笔记
原文地址:http://www.cnblogs.com/yunfung/p/7618081.html