1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00

24 lines
529 B
C++

#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <opencv.hpp>
#include <highgui.hpp>
MainWindow::MainWindow ( QWidget* parent ) :
QMainWindow ( parent ),
ui ( new Ui::MainWindow )
{
ui->setupUi ( this );
// read an image
cv::Mat image = cv::imread ( "./tt.png", 1 );
// create image window named "My Image"
cv::namedWindow ( "OpenCV Image" );
// show the image on window
cv::imshow ( "OpenCV Image", image );
}
MainWindow::~MainWindow()
{
delete ui;
}