fix print bug

This commit is contained in:
13339479676 2022-01-06 20:53:09 +08:00
parent 0ec206d194
commit 80393fa7e9
2 changed files with 9 additions and 3 deletions

7
.gitignore vendored
View File

@ -5,4 +5,9 @@
*.avi
.ipynb_checkpoints
__pycache__
utils/__pycache__
/utils/__pycache__
setup.py
/build
/dist
/opencv_webcam_script.egg-info

View File

@ -71,7 +71,7 @@ def webcam_opencv(device_index=0, quit_key="q", pause_key="p", is_autoSaveFrame=
if success: # 连接设备成功
print(f'摄像头连接成功!')
frame_savePath = "" # 保存路径
if is_autoSaveFrame or is_handSaveFrame:
# 帧保存路径管理
frame_savePath = increment_path(
@ -105,7 +105,8 @@ def webcam_opencv(device_index=0, quit_key="q", pause_key="p", is_autoSaveFrame=
print(f'已暂停!按任意键继续。。。')
cv2.waitKey(0) # 暂停,按任意键继续
print(f'共计{frame_num}帧,已保存在:{frame_savePath}')
if (frame_savePath != ""):
print(f'共计{frame_num}帧,已保存在:{frame_savePath}')
# 释放缓存资源
cap.release()
cv2.destroyAllWindows()