编程语言版本:python-3.6
需要的运用的库:cv2、math、os、PIL、numpy、pymysql
代码如下:
import cv2
import math
import os
from PIL import Image
import numpy as np
import pymysql
def groupimg(src):
IMG_Width=160
IMG_Height=90
#newimg为大图背景图
newimg=Image.new("RGB",(4*IMG_Width,5*IMG_Height))
#截取视频帧
cap = cv2.VideoCapture(src)
num=math.floor(cap.get(cv2.CAP_PROP_FRAME_COUNT)/20-1