【新手基础教程】外设之 双摄模块 的使用
本帖最后由 猪百岁 于 2021-4-15 17:43 编辑# 双目摄像头
[![](https://cn.maixpy.sipeed.com/assets/hardware/module/camera_binocular.png)](https://cn.maixpy.sipeed.com/assets/hardware/module/camera_binocular.png)
## 1. 使用方法[](https://cn.maixpy.sipeed.com/zh/modules/others/binocular_camera.html#%E4%BD%BF%E7%94%A8%E6%96%B9%E6%B3%95)
需要准备一个双目摄像头
- 导入并初始化双目摄像头
```
import sensor
sensor.binocular_reset()
sensor.shutdown(False)
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.shutdown(True)
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.run(1)
```
- 打开摄像头并捕捉图像
```
sensor.shutdown(True)
img=sensor.snapshot()
```
API 详情请参考:(https://cn.maixpy.sipeed.com/zh/api_reference/machine_vision/sensor.html)
## [](https://cn.maixpy.sipeed.com/zh/modules/others/binocular_camera.html#%E4%BE%8B%E7%A8%8B)2. 例程[](https://cn.maixpy.sipeed.com/zh/modules/others/binocular_camera.html#%E4%BE%8B%E7%A8%8B)
捕捉图像并显示在 LCD 上
(https://github.com/sipeed/MaixPy_scripts/blob/5a03ab549d06cd713f2c0d19f0c18fbd24c69025/hardware/demo_binocular.py)
页:
[1]