Ai
1 Star 1 Fork 0

小鱼儿灬/opencv_python

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
testcamera.py 718 Bytes
一键复制 编辑 原始数据 按行查看 历史
小鱼儿灬 提交于 2018-12-01 21:11 +08:00 . 人脸识别
__author__ = 'yinchuandong'
import cv2
from face import FaceDetect
model = FaceDetect()
capture = cv2.VideoCapture(0)
size = (int(capture.get(cv2.CAP_PROP_FRAME_WIDTH)),
int(capture.get(cv2.CAP_PROP_FRAME_HEIGHT)))
#video = cv2.VideoWriter("c:\\1.mp4", cv2.VideoWriter_fourcc('I', '4', '2', '0'), 30, size)
print(capture.isOpened())
num = 0
while True:
ret, img = capture.read()
imgArr = model.detect(img)
for img in imgArr:
#video.write(img)
cv2.imshow('Video', img)
key = cv2.waitKey(1)
cv2.imwrite('camera/%s.jpg' % (str(num)), img)
num = num + 1
if key == ord('q'):
break
# video.release()
capture.release()
cv2.destroyAllWindows()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/dxh_git/opencv_python.git
git@gitee.com:dxh_git/opencv_python.git
dxh_git
opencv_python
opencv_python
master

搜索帮助