opencv读取网络图片
#include <iostream> #include <opencv2/opencv.hpp> using namespace std; using namespace cv; int main() { VideoCapture videoCapture("https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fjunshi-pic.china.com%2Fhandcover%2F202101%2F27%2F1611710230_78708400.jpg&refer=http%3A%2F%2Fjunshi-pic.china.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1614339658&t=ee65a9a5a9d07469ebfa8d70f87b244b"); Mat img1; videoCapture.read(img1); if (img1.empty()) { return -1; } imshow("win1", img1); waitKey(0); return 0; }