Opencv-study:windows under Configuration OpenCV
This blog link: http://blog.csdn.net/jdh99, author: jdh, reprint please specify.
Environment:
Host: XP
OpenCV version: 2.4.0
Description
To configure a reference link:
http://blog.csdn.net/youhaipeng/article/details/7452972
http://blog.csdn.NET/youhaipeng/article/details/7453034
Test code:
. Pro Files
[Plain]View PlainCopy
- #-------------------------------------------------
- #
- # 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 PlainCopy
- #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;
- }
Operation Result:
http://blog.csdn.net/jdh99/article/details/7542049
Configuring QT OpenCV under Windows