首页 > 代码库 > Windows下配置QT OpenCV
Windows下配置QT OpenCV
OpenCV-Study:Windows下配置OpenCV
本文博客链接:http://blog.csdn.net/jdh99,作者:jdh,转载请注明.
环境:
主机:XP
OpenCV版本:2.4.0
说明:
配置参考链接:
http://blog.csdn.net/youhaipeng/article/details/7452972
http://blog.csdn.NET/youhaipeng/article/details/7453034
测试代码:
.pro文件
[plain] view plain copy
- #-------------------------------------------------
- #
- # Project created by QtCreator 2012-05-07T12:27:37
- #
- #-------------------------------------------------
- QT += core gui
- TARGET = test_opencv
- TEMPLATE = app
- SOURCES += main.cpp\
- widget.cpp
- HEADERS += widget.h
- FORMS += widget.ui
- INCLUDEPATH += E:\opencv\build\include\opencv\
- E:\opencv\build\include\opencv2\
- E:\opencv\build\include\
- LIBS += E:\opencv_obj\lib\libopencv_calib3d240.dll.a\
- E:\opencv_obj\lib\libopencv_core240.dll.a\
- E:\opencv_obj\lib\libopencv_features2d240.dll.a\
- E:\opencv_obj\lib\libopencv_flann240.dll.a\
- E:\opencv_obj\lib\libopencv_gpu240.dll.a\
- E:\opencv_obj\lib\libopencv_highgui240.dll.a\
- E:\opencv_obj\lib\libopencv_imgproc240.dll.a\
- E:\opencv_obj\lib\libopencv_legacy240.dll.a\
- E:\opencv_obj\lib\libopencv_ml240.dll.a\
- E:\opencv_obj\lib\libopencv_objdetect240.dll.a\
- E:\opencv_obj\lib\libopencv_video240.dll.a
widget.cpp:
[cpp] view plain copy
- #include "widget.h"
- #include "ui_widget.h"
- #include "highgui.h"
- #include "cv.h"
- #include "cxcore.h"
- Widget::Widget(QWidget *parent) :
- QWidget(parent),
- ui(new Ui::Widget)
- {
- ui->setupUi(this);
- IplImage *img = cvLoadImage("lena.jpg");
- cvNamedWindow("jdh",CV_WINDOW_AUTOSIZE);
- cvShowImage("jdh",img);
- cvWaitKey(0);
- cvReleaseImage(&img);
- cvDestroyWindow("jdh");
- }
- Widget::~Widget()
- {
- delete ui;
- }
运行结果:
http://blog.csdn.net/jdh99/article/details/7542049
Windows下配置QT OpenCV
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。