ui界面版本

This commit is contained in:
Ray
2025-10-29 10:49:38 +08:00
parent 8294cab51b
commit 3f1dd4e8c1
12 changed files with 1659 additions and 94 deletions

View File

@@ -45,6 +45,8 @@ import threading
class GetImage:
def __init__(self, cam_index=0, width=1920, height=1080):
self.cap = cv2.VideoCapture(cam_index, cv2.CAP_DSHOW)
if not self.cap.isOpened():
self.cap = cv2.VideoCapture(cam_index)
self.cap.set(cv2.CAP_PROP_FRAME_WIDTH, width)
self.cap.set(cv2.CAP_PROP_FRAME_HEIGHT, height)
self.frame = None
@@ -70,4 +72,6 @@ class GetImage:
time.sleep(0.2)
self.cap.release()
cv2.destroyAllWindows()
get_image = GetImage()
# get_image 将在main.py中初始化
get_image = None