Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
274 views
in Technique[技术] by (71.8m points)

c++ - IP camera and OPENCV

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 how will I gonna do it. My OS is windows 7 64 bit. Thank you very much..

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...