当前位置:网站首页>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 !
边栏推荐
- 下载外文期刊的方法
- SQL语言的学习记录一
- 解决The code generator has deoptimised the styling of xxxx.js as it exceeds the max of 500kb
- (I) apple has open source, but so what?
- Terminology description in the field of software engineering
- Product learning (III) - demand list
- Several ways of gson's @jsonadapter annotation
- rclone配置minio及基本操作
- 自动化测试平台(十三):接口自动化框架与平台对比及应用场景分析及设计思路分享
- Router 6/ 以及和Router5 的区别
猜你喜欢

解决kaniko push镜像到harbor时报错(代理导致):unexpected status code 503 Service Unavailable

Esp32 esp-idf GPIO key interrupt response

Promise

Esp32 monitors the battery voltage with ULP when the battery is powered

【微信小程序】一文解决button、input、image组件

2022 Jiangsu Vocational College skills competition (secondary vocational school) network construction and application open competition volume

Product learning (III) - demand list

Some pits designed by NOC

下载外文期刊的方法

Design of sales management system for C language course (big homework)
随机推荐
JSON module
Is the account opening of Huafu securities safe and reliable? How to open Huafu securities account
Figure out the difference between event coordinates screenx, clientx, pagex and offsetx
三说 拷贝构造之禁用
Gson的@JsonAdater注解的几种方式
Idea easy to use plug-in summary!!!
下载外文期刊的方法
Find the original array for the inverse logarithm
H5网页判断是否安装了某个APP,安装则跳转未安装则下载的方案总结
Spark入门(一篇就够了)
Notes on probability theory
2022 Jiangsu Vocational College skills competition (secondary vocational school) network construction and application open competition volume
Internet worm
SQL statement
为什么这么多人转行产品经理?产品经理发展前景如何?
启牛学堂合作的证券公司是哪家?开户安全吗?
K8s set up redis cluster
常用快捷键
转行做产品经理,如何挑选产品经理课程?
Product learning (II) - competitive product analysis

