搞了半天, 可算弄好了.
vs opencv cpp:
https://blog.csdn.net/weixin_50918736/article/details/130176469?spm=1001.2101.3001.6650.1&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1-130176469-blog-127627204.235%5Ev39%5Epc_relevant_anti_t3&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1-130176469-blog-127627204.235%5Ev39%5Epc_relevant_anti_t3&utm_relevant_index=2
https://blog.csdn.net/Feeryman_Lee/article/details/106114718
测试代码
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
using namespace std;
using namespace cv;
int main()
{
Mat img = imread("C:\\1.bmp");
namedWindow("测试");
imshow("测试", img);
waitKey(0);
return 0;
}
以上2个博客一起使用才行. 把里面配置都弄上就可以了.
成功的图片: