update 更新图片处理,点位比较方法,夹爪控制

This commit is contained in:
FrankCV2048
2024-12-15 12:50:30 +08:00
parent e2b60094b3
commit 45a9b18a96
11 changed files with 188 additions and 182 deletions

View File

@ -11,11 +11,13 @@ def cv2_to_qpixmap(cv_img):
# img = cv_img.copy()
# cv_img = cv2.cvtColor(cv_img, cv2.COLOR_BGR2RGB)
try:
height, width, channel = cv_img.shape
img = cv_img.copy()
height, width, channel = img.shape
bytes_per_line = 3 * width
q_img = QImage(cv_img.data, width, height, bytes_per_line, QImage.Format_RGB888)
q_img = QImage(img.data, width, height, bytes_per_line, QImage.Format_RGB888)
return QPixmap.fromImage(q_img)
except Exception as e:
print(e)
log.log_message(logging.ERROR,e)
return None