opencv安装与配置vs2019

opencv安装

1.下载并解压opencv-4.5.4-vc14_vc15.exe

(1)官网下载Releases - OpenCVicon-default.png_t_M276https://opencv.org/releases/

或者:链接:https://pan.baidu.com/s/1R0T4FqXqDuqgA5Ukgphi9g 提取码:8n9b

官方下载注意:一定等秒数加载后显示download点击。

5ec8016a3eeb4a1db38b32eadc7184e1.png

3587153d04254646a4637e8d78c7be19.png

解压完一定是该目录!!!!!!

6dc881a0b8954872acc35300cc221a09.png

2.创建空项目 必须改成x64

cdefa1db66824ba9ba9e2f3fe7f39d0e.png

3.右键first(自己的工程项目)点击属性

3ea6640810544efa8b6164da313856fe.png

4.在包含目录中添加图片中D:/……/build/include

D:/……./include/opencv2

83eb0a2202f644c1a8be6d709d3d9d07.png

5.在库目录下同样添加4中的D:/……/build/include

D:/……./include/opencv2

64b3c38d194147d38f6b076979e7a2f8.png

6.在附加依赖项中添加自己所下版本中的opencv_world。。。。此处我的是opencv_world453d.lib

78184cf5875948db9d3357c54853fc21.png

7.在附加库目录中添加自己的lib目录,此处我的是D:\Vs studio graph\opencv\opencv\build\x64\vc15\lib

b816982a07f94190910f8716739d4a9c.png

8.点击控制面板………在环境变量中添加地址D:\Vs studio graph\opencv\opencv\build\bin

D:\Vs studio graph\opencv\opencv\build\x64\vc15\bin

根据自己的目录进行添加!!!

f557a758abc946bca510f7f8f7dfff76.png

9.将如下3个dll文件复制到C:\Windows\SysWOW64和C:\Windows\System32

360f27f51fdd4c0996ad969854728e62.pnge6a3fc917cdf42ddadc81656ad422ebe.png

10.测试官方代码

  1. // Test application for the Visual Studio Image Watch Debugger extension
  2. #include <iostream> // std::cout
  3. #include <opencv2/core/core.hpp> // cv::Mat
  4. #include <opencv2/imgcodecs/imgcodecs.hpp> // cv::imread()
  5. #include <opencv2/imgproc/imgproc.hpp> // cv::Canny()
  6. using namespace std;
  7. using namespace cv;
  8. void help()
  9. {
  10. cout
  11. << "----------------------------------------------------" << endl
  12. << "This is a test program for the Image Watch Debugger " << endl
  13. << "plug-in for Visual Studio. The program loads an " << endl
  14. << "image from a file and runs the Canny edge detector. " << endl
  15. << "No output is displayed or written to disk."
  16. << endl
  17. << "Usage:" << endl
  18. << "image-watch-demo inputimage" << endl
  19. << "----------------------------------------------------" << endl
  20. << endl;
  21. }
  22. int main(int argc, char* argv[])
  23. {
  24. help();
  25. if (argc != 2)
  26. {
  27. cout << "Wrong number of parameters" << endl;
  28. return -1;
  29. }
  30. cout << "Loading input image: " << argv[1] << endl;
  31. Mat input;
  32. input = imread(argv[1], IMREAD_COLOR);
  33. cout << "Detecting edges in input image" << endl;
  34. Mat edges;
  35. Canny(input, edges, 10, 100);
  36. return 0;
  37. }

发表评论

表情:
评论列表 (有 0 条评论,98人围观)

还没有评论,来说两句吧...

相关阅读

    相关 vs2019安装教程

    要开始敲代码了,得有开发工具 来看百度词条: Microsoft Visual Studio(简称VS)是美国[微软公司][Link 1]的[开发工具][Link 2]包系