IP camera and OPENCV

前端 未结 1 1307
别那么骄傲
别那么骄傲 2020-12-18 16:33

Good day!

I am using Dev-C++ as my IDE and the library OpenCV. I need to fetch the video taken by my IP camera and process it using the OpenCV. Can someone teach me

相关标签:
1条回答
  • 2020-12-18 17:11

    if it's a recent opencv version, this might work:

    Mat frame;
    namedWindow("video", 1);
    VideoCapture cap("http://150.214.93.55/mjpg/video.mjpg");
    while ( cap.isOpened() )
    {
        cap >> frame;
        if(frame.empty()) break;
    
        imshow("video", frame);
        if(waitKey(30) >= 0) break;
    }   
    

    one way or the other, opencv seems to insist, that the url must end with ".mjpg" (dot mjpg), so if it doesn't, add a dummy param to it, like : my/fancy/url?type=.mjpg

    0 讨论(0)
提交回复
热议问题