当前位置:网站首页>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重启一下
照片就来了。~
下一篇,屏幕的使用,有了屏幕和摄像头结合我们就可以做更多的事情了
边栏推荐
- J'aimerais dire quelques mots de plus sur ce problème de communication...
- 2022暑期项目实训(三)
- std::true_ Type and std:: false_ type
- Manifest of SAP ui5 framework json
- On time and parameter selection of asemi rectifier bridge db207
- Appium automated test scroll and drag_ and_ Drop slides according to element position
- 趣-关于undefined的问题
- 從交互模型中蒸餾知識!中科大&美團提出VIRT,兼具雙塔模型的效率和交互模型的性能,在文本匹配上實現性能和效率的平衡!...
- 虚拟机VirtualBox和Vagrant安装
- Codeforces Round #803 (Div. 2)
猜你喜欢
Getting started with pytest ----- test case rules
On time and parameter selection of asemi rectifier bridge db207
UDP protocol: simple because of good nature, it is inevitable to encounter "city can play"
Smart street lamp based on stm32+ Huawei cloud IOT design
Windows connects redis installed on Linux
Why should Li Shufu personally take charge of building mobile phones?
F200 - UAV equipped with domestic open source flight control system based on Model Design
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
J'aimerais dire quelques mots de plus sur ce problème de communication...
关于这次通信故障,我想多说几句…
随机推荐
队列的实现
【Android】Kotlin代码编写规范化文档
Markdown grammar - better blogging
Take you through ancient Rome, the meta universe bus is coming # Invisible Cities
面向程序员的精品开源字体
F200——搭载基于模型设计的国产开源飞控系统无人机
Pytest learning ----- pytest operation mode and pre post packaging of interface automation testing
Introduction to the usage of model view delegate principal-agent mechanism in QT
Dichotomy (integer dichotomy, real dichotomy)
Selected technical experts from China Mobile, ant, SF, and Xingsheng will show you the guarantee of architecture stability
HMS core machine learning service creates a new "sound" state of simultaneous interpreting translation, and AI makes international exchanges smoother
Transport layer congestion control - slow start and congestion avoidance, fast retransmission, fast recovery
C语言通过指针交换两个数
TCP packet sticking problem
FMT开源自驾仪 | FMT中间件:一种高实时的分布式日志模块Mlog
带你穿越古罗马,元宇宙巴士来啦 #Invisible Cities
Flet教程之 13 ListView最常用的滚动控件 基础入门(教程含源码)
Windows connects redis installed on Linux
UDP协议:因性善而简单,难免碰到“城会玩”
Jerry's watch reads the file through the file name [chapter]