#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <iostream>
int main(int argc, char **argv) {
using namespace std;
IplImage *pFrame = NULL, *srcImage = NULL;
CvCapture *pCapture = NULL;
pCapture = cvCreateFileCapture("rtsp://192.168.1.10:554/user=admin&password=admin&channel=1&stream=1.sdp?real_stream");
if (!pCapture) {
printf("Can not get the video stream from the camera!\n");
return NULL;
}
while (1) {
if (srcImage == NULL)
{
pFrame = cvQueryFrame(pCapture);
srcImage = cvCloneImage(pFrame);
cvCircle(srcImage,cvPoint(pFrame->width/2, pFrame->height/2),5, CV_RGB(255, 0, 0),1,8,0); // 在视频中心处画圆
cvShowImage("123234", srcImage);
citytech摄像头 opencv+rtsp获得图像
最新推荐文章于 2024-05-17 16:42:57 发布
本文介绍了如何利用OpenCV库通过RTSP协议从Citytech摄像头获取实时图像,提供了RTSP地址的格式说明。
摘要由CSDN通过智能技术生成