摘要:
import cv2 from PIL import Image, ImageDraw, ImageFont import numpy as np cap = cv2.VideoCapture('data/1.mp4') while cap.isOpened(): ret, frame = cap.read() # 显示中文字体并画框 image = Image.fromarray(frame) 阅读全文
摘要:
# OpenCV版本的视频检测 import cv2 # 图片识别方法封装 def discern(img): gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) cap = cv2.CascadeClassifier( "C:\Python36\Lib\site-packages\opencv-master\data... 阅读全文
摘要:
import cv2 filepath = "xxxx" img = cv2.imread(filepath) # 读取图片 gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) # 转换灰色 # OpenCV人脸识别分类器 classifier = cv2.CascadeClassifier( "C:\Python36\Lib\site-... 阅读全文
摘要:
import cv2 videoFile = 'data/最强大脑.mp4' cap = cv2.VideoCapture(videoFile) frameNum = 0 while (cap.isOpened()): ret, frame = cap.read() frameNum = frameNum + 1 if frameNum % 2 == 0: # 调整... 阅读全文
摘要:
阅读全文