【opencv-python】 截取視頻指定幀數並保存

(1)讀取文件: video = cv.VideoCapture('video.avi') # 讀取視頻文件 (2)分幀讀取視頻: ret,frame = video.read() (3)對每一個幀圖像進行保存: cv.imwrite('D:\\save\\'+str(i)+'.png',frame) 看下面的完整程序 import cv2 as cv #截圖圖像 def cutVideo()
相關文章
相關標籤/搜索