update 更新表格处理,更新添加自由路径,更新了重连机制
This commit is contained in:
@ -1,25 +1,33 @@
|
|||||||
import logging
|
|
||||||
|
|
||||||
import PySide6
|
|
||||||
import cv2
|
import cv2
|
||||||
from PyQt5.QtGui import QImage, QPixmap
|
from PIL.ImageQt import QImage, QPixmap
|
||||||
|
|
||||||
from Util.util_log import log
|
|
||||||
|
|
||||||
|
|
||||||
def cv2_to_qpixmap(cv_img):
|
def cv2_to_qpixmap(cv_img):
|
||||||
"""将OpenCV图像转换为QPixmap"""
|
"""将OpenCV图像转换为QPixmap"""
|
||||||
if cv_img.shape !=3:
|
height, width, channel = cv_img.shape
|
||||||
print("cv_img.shape !=3")
|
bytes_per_line = 3 * width
|
||||||
return None
|
q_img = QImage(cv_img.data, width, height, bytes_per_line, QImage.Format_RGB888)
|
||||||
try:
|
return QPixmap.fromImage(q_img)
|
||||||
img = cv_img.copy()
|
|
||||||
height, width, channel = img.shape
|
# def cv2_to_qpixmap(cv_img):
|
||||||
bytes_per_line = 3 * width
|
# """将OpenCV图像转换为QPixmap"""
|
||||||
q_img = QImage(img.data, width, height, bytes_per_line, QImage.Format_RGB888)
|
# if len(cv_img.shape) !=3:
|
||||||
return QPixmap.fromImage(q_img)
|
# print("cv_img.shape !=3")
|
||||||
except Exception as e:
|
# return None
|
||||||
log.log_message(logging.ERROR, e)
|
# try:
|
||||||
return None
|
# 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)
|
||||||
|
# except Exception as e:
|
||||||
|
# log.log_message(logging.ERROR, e)
|
||||||
|
# return None
|
||||||
|
|
||||||
|
|
||||||
|
# def cv2_to_qpixmap(cv_img):
|
||||||
|
# #g = cv2.cvtColor(cv_img, cv2.COLOR_BGR2RGB)
|
||||||
|
# height, width, channel = cv_img.shape
|
||||||
|
# bytes_per_line = 3 * width
|
||||||
|
# q_img = QImage(cv_img.data, width, height, bytes_per_line, QImage.Format_RGB888)
|
||||||
|
# return QPixmap.fromImage(q_img)
|
||||||
|
|||||||
Reference in New Issue
Block a user