传统弱校HFUT的蒟蒻,真相只有一个

visual studio 2013 中配置OpenCV2.4.13 姿势

首先在path中添加

“C:\OpenCV\opencv\build\x64\vc12\bin”   (地址随实际变化)

注:添加的都是*86不使用*64

 

在visualstudio 2013中配

新建一个项目,选择控制台应用程序,把空项目勾上,确定

 

右键源文件,选择添加新建项,新建CPP文件,

 

点击  项目->属性

 

引用目录配置

选择配置属性-> VC++目录->包含目录

添加上C:\OpenCV\opencv\build\include

C:\OpenCV\opencv\build\include\opencv

C:\OpenCV\opencv\build\include\opencv2 这三个目录

 

 

库目录配置:和刚才一样,不过在库目录添加

C:\OpenCV\opencv\build\x86\vc12\lib

 

 

链接库配置

项目--> 属性--> 配置属性--> 链接器-->输入--> 附加的依赖项

opencv_ml2413d.lib
opencv_calib3d2413d.lib
opencv_contrib2413d.lib
opencv_core2413d.lib
opencv_features2d2413d.lib
opencv_flann2413d.lib
opencv_gpu2413d.lib
opencv_highgui2413d.lib
opencv_imgproc2413d.lib
opencv_legacy2413d.lib
opencv_objdetect2413d.lib
opencv_ts2413d.lib
opencv_video2413d.lib
opencv_nonfree2413d.lib
opencv_ocl2413d.lib
opencv_photo2413d.lib
opencv_stitching2413d.lib
opencv_superres2413d.lib
opencv_videostab2413d.lib
opencv_objdetect2413.lib
opencv_ts2413.lib
opencv_video2413.lib
opencv_nonfree2413.lib
opencv_ocl2413.lib
opencv_photo2413.lib
opencv_stitching2413.lib
opencv_superres2413.lib
opencv_videostab2413.lib
opencv_calib3d2413.lib
opencv_contrib2413.lib
opencv_core2413.lib
opencv_features2d2413.lib
opencv_flann2413.lib
opencv_gpu2413.lib
opencv_highgui2413.lib
opencv_imgproc2413.lib
opencv_legacy2413.lib
opencv_ml2413.lib

 

测试即可

#include <cv.h>
#include <fstream>
#include <highgui.h>
using namespace std;
int main()
{
    IplImage * test;

    test = cvLoadImage("C:\\Users\\Donser\\Desktop\\1-2.jpg");//图片路径
    cvNamedWindow("test_demo", 1);
    cvShowImage("test_demo", test);
    cvWaitKey(0);
    cvDestroyWindow("test_demo");
    cvReleaseImage(&test);
    return 0;
}

 

posted @ 2016-08-08 09:53  未名亚柳  阅读(1226)  评论(0编辑  收藏  举报