当前位置:网站首页>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;
}
边栏推荐
猜你喜欢
生物制药产业发展现状和趋势展望
成为优秀架构师必备技能:怎样才能画出让所有人赞不绝口的系统架构图?秘诀是什么?快来打开这篇文章看看吧!...
RecSys'22|CARCA: Cross-Attention-Aware Context and Attribute Recommendations
【报错】Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ‘concat‘)
千万级乘客排队系统重构&压测方案总结篇
Shell nl命令详解(显示行号、读取文件)
SRM供应商管理系统如何助力口腔护理企业实现采购战略的转型升级
OpenCV安装、QT、VS配置项目设置
B005 – 基于STC8的单片机智能路灯控制系统
程序员架构修炼之道:如何设计“易理解”的系统架构?
随机推荐
访问域名直接访问wordpress
基于ORB-SLAM2的改进代码
Topology零部件拆解3D可视化解决方案
数字化采购管理系统开发:精细化采购业务流程管理,赋能企业实现“阳光采购”
【二叉树】奇偶树
小贝拉机器人是朋友_普渡科技召开新品发布会,新一代送餐机器人“贝拉”温暖登场...
QPalette调色板、框架色彩填充
食品安全 | 新鲜食品vs速食食品,哪一种是你的菜?
频域分析实践介绍
B002 - Embedded Elderly Positioning Tracking Monitor
银行案例|Zabbix跨版本升级指南,4.2-6.0不香吗?
后台管理系统的权限思路
2022年深圳市临床医学研究中心申请指南
关于Mysql服务无法启动的问题
LeaRun.net快速开发动态表单
【R语言】线性混合模型进行重复测量设计分析
关系运算符和if,else语句
tooltip control
2022年深圳市促进大健康产业集群高质量发展的若干措施
理财产品的月年化收益率怎么算?