readme update

This commit is contained in:
13339479676 2022-01-15 19:48:28 +08:00
parent 7204b7cc19
commit 97db4f9ba6
2 changed files with 32 additions and 6 deletions

View File

@ -233,6 +233,21 @@ python opencv_webcam.py -isasf -afn 100
#### :bulb: 日志设置
```shell
# 日志文件默认保存在项目根目录test.log
python opencv_webcam.py
# 设置日志文件名称及类型,类型包括.log、.txt、.data
python opencv_webcam.py -ln test02.txt
# 设置日志保存方式,,默认为追加模式
python opencv_webcam.py -lm w # 设置为覆盖模式
```
#### :bulb: 指令查询
```shell
@ -244,16 +259,21 @@ python opencv_webcam.py --help
<summary>指令查询结果</summary>
```shell
usage: opencv_webcam.py [-h] [--device DEVICE] [--quit QUIT] [--is_autoSaveFrame] [--is_handSaveFrame] [--is_resizeFrame] [--frame_saveDir FRAME_SAVEDIR] [--frame_nSave FRAME_NSAVE]
[--frame_capKey FRAME_CAPKEY] [--resize_frame RESIZE_FRAME [RESIZE_FRAME ...]] [--resizeRatio_frame RESIZERATIO_FRAME] [--frame_namePrefix FRAME_NAMEPREFIX]
[--frame_saveStyle FRAME_SAVESTYLE] [--jpg_quality JPG_QUALITY] [--png_quality PNG_QUALITY] [--pause PAUSE] [--auto_frameNum AUTO_FRAMENUM]
usage: opencv_webcam.py [-h] [--device DEVICE] [--quit QUIT] [--is_autoSaveFrame] [--is_handSaveFrame]
[--is_resizeFrame] [--frame_saveDir FRAME_SAVEDIR]
[--frame_dirName FRAME_DIRNAME] [--frame_nSave FRAME_NSAVE]
[--frame_capKey FRAME_CAPKEY] [--resize_frame RESIZE_FRAME [RESIZE_FRAME ...]]
[--resizeRatio_frame RESIZERATIO_FRAME] [--frame_namePrefix FRAME_NAMEPREFIX]
[--frame_saveStyle FRAME_SAVESTYLE] [--jpg_quality JPG_QUALITY]
[--png_quality PNG_QUALITY] [--pause PAUSE] [--auto_frameNum AUTO_FRAMENUM]
[--logName LOGNAME] [--logMode LOGMODE]
OpenCV Webcam Script v0.2
OpenCV Webcam Script v0.3
optional arguments:
-h, --help show this help message and exit
--device DEVICE, -dev DEVICE
device index for webcam
device index for webcam, 0 or rtsp
--quit QUIT, -q QUIT quit key for webcam
--is_autoSaveFrame, -isasf
is auto save frame
@ -263,6 +283,8 @@ optional arguments:
is resize frame
--frame_saveDir FRAME_SAVEDIR, -fsd FRAME_SAVEDIR
save frame dir
--frame_dirName FRAME_DIRNAME, -fdn FRAME_DIRNAME
save frame dir name
--frame_nSave FRAME_NSAVE, -fns FRAME_NSAVE
n frames save a frame (auto save frame)
--frame_capKey FRAME_CAPKEY, -fck FRAME_CAPKEY
@ -283,6 +305,10 @@ optional arguments:
webcam pause
--auto_frameNum AUTO_FRAMENUM, -afn AUTO_FRAMENUM
auto save number of frames
--logName LOGNAME, -ln LOGNAME
log Save Name
--logMode LOGMODE, -lm LOGMODE
log Save Mode
```
</details>

View File

@ -70,7 +70,7 @@ def webcam_opencv(device_index=0, quit_key="q", pause_key="p", is_autoSaveFrame=
hotkey_judge(keyList) # 快捷键冲突判断
# 日志文件
is_logSuffix(logName) # 检测日志格式
is_logSuffix(logName) # 检测日志格式
logTime = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) # 日志时间
log_management(f'{logTime}\n', logName, logMode) # 记录日志时间
# ------------------程序开始------------------