webcam script update
This commit is contained in:
parent
9011644ae7
commit
4eee91379d
|
@ -4,7 +4,7 @@
|
|||
|
||||
### :zap: 安装教程
|
||||
|
||||
#### :white_check_mark: 方法一
|
||||
#### :white_check_mark: 方法一:Linux Shell版
|
||||
|
||||
```shell
|
||||
# 创建conda虚拟环境,以python 3.8为例
|
||||
|
|
|
@ -59,8 +59,8 @@ def webcam_opencv(device_index, quit_key, is_autoSaveFrame, frame_saveDir, frame
|
|||
|
||||
if is_autoSaveFrame or is_headSaveFrame:
|
||||
# 帧保存路径管理
|
||||
frame_samePath = increment_path(Path(f"{frame_saveDir}") / "frames", exist_ok=False) # increment run
|
||||
frame_samePath.mkdir(parents=True, exist_ok=True) # make dir
|
||||
frame_samePath = increment_path(Path(f"{frame_saveDir}") / "frames", exist_ok=False) # 增量运行
|
||||
frame_samePath.mkdir(parents=True, exist_ok=True) # 创建目录
|
||||
|
||||
frame_num = 0 # 帧数
|
||||
while(1):
|
||||
|
@ -99,6 +99,7 @@ def webcam_opencv(device_index, quit_key, is_autoSaveFrame, frame_saveDir, frame
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
# 参数
|
||||
parse_args()
|
||||
device_index = args.device
|
||||
quit_key = args.quit
|
||||
|
@ -115,6 +116,7 @@ if __name__ == '__main__':
|
|||
if (quit_key == frame_capKey):
|
||||
print(f'快捷键冲突!')
|
||||
else:
|
||||
# 调用webcam opencv
|
||||
webcam_opencv(device_index, quit_key, is_autoSaveFrame, frame_saveDir, frame_nSave, is_headSaveFrame, frame_capKey, is_resizeFrame, resize_frame, resizeRatio_frame)
|
||||
|
||||
print(f'程序结束!')
|
Loading…
Reference in New Issue