ui界面版本
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user