一,opencv下载
二,属性配置
x86:环境变量path中添加:D:\opencv300\build\x86\vc12\bin
x64:环境变量path中添加:D:\opencv300\build\x64\vc12\bin
一,右键项目打开属性管理器
VC++目录:
包含目录(include path):D:\opencv-3.0.0\opencv\build\include
D:\opencv-3.0.0\opencv\build\include\opencv
D:\opencv-3.0.0\opencv\build\include\opencv2
库目录(lib path):D:\opencv\build\x86\vc12\lib D:\opencv-3.0.0\opencv\build\x86\vc12\staticlib
链接器->输入->附加依赖项:opencv_ts300.lib;opencv_ts300d.lib;opencv_world300.lib
二,注意
1.缺少dll文件时,把D:\opencv\build\x86\vc12\bin里的dll文件复制C:\Windows\SysWOW64中
2.遇到Assertion failed (size.width>0 && size.height>0)错误时,可能是路径有问题:Mat pic = imread("1.png");换成Mat pic = imread("E://visual studio2013//Projects//ConsoleApplication1//ConsoleApplication1//Debug//1.png");
3.输入测试代码:
#include
#include
using namespace std;
using namespace cv;
void main()
{
Mat pic = imread("1.png");
imshow("test", pic);
//cout << "hello world" << endl;
waitKey();
}
三, 配置Kinect 2 环境
VC++目录——包含目录 添加:C:\Program Files\Microsoft SDKs\Kinect\v2.0_1409\inc
库目录 添加:C:\Program Files\Microsoft SDKs\Kinect\v2.0_1409\Lib\x86
链接器——输入——附加依赖 添加:Kinect20.lib
测试程序:Kinect测试程序
四,参考大神
【OpenCV入门教程之一】 安装OpenCV:OpenCV 3.0、OpenCV 2.4.8、OpenCV 2.4.9 +VS 开发环境配置