cv2.threshold()和cv2.VideoWriter()

cv2.threshold(src,thresh,255,cv2.THRESH_BINARY)

 src:需要处理的图像

thresh:阈值

255:表示大于阈值的像素值全部设为255

最后一个表示划分类型,常用值为0(cv2.THRESH_BINARY)

fourcc = cv2.VideoWriter_fourcc(*'XVID')

out = cv2.VideoWriter('output.avi',fourcc, 20.0, (640,480))

 第一句表示使用XVID编码器

第二句参数分别表示:输出视频名称,编码器,帧率,帧宽和高

cv2.threshold():https://blog.csdn.net/a19990412/article/details/81172426

cv2.VideoWriter:https://blog.csdn.net/u012348774/article/details/78255130

猜你喜欢

转载自blog.csdn.net/Li_haiyu/article/details/86426115