#include "stdafx.h" #include <stdio.h> #include <opencv2/opencv.hpp> #include <iostream> #include <stdio.h> #include "opencv.hpp" int main(){ CvCapture *camera=cvCaptureFromFile("rtsp://192.168.1.19:554/0/1:1/main"); if (camera==NULL) printf("camera is null\n"); else printf("camera is not null"); cvNamedWindow("img"); while (cvWaitKey(10)!=atoi("q")){ IplImage *img=cvQueryFrame(camera); cvShowImage("img",img); } cvReleaseCapture(&camera); }
int main(int argc, char* argv[]) { cv::Ptr<CvCapture> capture = cvCaptureFromFile("rtsp://192.168.1.19:554/0/1:1/main"); cv::namedWindow("Frame"); for (;;) { cv::Mat frame = cvQueryFrame(capture); cv::imshow("Frame", frame); if (cv::waitKey(1) >= 0) break; } return 0; }
delete
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)