Configuring QT OpenCV under Windows

Source: Internet
Author: User

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
  1. #-------------------------------------------------
  2. #
  3. # Project created by Qtcreator 2012-05-07t12:27:37
  4. #
  5. #-------------------------------------------------
  6. QT + + Core GUI
  7. TARGET = Test_opencv
  8. TEMPLATE = App
  9. SOURCES + = Main.cpp\
  10. Widget.cpp
  11. HEADERS + = Widget.h
  12. FORMS + = Widget.ui
  13. Includepath + = E:\opencv\build\include\opencv\
  14. E:\opencv\build\include\opencv2\
  15. E:\opencv\build\include\
  16. LIBS + = E:\opencv_obj\lib\libopencv_calib3d240.dll.a\
  17. E:\opencv_obj\lib\libopencv_core240.dll.a\
  18. E:\opencv_obj\lib\libopencv_features2d240.dll.a\
  19. E:\opencv_obj\lib\libopencv_flann240.dll.a\
  20. E:\opencv_obj\lib\libopencv_gpu240.dll.a\
  21. E:\opencv_obj\lib\libopencv_highgui240.dll.a\
  22. E:\opencv_obj\lib\libopencv_imgproc240.dll.a\
  23. E:\opencv_obj\lib\libopencv_legacy240.dll.a\
  24. E:\opencv_obj\lib\libopencv_ml240.dll.a\
  25. E:\opencv_obj\lib\libopencv_objdetect240.dll.a\
  26. E:\opencv_obj\lib\libopencv_video240.dll.a


Widget.cpp:

[CPP]View PlainCopy
  1. #include "Widget.h"
  2. #include "Ui_widget.h"
  3. #include "highgui.h"
  4. #include "Cv.h"
  5. #include "cxcore.h"
  6. Widget::widget (Qwidget *parent):
  7. Qwidget (parent),
  8. UI (new Ui::widget)
  9. {
  10. UI->SETUPUI (this);
  11. Iplimage *img = cvloadimage ("lena.jpg");
  12. Cvnamedwindow ("Jdh", cv_window_autosize);
  13. Cvshowimage ("JDH", IMG);
  14. Cvwaitkey (0);
  15. Cvreleaseimage (&IMG);
  16. Cvdestroywindow ("Jdh");
  17. }
  18. Widget::~widget ()
  19. {
  20. Delete UI;
  21. }


Operation Result:

http://blog.csdn.net/jdh99/article/details/7542049

Configuring QT OpenCV under Windows

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.