Windows下配置QT OpenCV

來源:互聯網
上載者:User

標籤:replace   ide   app   plain   widget   nbsp   size   oar   upload   

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 
  1. #-------------------------------------------------  
  2. #  
  3. # Project created by QtCreator 2012-05-07T12:27:37  
  4. #  
  5. #-------------------------------------------------  
  6.   
  7. QT       += core gui  
  8.   
  9. TARGET = test_opencv  
  10. TEMPLATE = app  
  11.   
  12.   
  13. SOURCES += main.cpp\  
  14.         widget.cpp  
  15.   
  16. HEADERS  += widget.h  
  17.   
  18. FORMS    += widget.ui  
  19.   
  20. INCLUDEPATH += E:\opencv\build\include\opencv\  
  21.                                  E:\opencv\build\include\opencv2\  
  22.                                  E:\opencv\build\include\  
  23.   
  24. LIBS        +=  E:\opencv_obj\lib\libopencv_calib3d240.dll.a\  
  25.                        E:\opencv_obj\lib\libopencv_core240.dll.a\  
  26.                        E:\opencv_obj\lib\libopencv_features2d240.dll.a\  
  27.                        E:\opencv_obj\lib\libopencv_flann240.dll.a\  
  28.                        E:\opencv_obj\lib\libopencv_gpu240.dll.a\  
  29.                        E:\opencv_obj\lib\libopencv_highgui240.dll.a\  
  30.                        E:\opencv_obj\lib\libopencv_imgproc240.dll.a\  
  31.                        E:\opencv_obj\lib\libopencv_legacy240.dll.a\  
  32.                        E:\opencv_obj\lib\libopencv_ml240.dll.a\  
  33.                        E:\opencv_obj\lib\libopencv_objdetect240.dll.a\  
  34.                        E:\opencv_obj\lib\libopencv_video240.dll.a  


widget.cpp:

 

 

[cpp] view plain copy 
  1. #include "widget.h"  
  2. #include "ui_widget.h"  
  3. #include  "highgui.h"  
  4. #include "cv.h"  
  5. #include "cxcore.h"  
  6.   
  7. Widget::Widget(QWidget *parent) :  
  8.     QWidget(parent),  
  9.     ui(new Ui::Widget)  
  10. {  
  11.     ui->setupUi(this);  
  12.   
  13.     IplImage *img = cvLoadImage("lena.jpg");  
  14.   
  15.     cvNamedWindow("jdh",CV_WINDOW_AUTOSIZE);  
  16.   
  17.     cvShowImage("jdh",img);  
  18.     cvWaitKey(0);  
  19.     cvReleaseImage(&img);  
  20.     cvDestroyWindow("jdh");  
  21. }  
  22.   
  23. Widget::~Widget()  
  24. {  
  25.     delete ui;  
  26. }  


運行結果:

 

 

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

Windows下配置QT OpenCV

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.