第一次写CSDN,随手记录一下。
做毕设过程中用到的,在这里存档,也是分享一下。
原文使用的是opencv4.5,我自己用的opencv341.3,有一点点改动。
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <iostream>
using namespace cv;
using namespace std;
/ Images //
int main() {
string path = "Resources/test.png";
Mat img = imread(path);
namedWindow("game");//原文章没有这个,当时我做时显示出来的图片会闪退,所以加了一个这个。
imshow("Image", img);
waitKey(0);
return 0;
}