Skip to content

Commit 8fda06b

Browse files
committed
Merge branch 'main' into dev
2 parents 9d3f41d + e0d4883 commit 8fda06b

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

docs/doc/zh/vision/camera.md

+19-4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ update:
55
author: neucrack
66
version: 1.0.0
77
content: 初版文档
8+
- 日期: 2024-08-21
9+
作者: YWJ
10+
版本: 1.0.1
11+
内容: 修正文档部分bug,增加部分内容
812
---
913

1014

@@ -23,7 +27,7 @@ update:
2327
TODO:如何切换摄像头,比如 GC4653 和 OS04A10 之间的切换。
2428

2529

26-
## 从摄像头获取图像
30+
## 获取摄像头的图像信息
2731

2832
使用 MaixPy 轻松获取:
2933
```python
@@ -94,15 +98,16 @@ cam = camera.Camera(640, 480, fps=80) # 设置帧率为80帧
9498
对于画面存在鱼眼等畸变的情况,可以使用`Image`对象下的`lens_corr`函数对图片进行畸变矫正。一般情况只需要调大和调小`strength`的值来将画面调整到合适效果即可。
9599

96100
```python
97-
from maix import camera, display
101+
from maix import camera, display,app,time
98102

99103
cam = camera.Camera(320, 240)
100104
disp = display.Display()
101105
while not app.need_exit():
102106
t = time.ticks_ms()
103107
img = cam.read()
104108
img = img.lens_corr(strength=1.5) # 调整strength的值直到画面不再畸变
105-
disp = display.Display()
109+
disp.show(img)
110+
106111
```
107112

108113
TODO:支持硬件畸变矫正
@@ -115,7 +120,7 @@ cam = camera.Camera(640, 480)
115120
cam.skip_frames(30) # 跳过开头的30帧
116121
```
117122

118-
## 显示图像
123+
## 显示摄像头获取的图像
119124

120125
MaixPy 提供了`display`模块,可以方便的显示图像:
121126
```python
@@ -164,6 +169,16 @@ cam.luma(50) # 设置亮度,范围[0, 100]
164169
cam.constrast(50) # 设置对比度,范围[0, 100]
165170
cam.saturation(50) # 设置饱和度,范围[0, 100]
166171
```
172+
### 更改图片长宽
167173

174+
```python
175+
cam = camera.Camera(width=640, height=480)
176+
```
177+
178+
179+
```python
180+
cam = camera.Camera()
181+
cam.set_resolution(width=640, height=480)
182+
```
168183

169184

0 commit comments

Comments
 (0)