You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/doc/en/vision/camera.md
+8-3Lines changed: 8 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -140,18 +140,20 @@ while 1:
140
140
141
141
### Set exposure time
142
142
143
-
Note that after setting the exposure time, the camera will switch to manual exposure mode, if you want to switch back to automatic exposure mode you need to run `cam.exp_mode(0)`.
143
+
Note that after setting the exposure time, the camera will switch to manual exposure mode, if you want to switch back to automatic exposure mode you need to run `cam.exp_mode(camera.AeMode.Auto)`.
144
144
145
145
```python
146
+
from maix import camera
146
147
cam = camera.Camera()
147
148
cam.exposure(1000)
148
149
```
149
150
150
151
### Setting the gain
151
152
152
-
Note that after setting the gain, the camera will switch to manual exposure mode, to switch back to auto exposure mode you need to run `cam.exp_mode(0)`. Customised gain values will only work in manual exposure mode.
153
+
Note that after setting the gain, the camera will switch to manual exposure mode, to switch back to auto exposure mode you need to run `cam.exp_mode(camera.AeMode.Auto)`. Customised gain values will only work in manual exposure mode.
153
154
154
155
```python
156
+
from maix import camera
155
157
cam = camera.Camera()
156
158
cam.gain(100)
157
159
```
@@ -165,15 +167,17 @@ For MaixCam2: [0.0682, 0, 0, 0.04897]
165
167
To fine-tune image appearance, it is usually sufficient to adjust only the `R` and `B` channels, while keeping `Gr` and `Gb` unchanged.
166
168
167
169
```python
170
+
from maix import camera
168
171
cam = camera.Camera()
169
-
cam.awb_mode(1) #0 to enable auto white balance, 1 to enable manual white balance
172
+
cam.awb_mode(camera.AwbMode.Manual) #AwbMode.Manual to enable auto white balance, AwbMode.Manual to enable manual white balance
170
173
cam.set_wb_gain([0.134, 0.0625, 0.0625, 0.1239]) # Set gains for R, Gr, Gb, B channels
171
174
172
175
```
173
176
174
177
### Setting brightness, contrast and saturation
175
178
176
179
```python
180
+
from maix import camera
177
181
cam = camera.Camera()
178
182
cam.luma(50) # Set brightness, range [0, 100]
179
183
cam.constrast(50) # set contrast, range [0, 100]
@@ -185,6 +189,7 @@ cam.saturation(50) # Set the saturation, range [0, 100].
185
189
Note that the output `raw` image is the original `Bayer` image, and the format of the `Bayer` image may vary depending on the camera module.
0 commit comments