def openFilePressed(self):
self._path = self._fileDialog.\
getOpenFileName(self, "Image Files (*.png *.jpg)")
if self._path[0] != "":
self._pixmap = QPixmap(self._path[0])
size = QSize(160, 90)
pix = self._pixmap.scaled(size,
transformMode=Qt.SmoothTransformation)
self._lbl.setPixmap(pix)
self._image = Image.open(self._path[0])
text = pytesseract.image_to_string(self._image)
self._line.setText(text)
评论列表
文章目录