实现效果

#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <opencv/cv.h>
#include <opencv/highgui.h>
#include <zbar.h>
#include <time.h>
#include <iostream>
using namespace std;
using namespace zbar;
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
cam = NULL;
timer = new QTimer(this);
imag = new QImage();
connect(timer, SIGNAL(timeout()), this, SLOT(readFrame()));
connect(timer, SIGNAL(timeout()), this, SLOT(scancode()));
connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(on_pushButton_cliked()));
connect(ui->pushButton_2, SIGNAL(clicked()), this, SLOT(on_pushButton_2_clicked()));
}
MainWindow::~MainWindow()
{
delete ui;
cvRelea

本文介绍如何结合Qt、OpenCV和ZBar库来实现在应用程序中进行条码扫描和识别的功能。通过Qt创建界面,利用OpenCV处理图像,借助ZBar进行条码解码,实现了一种高效且易于集成的条码识别解决方案。

1274

被折叠的 条评论
为什么被折叠?



