3 Star 0 Fork 0

yanyi_123456 / YY_RMS_Multiple_Manage_4.0

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
demo.py 860 Bytes
一键复制 编辑 原始数据 按行查看 历史
13507605001 提交于 2022-12-13 09:06 . 头像上传
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@Date:2022/09/08 13:42:28
'''
import sys
sys.path.append('.')
from db_logic.module import BllModule
from models.power_models import EntityModule
from Common.Utils import Utils
import cv2
def picture_shoot(image_name='img.png', image_path=r'C:/local_project/imgs') -> None:
'''
调用摄像头拍照并保存图片到本地
:param image_name: 图片名字
:param image_path: 图片保存路径
:return: None
'''
cap = cv2.VideoCapture(0)
while (cap.isOpened()):
ret, frame = cap.read()
# cv2.imshow("Capture_Paizhao", frame) # 显示窗口
cv2.imwrite(image_path + "\\" + image_name, frame)
print("保存" + image_name + "成功!")
break
cap.release()
cv2.destroyAllWindows()
if __name__ == '__main__':
picture_shoot()
Python
1
https://gitee.com/yanyi_123456/yy_-rms_-multiple_-manage_4.0.git
git@gitee.com:yanyi_123456/yy_-rms_-multiple_-manage_4.0.git
yanyi_123456
yy_-rms_-multiple_-manage_4.0
YY_RMS_Multiple_Manage_4.0
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891