v05 update 03

This commit is contained in:
13339479676 2022-02-04 11:59:02 +08:00
parent cb49d71bb9
commit f93934218c
2 changed files with 7 additions and 5 deletions

View File

@ -20,7 +20,7 @@ from utils.fonts_opt import is_fonts
ROOT_PATH = sys.path[0] # 项目根目录
OWS_VERSION = 'OpenCV Webcam Script v0.5' # 版本号
OWS_VERSION = 'OpenCV Webcam Script v0.5' # 项目名称与版本号
def parse_args(known=False):
@ -125,6 +125,7 @@ def webcam_opencv(device_index="0", # 设备号
# ------------------程序开始------------------
s_time = time.time() # 起始时间
print(f'摄像头连接成功!')
print(f'-------------程序开始!-------------')
bufferSize = cap.get(cv2.CAP_PROP_BUFFERSIZE)
# cap.set(cv2.CAP_PROP_BUFFERSIZE,10) # 1-10
@ -179,13 +180,13 @@ def webcam_opencv(device_index="0", # 设备号
frameSaveMsg = f'自动版:共计{frame_num}帧,已保存在:{frame_savePath}'
print(frameSaveMsg)
log_management(f'{frameSaveMsg}\n', logName, logMode) # 记录帧保存信息
date_time_frames(logTime, frame_num)
date_time_frames(logTime, frame_num) # 记录时间与帧数
elif (is_handSaveFrame):
# 帧保存信息(手动版)
frameSaveMsg = f'手动版:共计{frame_hand_num}帧,已保存在:{frame_savePath}'
print(frameSaveMsg)
log_management(f'{frameSaveMsg}\n', logName, logMode) # 记录帧保存信息
date_time_frames(logTime, frame_hand_num)
date_time_frames(logTime, frame_hand_num) # 记录时间与帧数
else:
date_time_frames(logTime, 0) # 记录非帧保存状态
@ -193,7 +194,7 @@ def webcam_opencv(device_index="0", # 设备号
cv2.destroyAllWindows() # 删除所有窗口
# ------------------程序结束------------------
print(f'程序结束!')
print(f'-------------程序结束!-------------')
e_time = time.time() # 终止时间
total_time = e_time - s_time # 程序用时
outTimeMsg = f'用时:{time_format(total_time)}' # 格式化时间格式,便于观察
@ -202,6 +203,7 @@ def webcam_opencv(device_index="0", # 设备号
# ------------------压缩文件------------------
if (is_compress and (is_autoSaveFrame or is_handSaveFrame)):
# 压缩信息
compress_msg = webcam_compress(compressStyle, is_autoCompressName,
compressName, frame_savePath, compressMode)
log_management(f'{compress_msg}\n', logName, logMode) # 记录用时

View File

@ -12,7 +12,7 @@ from matplotlib.ticker import MaxNLocator
from utils.time_format import time_format
OWS_VERSION = 'OpenCV Webcam Script v0.5' # 版本号
OWS_VERSION = 'OpenCV Webcam Script v0.5' # 项目名称与版本号
ROOT_PATH = sys.path[0] # 项目根目录
COLOR_LIST = ['#f96801'] # 颜色列表