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 (*)")