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

首頁(yè) > 編程 > Python > 正文

python對(duì)視頻畫框標(biāo)記后保存的方法

2020-02-15 23:59:26
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

需要畫框取消注釋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)) #設(shè)置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對(duì)視頻畫框標(biāo)記后保存的方法就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持武林站長(zhǎng)站。

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 利辛县| 滨州市| 二连浩特市| 澄江县| 若羌县| 华亭县| 南昌县| 南江县| 丰原市| 东丰县| 孝昌县| 岐山县| 富平县| 郧西县| 徐州市| 平山县| 汽车| 顺平县| 奉节县| 苍山县| 大城县| 富平县| 多伦县| 淮阳县| 崇明县| 利辛县| 陆川县| 石景山区| 仙桃市| 郯城县| 抚顺县| 杨浦区| 永城市| 合川市| 射阳县| 那曲县| 通化市| 葫芦岛市| 阜平县| 北京市| 苏尼特左旗|