用QtCreator新建一个Qt Console Application的过程此处就省略掉。建立完后在main函数中输入以下代码:
#include <QCoreApplication> #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> using namespace cv; int main(int argc, char *argv[]) { // QCoreApplication a(argc, argv); namedWindow( "src"