opencv安装与配置vs2019

opencv安装

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

(1)官网下载 Releases – OpenCV opencv安装与配置vs2019https://opencv.org/releases/

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

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

opencv安装与配置vs2019

opencv安装与配置vs2019

解压后一定是这个目录! ! ! ! ! !

opencv安装与配置vs2019

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

opencv安装与配置vs2019

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

opencv安装与配置vs2019

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

D:/……./include/opencv2

opencv安装与配置vs2019

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

D:/……./include/opencv2

opencv安装与配置vs2019

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

opencv安装与配置vs2019

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

opencv安装与配置vs2019

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

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

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

opencv安装与配置vs2019

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

opencv安装与配置vs2019opencv安装与配置vs2019

10.测试官方代码

// Test application for the Visual Studio Image Watch Debugger extension
#include <iostream>                        // std::cout
#include <opencv2/core/core.hpp>           // cv::Mat
#include <opencv2/imgcodecs/imgcodecs.hpp>     // cv::imread()
#include <opencv2/imgproc/imgproc.hpp>     // cv::Canny()
using namespace std;
using namespace cv;
void help()
{
    cout
        << "----------------------------------------------------" << endl
        << "This is a test program for the Image Watch Debugger " << endl
        << "plug-in for Visual Studio. The program loads an     " << endl
        << "image from a file and runs the Canny edge detector. " << endl
        << "No output is displayed or written to disk."
        << endl
        << "Usage:" << endl
        << "image-watch-demo inputimage" << endl
        << "----------------------------------------------------" << endl
        << endl;
}
int main(int argc, char* argv[])
{
    help();
    if (argc != 2)
    {
        cout << "Wrong number of parameters" << endl;
        return -1;
    }
    cout << "Loading input image: " << argv[1] << endl;
    Mat input;
    input = imread(argv[1], IMREAD_COLOR);
    cout << "Detecting edges in input image" << endl;
    Mat edges;
    Canny(input, edges, 10, 100);
    return 0;
}

文章出处登录后可见!

已经登录?立即刷新

共计人评分,平均

到目前为止还没有投票!成为第一位评论此文章。

(0)
青葱年少的头像青葱年少普通用户
上一篇 2022年3月21日 上午11:21
下一篇 2022年3月21日 上午11:39

相关推荐