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
- init: Initialize camera at construction time (default: True)
96
-
- bmp_out: Image captured output converted to bitmap (default: False)
97
95
98
96
**Default values:**
99
97
@@ -123,28 +121,6 @@ cam.init()
123
121
img = cam.capture()
124
122
```
125
123
126
-
Arguments for capture
127
-
128
-
- out_format: Output format as PixelFormat (optional)
129
-
130
-
### Convert image to another format
131
-
132
-
You can either convert the image with the `capture` method directly passing the desired output format:
133
-
```python
134
-
img_rgb888 = cam.capture(PixelFormat.RGB888) #capture image as configured (e.g. JPEG), convert it to RGB888 and return the converted image
135
-
```
136
-
Or you can first capture the image and then convert it to the desired PixelFormat with the `convert` method.
137
-
Doing so you can have both, the captured and the converted image. Note that more memory will be used.
138
-
```python
139
-
img = cam.capture()
140
-
img_rgb888 = cam.convert(PixelFormat.RGB888) #converts the last captured image to RGB888 and returns the converted image
141
-
```
142
-
143
-
Convertion supported
144
-
- from JPEG to RGB565
145
-
- to RGB888 in general
146
-
- to JPEG in gerenal (use the `set_quality` method to set the desired JPEG quality)
147
-
148
124
### Camera reconfiguration
149
125
150
126
```python
@@ -164,7 +140,6 @@ Here are just a few examples:
164
140
165
141
```python
166
142
cam.set_quality(90) # The quality goes from 0% to 100%, meaning 100% is the highest but has probably no compression
167
-
cam.set_bmp_out(True) # Enables convertion to bmp when capturing image
168
143
camera.get_brightness()
169
144
camera.set_vflip(True) #Enable vertical flip
170
145
```
@@ -296,25 +271,22 @@ If you experience problems, visit [MicroPython external C modules](https://docs.
296
271
I didn't use a calibrated osziloscope, but here is a FPS benchmark with my ESP32S3 (xclck_freq = 20MHz, GrabMode=LATEST, fb_count = 1, jpeg_quality=85%) and OV2640.
297
272
Using fb_count=2 theoretically can double the FPS (see JPEG with fb_count=2). This might also aplly for other PixelFormats.
| CIF | 12.5 | No img | No img | 6.3 | 8.3 | 8.3 | 12.5 |
308
-
| HVGA | 3 | 3 | 2.5 | 12.5 | 6.3 | 6.3 | 25 |
309
-
| VGA | 3 | 3 | 3 | 12.5 | 3.6 | 3.6 | 25 |
310
-
| SVGA | 3 | 3 | 3 | 12.5 | 2.8 | 2.5 | 25 |
311
-
| XGA | No img | No img | No img | 6.3 | 1.6 | 1.6 | 12.5 |
312
-
| HD | No img | No img | No img | 6.3 | 1.4 | 1.3 | 12.5 |
313
-
| SXGA | 2 | 2 | 2 | 6.3 | 1 | 1 | 12.5 |
314
-
| UXGA | No img | No img | No img | 6.3 | 0.7 | 0.7 | 12.5 |
315
-
316
-
317
-
Looking at the results: image conversion make only sense for frame sized below QVGA or if capturing the image in the intended pixelformat and frame size combination fails.
0 commit comments