update 更新图片处理,点位比较方法,夹爪控制
This commit is contained in:
@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user