修复信息窗反转和二维码窗口没全屏的 bug

This commit is contained in:
Tian jianyong 2025-12-26 15:44:37 +08:00
parent c1803c16f1
commit b02d527b43

View File

@ -698,6 +698,8 @@ class FaceRecognitionSystem:
x_pos = 0
y_pos = 0
qr_height, qr_width = qr_image.shape[:2]
rendered = self._build_qrcode_instruction_canvas(qr_image, (canvas_width, canvas_height))
if rendered is None:
# 回退到原二维码展示
@ -1907,14 +1909,14 @@ class FaceRecognitionSystem:
self.logger.debug("人脸消失,重置计时器")
self.face_present_start = None
# 镜像翻转:使画面与实际场景一致(在绘制信息之前)
frame = cv2.flip(frame, 1)
# 绘制信息
display_frame = self.draw_info_on_frame(frame)
# 使用缓存的屏幕尺寸拉伸视频帧到全屏
display_frame = cv2.resize(display_frame, (self.screen_width, self.screen_height), interpolation=cv2.INTER_LINEAR)
# 镜像翻转:使画面与实际场景一致(取消默认的左右镜像)
display_frame = cv2.flip(display_frame, 1)
cv2.imshow(window_name, display_frame)