diff --git a/opencv_webcam.py b/opencv_webcam.py index 28dddcd..b66a343 100644 --- a/opencv_webcam.py +++ b/opencv_webcam.py @@ -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) # 记录用时 diff --git a/utils/plot.py b/utils/plot.py index 2ffcf8c..716f1ca 100644 --- a/utils/plot.py +++ b/utils/plot.py @@ -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'] # 颜色列表