문제

my ipcam's iphttp://admin:@192.168.1.124:80/
who can teach me how to use opencv2.4.3 to write the true program to connect to ipcam i hope can give me the complete program to reference thanks a lot

도움이 되었습니까?

해결책

basic camera boilerplate, no matter what input:


#include "opencv2/highgui/highgui.hpp"
#include "opencv2/core/core.hpp"

using namespace cv;

int main()
{
    VideoCapture cap("http://admin:@192.168.1.124:80/"); // connect to an ip-cam ( might need some additional dummy param like: '?type=mjpeg' at the end
    //VideoCapture cap("/home/me/some.avi"); // load a video file
    //VideoCapture cap(-1); // get the 1st 'local' usb webcam
    while( cap.isOpened() )
    {
        Mat frame;
        if ( ! cap.read(frame) )
            break;

        //
        // your processing here
        //

        imshow("lalala",frame);
        int k = waitKey(10);
        if ( k==27 )
            break;
    }
    return 0;
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top