Prerequisites
- Camera module physically connected to Proton AI Core (see Camera Hardware)
esp32-cameralibrary installed (instructions below)- Arduino IDE with the ESP32 board package, or a PlatformIO project configured for ESP32-S3
Installing the Camera Library
- Arduino IDE
- PlatformIO
The
esp32-camera driver is bundled with Espressif’s official ESP32 Arduino board package. If you have already installed the esp32 board package via Boards Manager, no additional library installation is needed.To confirm, go to Tools → Board → Boards Manager, search for esp32 by Espressif Systems, and ensure it is installed at version 2.x or later.Camera Configuration
Theesp32-camera driver is configured through the camera_config_t struct before calling esp_camera_init(). You assign GPIO pin numbers, clock frequency, pixel format, and frame buffer settings here. The example below shows a full configuration for the OV2640 sensor.
camera_config.cpp
Capturing a Frame
Once the camera is initialised, callesp_camera_fb_get() to grab a frame buffer from the driver. Always return the buffer with esp_camera_fb_return() after you are done — failing to do so exhausts the frame buffer pool.
capture.cpp
Frame Sizes
Theframe_size field of camera_config_t controls the output resolution. The OV2640 supports resolutions up to 1600×1200; the OV3660 supports higher resolutions. Choose a frame size that balances image quality with your application’s memory and processing requirements.
