当前位置:网站首页>How to permanently configure local opencv4.5.5 for vs2019
How to permanently configure local opencv4.5.5 for vs2019
2022-07-01 06:46:00 【SteveDraw】
Catalog :
Preface :
Due to actual development requirements , Need to put OpenCV original edition ( namely C and C++ Compiling ) Generate .dll( Dynamic link library ) for .Net Of C# Application usage , So we need to build a new one C++ Empty project to generate .dll. Therefore, it needs to be configured VS Tools and OpenCV The connection between , So make a special record and share experience , For your reference !
Environmental Science :windows10 pro +vs2019+opencv4.5.5
One , Download and install OpenCV
- If necessary , To specify the corresponding detailed version , It is suggested to go to the official website to download !
- If you just browse the source code , You can go to GitHub Corresponding warehouse learning view !
Click on The website links , Download the corresponding version you need to use , But what's worth noting here is , The version is not a random choice , To be used with you VS Version correspondence is good !( It is associated with the following configuration ) Reference to the corresponding version is given below ( Latest , The actual use will be different ):
VC Version number | VS Corresponding version |
---|---|
vc6 | VC6.0 |
vc7 | VS2002 |
vc7.1 | VS2003 |
vc8 | VS2005 |
vc9 | VS2008 |
vc10 | VS2010 |
vc11 | VS2012 |
vc12 | VS2013 |
vc13 | VS2014 |
vc14 | VS2015 |
vc15 | VS2017 |
vc16 | VS2019 |
- After jumping out of the following interface , Automatically download files after accounting ( This version is about 200 many m):
- After downloading , Open the installation file , And click unzip inside , Then automatically decompress !
- After decompression , You can accomplish it !
- Then you need to configure the environment variables of the system , Click OK after completing the following , It's better to restart it !
Two , To configure vs
- stay vs2019 Next , New empty project :
- Click View -> Other windows -> Property Manager
As shown below , Right click on the Microsoft.Cpp.x64.user, It's normal if you don't have this choice ( I asked online vs2019 Most don't have this , It needs to be replaced with vs2017), But there is a faster and more convenient way : Will be Microsoft.Cpp.x64.user Your computer can copy and paste the relevant configuration files into the corresponding directory on your computer , Find the table of contents “C:\Users\“ Your username ”\AppData\Local\Microsoft”,( Generally, it does not display AppData Folder , You need to check... In the folder view option “ Hidden items ” Make it visible ). Will download okay file MSBuild( Click to download ) Unzip and put it in the file directory :
- If configured as Debug, choice opencv_world455d.lib
- If Release, choice opencv_world455.lib
stay demo.cpp Add the following code under the file :
#include <opencv2/opencv.hpp>
#include "opencv2/imgcodecs/legacy/constants_c.h"
using namespace std;
using namespace cv;
void main(int argc, char* argv[]) {
// Read the image from the file
Mat img = imread("D:\\Z-File\\cv\\1.jpg", 1);
Mat dst;
// If reading in the image fails
if (img.empty()) {
printf(" Failed to open picture !\n");
}
namedWindow("RGB", WINDOW_AUTOSIZE);
imshow("RGB", img);
cvtColor(img, dst, COLOR_BGR2GRAY);
namedWindow("GRAY", WINDOW_AUTOSIZE);
imshow("GRAY", dst);
printf(" Test success ! Succeed in putting rgb Convert image to grayscale image !");
// This function waits for the key to be pressed , Press any key on the keyboard to return to
waitKey(0);
}
The above code is mainly a RGB The original image is converted to a grayscale image , And print out the prompt of success and the window of two figures !
Compile runtime , The following configuration is required !
If , The configuration is successful !
- After the above configuration is so successful , In the future, new projects don't need to be configured every time !
3、 ... and , Other articles recommend
- openc4.5.2 vs2019 Installation tutorial And the emergence of LNK110: Can't open file “opencv_world410d.lib Solutions for
- vs2019 LNK1104: Can't open file opencv_world3412d.obj
- C# call C++ Generated .dll File error : Exception in external component
- opencv4 The above version reports an error :CV_LOAD_IMAGE_COLOR and CV_BGR2HSV and CV_CAP_PROP_FRAME_WIDTH
- Visual Studio 2019 How to build a new one Win32 project
- 【OpenCV One of the introductory tutorials 】 install OpenCV:OpenCV 3.0、OpenCV 2.4.8、OpenCV 2.4.9 +VS Development environment configuration This blog post and bloggers highly recommend , Inside OpenCV Very detailed , Unfortunately, the blogger has gone ( The boss of geese factory )!
- win10 Next VS2019 To configure opencv-4.5.2 Environment configuration tutorial
Identifier not defined “CV_BGR2GRAY“
- The last thing I want to say is ,vs It's a big hole , Suggest using opencv and vs Not so new , Because the newer the words are vs The more difficult it is to configure , It is also recommended that you do not update to win11, Bigger pit , Finally installed successfully , You have to be roast MS Of !
- If there are deficiencies in the text , it is respectful to have you criticize and correct sth !
边栏推荐
- 代码实战——从零开始搭建自己的Diffusion models/Score-based generative models
- WiFi settings for raspberry Pie 4
- How to use SCI hub
- Chapter V input / output (i/o) management
- Docker installation and deployment redis
- 解决无法读取META-INF.services里面定义的类
- 嵌入式系统
- Several ways of gson's @jsonadapter annotation
- Methods of downloading Foreign Periodicals
- 问题解决:OfficeException: failed to start and connect(一)
猜你喜欢
产品学习(一)——结构图
Insufficient free space after clearing expired cache entries - consider increasing the maximum cache space
mysql学习
发现了一个 MySQL 的巨坑:update 更新别再用影响行数做判断了!!!
How to use Alibaba vector font files through CDN
(上)苹果有开源,但又怎样呢?
MySQL learning
2022 Jiangsu Vocational College skills competition (secondary vocational school) network construction and application open competition volume
C language course set up student elective course system (big homework)
为什么这么多人转行产品经理?产品经理发展前景如何?
随机推荐
3. Disabling copy construction
The code generator has eliminated the styling of xxxx js as it exceeds the max of 500kb
sci-hub如何使用
【微信小程序】一文解决button、input、image组件
Internet worm
How to use SCI hub
Jena基于OWL的默认推理查询
如何通过cdn方式使用阿里巴巴矢量图字体文件
Several ways of gson's @jsonadapter annotation
产品学习(三)——需求列表
C language course design student information management system (big homework)
在支付宝上买基金安全吗?哪里可以买基金
嵌入式系统
Product learning (III) - demand list
Product learning (II) - competitive product analysis
数据库笔记
常用快捷键
为什么这么多人转行产品经理?产品经理发展前景如何?
【微信小程序】如何搭积木式开发?
(I) apple has open source, but so what?