发现我摄像头拍出来我还挺 shuai 的。
调用摄像头:
1 | import cv2 as cv |
说明:
VideoCapture(),一个类,官方文档挺全的。
read()读取摄像头,返回两个参数(ret, frame),ret 是 bool 类型,表示有没有读到图片;frame 是读取的每一帧的图片。flip()表示翻转,默认读取的摄像头数据是左右翻的。0,上下翻
大于0,水平翻
小于0,180旋转
a flag to specify how to flip the array; 0 means flipping around the x-axis and positive value (for example, 1) means flipping around y-axis. Negative value (for example, -1) means flipping around both axes.
