update 更新一键投料,优化设置文字,添加平滑,假装解决闪退

This commit is contained in:
FrankCV2048
2024-12-19 23:29:35 +08:00
parent da31ce91b6
commit cd7e354cbd
10 changed files with 15194 additions and 2121 deletions

View File

@ -1,7 +1,7 @@
import logging
import cv2
from PIL.ImageQt import QImage, QPixmap
from PySide6.QtGui import QPixmap, QImage
from Util.util_log import log
@ -11,11 +11,11 @@ def cv2_to_qpixmap(cv_img):
# img = cv_img.copy()
# cv_img = cv2.cvtColor(cv_img, cv2.COLOR_BGR2RGB)
try:
img = cv_img.copy()
height, width, channel = img.shape
bytes_per_line = 3 * width
q_img = QImage(img.data, width, height, bytes_per_line, QImage.Format_RGB888)
return QPixmap.fromImage(q_img)
height, width, channel = cv_img.shape
bytes_per_line = channel * width
q_image = QImage(cv_img.data, width, height, bytes_per_line, QImage.Format_RGB888)
pixmap = QPixmap.fromImage(q_image)
return pixmap
except Exception as e:
print(e)
log.log_message(logging.ERROR,e)