当前位置:网站首页>Maixll-Dock 摄像头使用
Maixll-Dock 摄像头使用
2022-07-06 10:14:00 【咸鱼箘】
我玩V831的顺序是,先测试单个硬件,了解相关用法,后面结合使用。所以想看完整案例的小伙伴可以先不用看摄像头的使用和屏幕的使用这两篇文章。直接看后面案例就可以。
摄像头工作原理
图像传感器-摄像头
摄像头(CAMERA或WEBCAM)又称为电脑相机、电脑眼、电子眼等,是一种视频输入设备,被广泛的运用于视频会议、远程医疗及实时监控等方面。普通的人也可以彼此通过摄像头在网络进行有影像、有声音的交谈和沟通。
原理:景物通过镜头(LENS)生成光学图像投射到图像传感器表面上,转为电信号,经过A/D(模数转换)后变为数字信号.
再传到数字信号处理芯片(DSP)中加工处理,通过USB接口传输到电脑中处理,通过显示器可以看到图像。
PS:原理不用深究,咱又不做摄像头设计,了解一下就行
camera 模块
PS:单纯地讲一个模块的使用方法,后面讲完其他模块才会结合使用。
- 导入模块
from maix import camera
- 方法说明
| 方法 | 说明 |
|---|---|
| camera.width() | 返回当前摄像头配置的图像的宽 |
| camera.height() | 返回当前摄像头配置的图像的高 |
| camera.config(size=(240, 240)) | 主要用于配置摄像头,设置获取图像大小 |
| camera.capture() | 捕获一张图像并返回 _maix_image.image |
| camera.close() | 关闭、释放当前设备 |
- 方法演示


摄像头用法不算难,后面我们用到哪个案例就讲哪个。
拍摄图片并保存
摄像头综合案例较多,我们本篇只搞一个最简单的,就是拍照保存。有了这个功能,我们后面可以搞人员识别(识别人脸,在识别库的人进行下一步动作)。
我们保存的目标是我们的U盘,方便我们后续提取。地址为root/app/设置的图片.格式
from maix import camera
img = camera.capture()
img.save('root/app/xianyu.jpg')
将上面的代码放到IDE上
在运行代码之前,打开U盘
ADB进入root/app(U盘)路径
[email protected]:/# cd root/app
cd root/app
[email protected]:~/app# ls
main.py maixhub main.py.log run.py

运行代码后发现U盘没有图片。
ADB执行ls后,可以看到root/app下已经有了我们想要保存的照片。说明照片已经存了,但是U盘没有显示。
[email protected]sipeed:~/app# ls
main.py maixhub main.py.log run.py xianyu.jpg

此时执行reboot重启一下
照片就来了。~
下一篇,屏幕的使用,有了屏幕和摄像头结合我们就可以做更多的事情了
边栏推荐
- F200 - UAV equipped with domestic open source flight control system based on Model Design
- STM32按键状态机2——状态简化与增加长按功能
- node の SQLite
- Interview assault 63: how to remove duplication in MySQL?
- Release of the sample chapter of "uncover the secrets of asp.net core 6 framework" [200 pages /5 chapters]
- Heavy! Ant open source trusted privacy computing framework "argot", flexible assembly of mainstream technologies, developer friendly layered design
- 重磅硬核 | 一文聊透对象在 JVM 中的内存布局,以及内存对齐和压缩指针的原理及应用
- Dichotomy (integer dichotomy, real dichotomy)
- Grafana 9.0 正式发布!堪称最强!
- On time and parameter selection of asemi rectifier bridge db207
猜你喜欢

Comparative examples of C language pointers *p++, * (p++), * ++p, * (++p), (*p) + +, +(*p)
![Jerry's updated equipment resource document [chapter]](/img/6c/17bd69b34c7b1bae32604977f6bc48.jpg)
Jerry's updated equipment resource document [chapter]

node の SQLite

The integrated real-time HTAP database stonedb, how to replace MySQL and achieve nearly a hundredfold performance improvement

Rb157-asemi rectifier bridge RB157

虚拟机VirtualBox和Vagrant安装

李书福为何要亲自挂帅造手机?

On time and parameter selection of asemi rectifier bridge db207

There is a gap in traditional home decoration. VR panoramic home decoration allows you to experience the completion effect of your new house

带你穿越古罗马,元宇宙巴士来啦 #Invisible Cities
随机推荐
Getting started with pytest ----- test case rules
编译原理——自上而下分析与递归下降分析构造(笔记)
DNS hijacking
Nodejs 开发者路线图 2022 零基础学习指南
Stealing others' vulnerability reports and selling them into sidelines, and the vulnerability reward platform gives rise to "insiders"
2019 Alibaba cluster dataset Usage Summary
李書福為何要親自掛帥造手機?
Take you through ancient Rome, the meta universe bus is coming # Invisible Cities
Grafana 9.0 正式发布!堪称最强!
C语言指针*p++、*(p++)、*++p、*(++p)、(*p)++、++(*p)对比实例
2022 Summer Project Training (II)
带你穿越古罗马,元宇宙巴士来啦 #Invisible Cities
Selected technical experts from China Mobile, ant, SF, and Xingsheng will show you the guarantee of architecture stability
Prophet模型的简介以及案例分析
關於這次通信故障,我想多說幾句…
关于这次通信故障,我想多说几句…
重磅!蚂蚁开源可信隐私计算框架“隐语”,主流技术灵活组装、开发者友好分层设计...
It doesn't make sense without a distributed gateway
【剑指 Offer】 60. n个骰子的点数
d绑定函数