在Raspberry Pi上使用PySide2构建GUI条形码阅读器

本文介绍了如何利用Dynamsoft Barcode Reader SDK和PySide2在Raspberry Pi上构建GUI条形码阅读器应用。讨论了在Python中处理UI和条形码识别的线程问题,并提出了使用Python Process解决方案来避免GIL限制,以确保UI流畅性。最后,提到了应用的跨平台兼容性。
摘要由CSDN通过智能技术生成

Dynamsoft Barcode Reader SDK一款多功能的条码读取控件,只需要几行代码就可以将条码读取功能嵌入到Web或桌面应用程序。这可以节省数月的开发时间和成本。能支持多种图像文件格式以及从摄像机或扫描仪获取的DIB格式。使用Dynamsoft Barcode Reader SDK,你可以创建强大且实用的条形码扫描仪软件,以满足你的业务需求。

点击下载Dynamsoft Barcode Reader最新版

如果要使用Python和Qt构建跨平台的GUI应用程序,则可以使用PyQt或PySide。它们都是Python的Qt绑定。主要区别在于许可证:PyQt5是根据GPL还是商业PySide2发布,而根据则发布LGPL。由于正式建议使用PySide2,因此我将使用PySid2和Dynamsoft Python条形码SDK在Raspberry Pi上创建GUI条形码读取器应用程序。

要求

OpenCV Python

python3 -m pip install opencv-python

Dynamsoft Python条形码SDK

python3 -m pip install dbr

PySide2

sudo apt-get install python3-pyside2.qt3dcore python3-pyside2.qt3dinput python3-pyside2.qt3dlogic python3-pyside2.qt3drender python3-pyside2.qtcharts python3-pyside2.qtconcurrent python3-pyside2.qtcore python3-pyside2.qtgui python3-pyside2.qthelp python3-pyside2.qtlocation python3-pyside2.qtmultimedia python3-pyside2.qtmultimediawidgets python3-pyside2.qtnetwork python3-pyside2.qtopengl python3-pyside2.qtpositioning python3-pyside2.qtprintsupport python3-pyside2.qtqml python3-pyside2.qtquick python3-pyside2.qtquickwidgets python3-pyside2.qtscript python3-pyside2.qtscripttools python3-pyside2.qtsensors python3-pyside2.qtsql python3-pyside2.qtsvg python3-pyside2.qttest python3-pyside2.qttexttospeech python3-pyside2.qtuitools python3-pyside2.qtwebchannel python3-pyside2.qtwebsockets python3-pyside2.qtwidgets python3-pyside2.qtx11extras python3-pyside2.qtxml python3-pyside2.qtxmlpatterns python3-pyside2uic

Raspberry Pi OS的GUI条形码阅读器

让我们开始使用UI小部件:

  • 用于加载图像文件的按钮:
self.btn = QPushButton("Load an image")
self.btn.clicked.connect(self.pickFile)

def pickFile(self):
    filename = QFileDialog.getOpenFileName(self, 'Open file',
                                            self._path, "Barcode images (*)")
    
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值