OPENCV 2.4.10安装
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
一、VS2020安装opencv2.4.10
1.1首先安装vs2010
安装这个就不用多谈了
1.2下载opencv-
2.4.10.exe,并解压到
最后会在
1.3添加系统变量
在系统变量path后添加:C:\opencv\opencv\build\x86\vc10\bin
1.4新建vc++控制台工程项目,配置
1.4.1项目属性->配置属性->VC++目录->包含目录
添加
C:\opencv\opencv\build\include
C:\opencv\opencv\build\include\opencv
C:\opencv\opencv\build\include\opencv2
1.4.2项目属性->配置属性->VC++目录->引用目录
添加
C:\opencv\opencv\build\x86\vc10\lib
1.4.3项目属性->链接器->输入->附加依赖项
在debug模式下添加
配置方案为Debug的配置,添加:(2410代表我的opencv版本是2.4.10,需要对应更改)
opencv_calib3d2410d.lib
opencv_contrib2410d.lib
opencv_core2410d.lib
opencv_features2d2410d.lib
opencv_flann2410d.lib
opencv_gpu2410d.lib
opencv_highgui2410d.lib
opencv_imgproc2410d.lib
opencv_legacy2410d.lib
opencv_ml2410d.lib
opencv_nonfree2410d.lib
opencv_objdetect2410d.lib opencv_ocl2410d.lib
opencv_photo2410d.lib
opencv_stitching2410d.lib
opencv_superres2410d.lib
opencv_ts2410d.lib
opencv_video2410d.lib
opencv_videostab2410d.lib
配置方案为Release的配置,添加:
opencv_calib3d2410.lib
opencv_contrib2410.lib
opencv_core2410.lib
opencv_features2d2410.lib opencv_flann2410.lib
opencv_gpu2410.lib
opencv_highgui2410.lib
opencv_imgproc2410.lib
opencv_legacy2410.lib
opencv_ml2410.lib
opencv_nonfree2410.lib
opencv_objdetect2410.lib
opencv_ocl2410.lib
opencv_photo2410.lib
opencv_stitching2410.lib
opencv_superres2410.lib
opencv_ts2410.lib
opencv_video2410.lib
opencv_videostab2410.lib
二、工程中新建一个CPP文件,
#include
#include
#include
using namespace cv;
int main()
{
Mat img=imread("d:\\aaa.bmp");//读入一张图片
namedWindow("Test");//创建一个名为Test窗口
imshow("Test",img);//窗口中显示图像
waitKey(5000);//等待5000ms后窗口自动关闭
}