@@ -108,17 +108,22 @@ Arguments for capture
108108
109109### Convert image to another format
110110
111- You can either convert the image with the capture method directly passing the desired output format:
111+ You can either convert the image with the ` capture ` method directly passing the desired output format:
112112``` python
113113img_rgb888 = cam.capture(PixelFormat.RGB888 ) # capture image as configured (e.g. JPEG), convert it to RGB888 and return the converted image
114114```
115- Or you can first capture the image and then convert the captured image to the desired PixelFormat with the convert method.
116- Doing so you can have both, the raw and the converted image.
115+ Or you can first capture the image and then convert it to the desired PixelFormat with the ` convert ` method.
116+ Doing so you can have both, the captured and the converted image. Note that more memory will be used .
117117``` python
118118img = cam.capture()
119119img_rgb888 = cam.convert(PixelFormat.RGB888 ) # converts the last captured image to RGB888 and returns the converted image
120120```
121121
122+ Convertion supported
123+ - from JPEG to RGB565
124+ - to RGB888 in general
125+ - to JPEG in gerenal (use the ` set_quality ` method to set the desired JPEG quality)
126+
122127### Camera reconfiguration
123128
124129``` python
@@ -229,12 +234,12 @@ Example for Xiao sense:
229234#define MICROPY_CAMERA_PIN_XCLK (10)
230235#define MICROPY_CAMERA_PIN_PWDN (-1)
231236#define MICROPY_CAMERA_PIN_RESET (-1)
232- #define MICROPY_CAMERA_PIN_SIOD (40) // SDA
233- #define MICROPY_CAMERA_PIN_SIOC (39) // SCL
237+ #define MICROPY_CAMERA_PIN_SIOD (40) // SDA
238+ #define MICROPY_CAMERA_PIN_SIOC (39) // SCL
234239#define MICROPY_CAMERA_XCLK_FREQ (20000000) // Frequencies are normally either 10 MHz or 20 MHz
235- #define MICROPY_CAMERA_FB_COUNT (2) // The value is between 1 (slow) and 2 (fast, but more load on CPU and more ram usage)
236- #define MICROPY_CAMERA_JPEG_QUALITY (85) // Quality of JPEG output in percent. Higher means higher quality.
237- #define MICROPY_CAMERA_GRAB_MODE (1) // 0=WHEN_EMPTY (might have old data, but less resources), 1=LATEST (best, but more resources)
240+ #define MICROPY_CAMERA_FB_COUNT (2) // The value is between 1 (slow) and 2 (fast, but more load on CPU and more ram usage)
241+ #define MICROPY_CAMERA_JPEG_QUALITY (85) // Quality of JPEG output in percent. Higher means higher quality.
242+ #define MICROPY_CAMERA_GRAB_MODE (1) // 0=WHEN_EMPTY (might have old data, but less resources), 1=LATEST (best, but more resources)
238243
239244```
240245#### Customize additional camera settings
@@ -265,7 +270,7 @@ If you experience problems, visit [MicroPython external C modules](https://docs.
265270
266271## FPS benchmark
267272
268- I didn't use a calibrated osziloscope, but here is a benchmark with my ESP32S3 (GrabMode=LATEST, fb_count = 1, jpeg_quality=85%).
273+ I didn't use a calibrated osziloscope, but here is a benchmark with my ESP32S3 (GrabMode=LATEST, fb_count = 1, jpeg_quality=85%) and OV2640 .
269274Using fb_count=2 theoretically can double the FPS (see JPEG with fb_count=2). This might also aplly for other PixelFormats.
270275
271276| Frame Size | GRAYSCALE | RGB565 | YUV422 | JPEG | JPEG -> RGB565 | JPEG -> RGB888 | JPEG (fb=2) |
@@ -275,8 +280,8 @@ Using fb_count=2 theoretically can double the FPS (see JPEG with fb_count=2). Th
275280| QCIF | 11 | 11 | 11.5 | 25 | 25 | 25 | 50 |
276281| HQVGA | 12.5 | 12.5 | 12.5 | 25 | 16.7 | 16.7 | 50 |
277282| R240X240 | 12.5 | 12.5 | 11.5 | 25 | 16.7 | 12.5 | 50 |
278- | QVGA | 12 | 11 | 12 | 25 | 12.5 | 12.5 | 50 |
279- | CIF | 12.5 | No img | No img | 6.3 | 1.6 | 1.6 | 12.5 |
283+ | QVGA | 12 | 11 | 12 | 25 | 25 | 25 | 50 |
284+ | CIF | 12.5 | No img | No img | 6.3 | 8.3 | 8.3 | 12.5 |
280285| HVGA | 3 | 3 | 2.5 | 12.5 | 6.3 | 6.3 | 25 |
281286| VGA | 3 | 3 | 3 | 12.5 | 3.6 | 3.6 | 25 |
282287| SVGA | 3 | 3 | 3 | 12.5 | 2.8 | 2.5 | 25 |
0 commit comments