Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Using VideoCapture class you can open web image as we open video file. See the example below.

    VideoCapture cap;
    if(!cap.open("http://docs.opencv.org/trunk/_downloads/opencv-logo.png")){
    cout<<"Cannot open image"<<endl;
     return -1;
     }

    Mat src;
    cap>>src;
    imshow("src",src);
    imwrite("image.jpg",src);
    waitKey();

Using VideoCapture class you can open web image as we open video file. See the example below.

    VideoCapture cap;
    if(!cap.open("http://docs.opencv.org/trunk/_downloads/opencv-logo.png")){
     cout<<"Cannot open image"<<endl;
     return -1;
     }

    Mat src;
    cap>>src;
    imshow("src",src);
    imwrite("image.jpg",src);
    waitKey();