当前位置:网站首页>OpenCV installation, QT, VS configuration project settings
OpenCV installation, QT, VS configuration project settings
2022-08-01 17:43:00 【little engineer】
opencv下载、安装
OpenCV官网下载exe,双击即可解压(其实是个压缩包)
Then install it yourselfVC15的bin路径添加到环境变量(VC2017及之后是VC15版本,之前版本是VC14)
// 两者的区别是:d:代表debug版本,非d则是release版本
opencv_world451.lib
opencv_world451d.lib
VS项目配置
VS设置:
注意:vs设置中,文件路径是右斜杠 \(winHow the system file manager is identified),But the programming file uses a left slash /
参考视频教程:B站教程
(文件相对路径,以.slnThe project management file is the current directory,.\
代表当前目录,..\
代表上级目录,..\..\
Represents the upper-level directory) (相对路径:相对路径里面的“相对”实际上指的是以工程文件XXX.vcproj为起点进行计算的路径,所以用 . to name the root directory of a relative path,如.\include That is, it refers to a subdirectory of the current project directoryincludelook for header files.)
Basic stuff to install:
- 知识:VC++目录和C/C++的区别:
- VC++ Directories(VC++目录)的变量是一个Windows环境变量,和操作系统----控制面板----高级系统设置----The environment variables added in the environment variables are the same,Paths under this directory are only in VS中有效.
- C/C++The settings in are used to set command line parameters,只针对当前工程.
- VSInside the relative path of the project“相对”实际上指的是以工程文件XXX.vcproj为起点进行计算的路径,所以用 . to name the root directory of a relative path,如.\include That is, it refers to a subdirectory of the current project directoryincludelook for header files.
**0:创建工程模板
目录结构:
- binfile as the running directory of the project,且包含了opencvSome dynamic link libraries, etc.
- include文件夹包含了opencv的include头文件.
- lib文件夹放opencv的静态链接库
1:配置输出目录
以slnThe location of the project is used as a reference location,The output directory suffix should be added\右斜杠;
2:调试目录,The same as the output directory.Which directory is placed underdllResource files such as dynamic libraries and images
3:附件包含目录,即opencv的源文件、头文件
4:附加库目录:
5:输入库,其中331d的d代表debug版本
6:为了测试方便,The console can be opened
7:QT头文件路径
Basic run template
#include <opencv2/core.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui.hpp>
using namespace cv;
int main(int argc, char *argv[])
{
Mat image = imread("1.png"); //The image needs to be placeddebug或者release文件夹下,That is, the running directory of the program
namedWindow("img");
moveWindow("img", 512, 0); //图像显示窗口的位置移动
imshow("img", image);
waitKey(0);
destroyAllWindows();
return 0;
}
边栏推荐
猜你喜欢
随机推荐
SQL函数 TO_CHAR(一)
Topology Parts Disassembly 3D Visualization Solution
金仓数据库KingbaseES安全指南--6.4. RADIUS身份验证
主流小程序框架性能分析
GRUB2的零日漏洞补丁现已推出
[ACNOI2022]物品
LeaRun.net快速开发动态表单
hcip第九天
Sftp中文件名乱码
研发团队数字化转型实践
2022年深圳市促进大健康产业集群高质量发展的若干措施
深入分析类加载器
成都理工大学&电子科技大学|用于强化学习的域自适应状态表示对齐
zabbix部署和简单使用
快速抽取resnet_v2_152中间的特征层
指针和解引用
JumpServer堡垒机部署
下载 | 谷歌科学家Kevin P. Murphy发布新书《概率机器学习:高级主题》
晶振工作原理详解
星途一直缺颠覆性产品?青岛工厂这款M38T,会是个突破点?