Example 1(用Qt Console Application开发):
用QtCreator新建一个Qt Console Application的过程此处就省略掉。建立完后在main函数中输入以下代码:
#include
#include
#include
#include
using namespace cv;
int main(int argc, char *argv[])
{
// QCoreApplication a(argc, argv);
namedWindow( "src", WINDOW_AUTOSIZE );
Mat src1 = imread( "lena.jpg" );
while(1)
{
imshow( "src", src1 );
char c = waitKey(30);
if( 27==c )
return 0;
}
// return a.exec();
}