折腾了一下午,终于在win7上的VS2013上成功配置了OpenCV。主要参考了一篇很给力的文章 http://my.phirobot.com/blog/2014-02-opencv_configuration_in_vs.html#id15
附上我模仿的第一个使用OpenCV的小代码:
#include <iostream>
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
int main()
{
Mat img = imread("pp.jpg");
if (img.empty())
{
cout << "error!" << endl;
return -1;
}
imshow("my first program\n", img);
waitKey();
return 0;
}
截个图看看效果: