#include<stdio.h>#include<stdlib.h>#include<opencv2\opencv.hpp>#include<iostream>using namespace std;using namespace cv;int main(){ char* name = "1.jpg"; Mat img = imread("D:\\1.jpg"); //填入绝对地址,其实相对地址也行 if(img.empty()) { printf("NO"); return -1; } //判断是否已经读入了图片 imshow("image",img); //展示图片 waitKey(); return 0;}
时间: 2024-10-10 00:10:42