国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > Python > 正文

python對視頻畫框標記后保存的方法

2020-01-04 13:54:35
字體:
來源:轉載
供稿:網友

需要畫框取消注釋rectangle

import cv2import os,sys,shutilimport numpy as np # Open the input movie file, input the filepath asinput_filepath = sys.argv[1]input_movie = cv2.VideoCapture(input_filepath)length = int(input_movie.get(cv2.CAP_PROP_FRAME_COUNT)) #設置outputoutput_movie = cv2.VideoWriter(input_filepath.replace("mp4","avi").replace("input","output"), cv2.VideoWriter_fourcc('D', 'I', 'V', 'X'), 25, (1280, 720)) # Initialize some variablesframe_number = 0 while True: # Grab a single frame of video ret, frame = input_movie.read()  frame_number += 1  # Quit when the input video file ends if not ret:  break  # Draw a box around the body: input the top left point(x,y) and bottom right point(x,y) #cv2.rectangle(frame, (left, top), (right, bottom), (0, 0, 255), 2)  # Write the resulting image to the output video file print("Writing frame {} / {}".format(frame_number, length)) output_movie.write(frame) # All done!input_movie.release()cv2.destroyAllWindows()

以上這篇python對視頻畫框標記后保存的方法就是小編分享給大家的全部內容了,希望能給大家一個參考,也希望大家多多支持VEVB武林網。


注:相關教程知識閱讀請移步到python教程頻道。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 佛教| 东山县| 香格里拉县| 马关县| 佛山市| 年辖:市辖区| 苏州市| 呼伦贝尔市| 贵州省| 安康市| 崇文区| 普兰店市| 长宁县| 贵溪市| 榆树市| 攀枝花市| 汉川市| 肇州县| 新竹市| 中牟县| 额尔古纳市| 余干县| 工布江达县| 峨边| 海盐县| 博罗县| 麻栗坡县| 定襄县| 油尖旺区| 瑞安市| 屯留县| 休宁县| 图们市| 临猗县| 顺义区| 漾濞| 南汇区| 新丰县| 潼南县| 铜川市| 伊通|