【发布时间】:2019-08-06 13:42:36
【问题描述】:
我正在使用 opencv 和 pyautogui 创建一个相机应用程序。该功能没有得到评估。
from utils import CFEVideoConf, image_resize
def recog():
cap = cv2.VideoCapture(0)
save_path = 'saved-media/video.avi'
frames_per_seconds = 24.0
config = CFEVideoConf(cap, filepath=save_path, res='720p')
out = cv2.VideoWriter(save_path, config.video_type, frames_per_seconds, config.dims)
while (True):
# Capture frame-by-frame
ret, frame = cap.read()
out.write(frame)
# Display the resulting frame
cv2.imshow('frame',frame)
if cv2.waitKey(20) & 0xFF == ord('q'):
op = pyautogui.confirm("")
if op == 'OK':
print("Out")
break
cap.release()
out.release()
cv2.destroyAllWindows()
opt =pyautogui.confirm(text= 'Chose an option', title='Camcorder', buttons=['Record', 'Capture', 'Exit'])
if opt == 'START':
print("Starting the app")
recog()
if opt == 'Exit':
print("Quit the app")
如有错误请指正。
【问题讨论】:
-
请阅读this guide 以获取如何改进您的问题的提示。
-
标记为python
标签: python opencv computer-vision artificial-intelligence pyautogui