opencv2.4.10+VS2013安装

下载

opencv官网:http://opencv.org/downloads.html
百度云:http://pan.baidu.com/s/1mhLwrrU

安装

双击opencv-2.4.10,选择要解压到的文件夹

配置环境变量

右击计算机->属性->高级系统设置->环境变量
在用户变量中新建OpenCV变量,如E:\applications\opencv2.4.10\opencv\build
再编辑系统变量中的Path变量,再最后加上%OpenCV%\x86\vc12\bin(如果是64位就是x64,依据个人情况修改)。

配置vs2013工程

工程配置包含目录
E:\applications\opencv2.4.10\opencv\build\include;
E:\applications\opencv2.4.10\opencv\build\include\opencv;
E:\applications\opencv2.4.10\opencv\build\include\opencv2;
这三个目录。
注意,根据自己不同的路径修改;

工程配置库目录
E:\applications\opencv2.4.10\opencv\build\x64\vc12\lib;

工程配置链接输入的附加依赖项
Debug:
opencv_ml2410d.lib
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_objdetect2410d.lib
opencv_ts2410d.lib
opencv_video2410d.lib
opencv_nonfree2410d.lib
opencv_ocl2410d.lib
opencv_photo2410d.lib
opencv_stitching2410d.lib
opencv_superres2410d.lib
opencv_videostab2410d.lib

Release:
opencv_objdetect2410.lib
opencv_ts2410.lib
opencv_video2410.lib
opencv_nonfree2410.lib
opencv_ocl2410.lib
opencv_photo2410.lib
opencv_stitching2410.lib
opencv_superres2410.lib
opencv_videostab2410.lib
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

验证是否安装成功

#include <iostream>  
#include <opencv2/core/core.hpp>  
#include <opencv2/highgui/highgui.hpp>  
using namespace cv;
int main()
{
    Mat img = imread("1.jpg");//读入一张图片
    namedWindow("Test");      //创建一个名为Test窗口
    imshow("Test", img);   //窗口中显示图像
    waitKey(5000);            //等待5000ms后窗口自动关闭
}

此程序功能为显示一张图片,工程文件夹下要放置一张图片1.jpg。

已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页