当前位置:网站首页>win10+opencv3.2+vs2015配置
win10+opencv3.2+vs2015配置
2022-07-29 05:19:00 【科学财子】
先前查了一些关于win10+opencv3.0(2.xx)+vs配置的文章,准备以此为样本来配置一下新的vs2015+opencv3.2+win10,但结果都失败了,最终自己的一些摸索,终于得到了正确的配置方法(此次最新版本的配置方法简单了许多)。
第一步还是系统环境变量配置。系统环境中,在点击编辑,然后新建一个系统变量。而这个环境变量的值就是你的opencv解压放置的文件中的cv14.bin的路径。比如我吧opencv解压的文件的文件放在d盘一个opencv文件中,所有就有环境变量的值为:D:\opencv\opencv\build\x64\vc14\bin。
第二步:系统环境变量配置好了,就直接在vs2015中再进行配置,不需要重启电脑(本人亲测)。vc++,win32控制台程序,可以选择空项目(也可以不选)。然后再视图中找到属性管理器,展开其中内容,在debug|X64选项中右击(或者双击),然后选择添加新项目属性表,之后就自己命名(opencv官网上命名为opencv_debug与opencv_release,在此与其保持一致,你也可以命名别的名字)
在通用属性--->vc++目录--->包含目录,编辑,填写包含opencv文件中的include文件及include文件下的opencv,opencv2文件的路径(直接点击后面的“···”,就可以直接浏览)
之后在库目录中添加一个opencv文件中的build--->X64--->vc14--->lib的路径就可以了
第三步:在本属性表的链接器中选择输入项,添加依赖项,手工输入opencv_world320d.lib就可以了。
本步切记不要在链接器常规中的添加附加库目录添加东西,否则将报错——无法打开opencv_world320.lib。(但有些博文上提到3.0以前的好像可以在链接器——》常规中添加某些东西,在3.2似乎不行,添加之后运行直接报错,本人亲测)
关于配置就差不多了,后面就随便找个网上的程序测试一下就可以了。这简单附一个(改一下imaread中的图片地址):
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
using namespace cv;
using namespace std;
int main(int argc, char** argv)
{
Mat image = imread("E:\\picture\\27b58PICm6Q_1024.jpg");
namedWindow("测试图片");
imshow("测试", image);
waitKey(6000);
return 0;
}
如果你配置中遇到什么问题,可以留言给我哦,我也想多学习一下哦
边栏推荐
- DAY6:利用 PHP 编写登陆页面
- Seay源代码审计系统
- Liang Yuqi, founder of aitalk: the link between image and virtual reality
- Related knowledge of elastic box
- JS simple code determines whether the device that opens the page is the PC end of the computer, the H5 end of the mobile phone, or the wechat end
- uniapp组件之选择选项(如套餐选择)
- Relationship between redrawing and reflow
- Windows下cmd窗口连接mysql并操作表
- Hcia-r & s self use notes (27) comprehensive experiment
- 移动端-flex项目属性
猜你喜欢
HCIA-R&S自用笔记(26)PPP
MySQL decompressed version windows installation
DAY15(DAY16拓展):文件包含漏洞
与开源项目同步开发& CodeReview & Pull Request & fork怎么拉取原始仓库
Laravel服务容器(上下文绑定的运用)
Fantom (FTM) 价格将在未来几天飙升 20%
DAY5:PHP 简单语法与使用
Basic concepts of MySQL + database system structure + extended application + basic command learning
Windows下cmd窗口连接mysql并操作表
Summary of knowledge points related to forms and forms
随机推荐
Question swiping Madness - leetcode's sword finger offer58 - ii Detailed explanation of left rotation string
[C language series] - detailed explanation of file operation (Part 1)
Selection options of uniapp components (such as package selection)
弹性盒子flex
麦当娜“Hellbent”购买130万美元的nft无聊猿,现在被认为太贵了
新手入门:手把手从PHP环境到ThinkPHP6框架下载
ThinkPHP6 输出二维码图片格式 解决与 Debug 的冲突
MySQL decompressed version windows installation
Day14: upload labs customs clearance tutorial
【无标题】
7 月 28 日 ENS/USD 价值预测:ENS 吸引巨额利润
大部分PHP程序员,都搞不懂如何安全代码部署
365 day challenge leetcode 1000 questions - day 035 one question per day + two point search 13
Relationship between redrawing and reflow
The openatom openharmony sub forum was successfully held, and ecological and industrial development entered a new journey
Liang Yuqi, founder of aitalk: the link between image and virtual reality
Merge the same items in the same column in table
Clickhouse learning (VIII) materialized view
js简单代码判断打开页面的设备是电脑PC端或手机H5端或微信端
【TypeScript】TypeScript中类型缩小(含类型保护)与类型谓词