✤ May 12, 2016 ✤
我就找地记录下配置过程.
修改pro文件的内容, 加入
INCLUDEPATH += \
D:/OpenCV/include \
D:/OpenCV/include/opencv/ \
D:/OpenCV/include/opencv2/
LIBS += \
D:/OpenCV/mingw/x86/mingw/lib/libopencv_calib3d310.dll.a \
D:/OpenCV/mingw/x86/mingw/lib/libopencv_core310.dll.a \
D:/OpenCV/mingw/x86/mingw/lib/libopencv_features2d310.dll.a \
D:/OpenCV/mingw/x86/mingw/lib/libopencv_flann310.dll.a \
D:/OpenCV/mingw/x86/mingw/lib/libopencv_highgui310.dll.a \
D:/OpenCV/mingw/x86/mingw/lib/libopencv_imgcodecs310.dll.a \
D:/OpenCV/mingw/x86/mingw/lib/libopencv_imgproc310.dll.a \
D:/OpenCV/mingw/x86/mingw/lib/libopencv_ml310.dll.a \
D:/OpenCV/mingw/x86/mingw/lib/libopencv_objdetect310.dll.a \
D:/OpenCV/mingw/x86/mingw/lib/libopencv_photo310.dll.a \
D:/OpenCV/mingw/x86/mingw/lib/libopencv_shape310.dll.a \
D:/OpenCV/mingw/x86/mingw/lib/libopencv_stitching310.dll.a \
D:/OpenCV/mingw/x86/mingw/lib/libopencv_superres310.dll.a \
D:/OpenCV/mingw/x86/mingw/lib/libopencv_ts310.a \
D:/OpenCV/mingw/x86/mingw/lib/libopencv_video310.dll.a \
D:/OpenCV/mingw/x86/mingw/lib/libopencv_videoio310.dll.a \
D:/OpenCV/mingw/x86/mingw/lib/libopencv_videostab310.dll.a
//当然D盘什么的地址是我当前的盘符地址, 记得改一下嗷, 还有libs中 x.dll.a文件由于opencv版本不一样, 可能有差别
在main.cpp中添加一个测试代码吧
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using namespace cv;
int main()
{
//声明IplImage指针
IplImage*pImg;
//载入图片
pImg=cvLoadImage("e:/a.jpg",1);
//创建窗口
cvNamedWindow("my",1);
//显示图像
cvShowImage("my",pImg);
//等待按键
cvWaitKey(0);
//销毁窗口
cvDestroyWindow("my");
//释放图像
cvReleaseImage(&pImg);
return 0;
}
能运行就说明安装ok啦, 嗯, 我去玩opencv去了~