Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
enpeizhao committed Feb 4, 2022
1 parent afa2967 commit d31c0f2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions codes/7.virtual_drag_drop/7.virtual_drag_drop.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ def recognize(self):
# OpenCV读取视频流
cap = cv2.VideoCapture(0)
# 视频分辨率
resize_w = 1280
resize_h = 720
resize_w = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
resize_h = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))

# 画面显示初始化参数
rect_percent_text = 0
Expand Down Expand Up @@ -262,7 +262,7 @@ def recognize(self):
# self.image = cv2.resize(self.image, (resize_w//2, resize_h//2))
cv2.imshow('virtual drag and drop', self.image)

if cv2.waitKey(5) & 0xFF == 27 or cv2.getWindowProperty('virtual drag and drop', cv2.WND_PROP_VISIBLE) < 1:
if cv2.waitKey(5) & 0xFF == 27:
break
cap.release()

Expand Down

0 comments on commit d31c0f2

Please sign in to comment.