0
点赞
收藏
分享

微信扫一扫

Qt配置Opencv(无cmake)

i奇异 2022-04-27 阅读 82
Qtc++opencv

新建的Qt一定要

 

库文件

包含路径

 

 重启Qt

代码编写

 

#include "widget.h"
#include "ui_widget.h"
#include <opencv2/opencv.hpp>
using namespace cv;
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    Mat src = imread("D:/hutao.png");
    imshow("hutao",src);
    waitKey(0);
    destroyAllWindows();
}

Widget::~Widget()
{
    delete ui;
}

 

 

举报

相关推荐

0 条评论