After successfully configuring your Qt-Creator with OpenCV library, its now time to get your hands dirty with the openCV programming. Here I have created a simple sample program which loads the picture from your drive named hello.jpg. Its really simple Smile

Here is the code for main.cpp

  1: #include <opencv/cv.h>
  2: #include <opencv/highgui.h>
  3: #include <QtGui/QApplication>
  4: #include "mainwindow.h"
  5: 
  6: int main(int argc, char *argv[]){   
  7:     QApplication a(argc, argv);    
  8:     MainWindow w;    
  9:     w.show();  
 10:     IplImage* img = cvLoadImage( "C:\hello.jpg" ); 
 11:                     //load the image     
 12:     cvNamedWindow( "Example1", CV_WINDOW_AUTOSIZE );  
 13:     cvShowImage( "Example1", img ); 
 14:     cvWaitKey(0);  
 15:     cvReleaseImage( &img );  
 16:     cvDestroyWindow( "Example1" ); 
 17:     return a.exec();
 18: }
You will get output like this…
openCV_op



You can download the above project for OpenCV2.2 here.