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
This project aims to support various cameras on different MicroPython ports, starting with the ESP32 port and Omnivision (OV2640 & OV5640) cameras. The project implements a general API for cameras in micropython (such as circuitpython have done).
5
+
This project aims to support various cameras (e.g. OV2640, OV5640) on different MicroPython ports, starting with the ESP32 port. The project implements a general API, has precompiled FW images and supports a lot of cameras out of the box.
6
6
At the moment, this is a micropython user module, but it might get in the micropython repo in the future.
7
7
The API is stable, but it might change without previous announce.
8
8
@@ -134,6 +134,17 @@ See autocompletions in Thonny in order to see the list of methods.
134
134
If you want more insides in the methods and what they actually do, you can find a very good documentation [here](https://docs.circuitpython.org/en/latest/shared-bindings/espcamera/index.html).
135
135
Note that each method requires a "get_" or "set_" prefix, depending on the desired action.
136
136
137
+
To get the version of the camera driver used:
138
+
139
+
```python
140
+
import camera
141
+
vers = camera.Version()
142
+
```
143
+
144
+
### Additional information
145
+
146
+
The FW images support the following cameras out of the box, but is therefore big: OV7670, OV7725, OV2640, OV3660, OV5640, NT99141, GC2145, GC032A, GC0308, BF3005, BF20A6, SC030IOT
147
+
137
148
## Build your custom FW
138
149
139
150
### Setting up the build environment (DIY method)
@@ -142,20 +153,20 @@ To build the project, follow these instructions:
142
153
143
154
-[ESP-IDF](https://docs.espressif.com/projects/esp-idf/en/v5.2.3/esp32/get-started/index.html): I used version 5.2.3, but it might work with other versions (see notes).
144
155
- Clone the micropython repo and this repo in a folder, e.g. "MyESPCam". MicroPython version 1.24 or higher is required (at least commit 92484d8).
145
-
- You will have to add the ESP32-Camera driver (I used v2.0.13). To do this, add the following to the respective idf_component.yml file (e.g. in micropython/ports/esp32/main_esp32s3/idf_component.yml):
156
+
- You will have to add the ESP32-Camera driver (I used v2.0.15). To do this, add the following to the respective idf_component.yml file (e.g. in micropython/ports/esp32/main_esp32s3/idf_component.yml):
146
157
147
158
```yml
148
159
espressif/esp32-camera:
149
-
git: https://github.com/cnadler86/esp32-camera#At the moment I maintain a fork because of some unsolved bugs and conveniance.
Alternatively, you can clone the <https://github.com/cnadler86/esp32-camera> repository inside the esp-idf/components folder instead of altering the idf_component.yml file.
163
+
Alternatively, you can clone the <https://github.com/espressif/esp32-camera> repository inside the esp-idf/components folder instead of altering the idf_component.yml file.
153
164
154
165
### Add camera configurations to your board (optional, but recommended)
155
166
156
167
#### Supported Camera Models
157
168
158
-
This project supports various camera models out of the box. You typically only need to add a single line to your board config file ("mpconfigboard.h).
169
+
This project supports various boards with camera interface out of the box. You typically only need to add a single line to your board config file ("mpconfigboard.h).
159
170
Example (don't forget to add the empty line at the bottom):
160
171
161
172
```c
@@ -188,7 +199,6 @@ Below is a list of supported `MICROPY_CAMERA_MODEL_xxx` definitions:
188
199
#### For unsupported camera models
189
200
190
201
If your board is not yet supported, add the following lines to your board config-file "mpconfigboard.h" with the respective pins and camera parameters. Otherwise, you will need to pass all parameters during construction.
191
-
Don't forget the empty line at the bottom.
192
202
Example for Xiao sense:
193
203
194
204
```c
@@ -214,6 +224,9 @@ Example for Xiao sense:
214
224
#define MICROPY_CAMERA_GRAB_MODE (1) // 0=WHEN_EMPTY (might have old data, but less resources), 1=LATEST (best, but more resources)
215
225
216
226
```
227
+
#### Customize additional camera settings
228
+
229
+
If you want to customize additional camera setting or reduce the FW size by removing support for unused camera sensors, then take a look at the kconfig file of the esp32-camera driver and specify these on the sdkconfig file of your board.
217
230
218
231
### Build the API
219
232
@@ -239,28 +252,37 @@ If you experience problems, visit [MicroPython external C modules](https://docs.
239
252
240
253
## FPS benchmark
241
254
242
-
I didn't use a calibrated osziloscope, but here is a benchmark with my ESP32S3 (GrabMode=LATEST).
243
-
Using fb_count=2 doubles the FPS for JPEG. This might also aplly for other PixelFormats.
| CIF | 12.5 | No img | No img | 6.3 | 1.6 | 1.6 | 12.5 |
267
+
| HVGA | 3 | 3 | 2.5 | 12.5 | 6.3 | 6.3 | 25 |
268
+
| VGA | 3 | 3 | 3 | 12.5 | 3.6 | 3.6 | 25 |
269
+
| SVGA | 3 | 3 | 3 | 12.5 | 2.8 | 2.5 | 25 |
270
+
| XGA | No img | No img | No img | 6.3 | 1.6 | 1.6 | 12.5 |
271
+
| HD | No img | No img | No img | 6.3 | 1.4 | 1.3 | 12.5 |
272
+
| SXGA | 2 | 2 | 2 | 6.3 | 1 | 1 | 12.5 |
273
+
| UXGA | No img | No img | No img | 6.3 | 0.7 | 0.7 | 12.5 |
274
+
275
+
276
+
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