Skip to content

Commit

Permalink
Added benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
cnadler86 committed Nov 6, 2024
1 parent ff35d2b commit ef37d98
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,28 @@ If you experience problems, visit [MicroPython external C modules](https://docs.
- The driver requires PSRAM to be installed and activated.
- Most of the precompiled firmware images are untested, but the only difference between them are the target architecture and pin definitions, so they should work out of the box. If not, please raise an issue.

## Benchmark

I didn't use a calibrated osziloscope, but here is a benchmark with my ESP32S3 (GrabMode=LATEST).
Using fb_count = 2 doubles the FPS for JPEG. This might also aplly for other PixelFormats.

| Frame Size | GRAYSCALE | RGB565 | YUV422 | JPEG | JPEG (fb = 2) |
|------------|-----------|--------|--------|--------|---------------|
| R96X96 | 12.5 | 12.5 | 12.5 | No img | No img |
| QQVGA | 12.5 | 12.5 | 12.5 | 25 | 50 |
| QCIF | 11 | 11 | 11.5 | 25 | 50 |
| HQVGA | 12.5 | 12.5 | 12.5 | 25 | 50 |
| R240X240 | 12 | 12.5 | 11.5 | 25 | 50 |
| QVGA | 12 | 11 | 12 | 25 | 50 |
| CIF | 12.5 | No img | No img | 6 | 12.5 |
| HVGA | 2.5 | 3 | 2.5 | 12.5 | 25 |
| VGA | 3 | 3 | 3 | 12.5 | 25 |
| SVGA | 3 | 3 | 3 | 12.5 | 25 |
| XGA | No img | No img | No img | 6 | 12.5 |
| HD | No img | No img | No img | 6 | 12.5 |
| SXGA | 2 | 2 | 2 | 6 | 12.5 |
| UXGA | No img | No img | No img | 6 | 12.5 |

## Future Plans

- Edge case: enable usage of pins such as i2c for other applications
Expand Down
3 changes: 1 addition & 2 deletions src/modcamera_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,7 @@ static mp_obj_t mp_camera_make_new(const mp_obj_type_t *type, size_t n_args, siz

if (mp_camera_hal_capture(self, -1) == mp_const_none){
mp_camera_hal_deinit(self);
mp_raise_msg(&mp_type_OSError, MP_ERROR_TEXT("Failed to capture initial frame. \
Run reconfigure method or construct a new object with appropriate configuration (e.g. FrameSize)."));
mp_raise_msg(&mp_type_OSError, MP_ERROR_TEXT("Failed to capture initial frame. Construct a new object with appropriate configuration."));
return MP_OBJ_FROM_PTR(self);
} else {
if ( !args[ARG_init].u_bool ){
Expand Down

0 comments on commit ef37d98

Please sign in to comment.