当前位置:网站首页>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重启一下
照片就来了。~
下一篇,屏幕的使用,有了屏幕和摄像头结合我们就可以做更多的事情了
边栏推荐
- 编译原理——自上而下分析与递归下降分析构造(笔记)
- Pytest learning ----- pytest confitest of interface automation test Py file details
- Implementation of queue
- scratch疫情隔离和核酸检测模拟 电子学会图形化编程scratch等级考试三级真题和答案解析2022年6月
- Scratch epidemic isolation and nucleic acid detection Analog Electronics Society graphical programming scratch grade examination level 3 true questions and answers analysis June 2022
- 第三季百度网盘AI大赛盛夏来袭,寻找热爱AI的你!
- Codeforces Round #803 (Div. 2)
- Interview shock 62: what are the precautions for group by?
- Windows connects redis installed on Linux
- 8位MCU跑RTOS有没有意义?
猜你喜欢
1700C - Helping the Nature
UDP protocol: simple because of good nature, it is inevitable to encounter "city can play"
std::true_type和std::false_type
Distiller les connaissances du modèle interactif! L'Université de technologie de Chine & meituan propose Virt, qui a à la fois l'efficacité du modèle à deux tours et la performance du modèle interacti
OliveTin能在网页上安全运行shell命令(上)
SQL statement optimization, order by desc speed optimization
Pytest learning ----- pytest confitest of interface automation test Py file details
MS-TCT:Inria&SBU提出用于动作检测的多尺度时间Transformer,效果SOTA!已开源!(CVPR2022)...
Introduction to the usage of model view delegate principal-agent mechanism in QT
Alibaba brand data bank: introduction to the most complete data bank
随机推荐
《ASP.NET Core 6框架揭秘》样章发布[200页/5章]
Jerry is the custom background specified by the currently used dial enable [chapter]
In terms of byte measurement with an annual salary of 30W, automated testing can be learned in this way
DNS hijacking
关于这次通信故障,我想多说几句…
传输层 拥塞控制-慢开始和拥塞避免 快重传 快恢复
The shell generates JSON arrays and inserts them into the database
Compilation Principle -- C language implementation of prediction table
2022 Summer Project Training (II)
Prophet模型的简介以及案例分析
Jerry's watch reads the file through the file name [chapter]
Rb157-asemi rectifier bridge RB157
[Android] kotlin code writing standardization document
Codeforces Round #803 (Div. 2)
Excel usage record
Alibaba brand data bank: introduction to the most complete data bank
FMT开源自驾仪 | FMT中间件:一种高实时的分布式日志模块Mlog
Virtual machine VirtualBox and vagrant installation
Alertmanager sends the alarm email and specifies it as the Alibaba mailbox of the company
30 分钟看懂 PCA 主成分分析