From b8d62d452baf726fb8c257fb3c52d5a11e989b3a Mon Sep 17 00:00:00 2001 From: Aditya Rao - IIT Madras <166688891+aditya-rao-iit-m@users.noreply.github.com> Date: Tue, 6 May 2025 14:13:20 +0530 Subject: [PATCH 1/2] Update README.md --- README.md | 192 +----------------------------------------------------- 1 file changed, 1 insertion(+), 191 deletions(-) diff --git a/README.md b/README.md index cda53f37..fd33ba69 100644 --- a/README.md +++ b/README.md @@ -1,191 +1 @@ -# Unleash the full power of you ESP32 camera - -This Arduino library kickstarts your ESP32 camera projects -by providing you a set of tools to easily interact your the camera. - -## Take a picture - -Forget complex configurations and verbose code. - -```cpp -#include - -using eloq::camera; - -void setup() { - delay(3000); - Serial.begin(115200); - Serial.println("___GET YOUR FIRST PICTURE___"); - - camera.pinout.aithinker(); - camera.brownout.disable(); - camera.resolution.vga(); - - while (!camera.begin().isOk()) - Serial.println(camera.exception.toString()); -} - -void loop() { - if (!camera.capture().isOk()) { - Serial.println(camera.exception.toString()); - return; - } - - Serial.printf( - "JPEG size in bytes: %d. Width: %dpx. Height: %dpx.\n", - camera.getSizeInBytes(), - camera.resolution.getWidth(), - camera.resolution.getHeight() - ); -} -``` - -## Save picture to SD card - -Timestamped file storage on your SD card that you can finally understand! - -```cpp -#include -#include -#include - -void setup() { - delay(3000); - Serial.begin(115200); - Serial.println("___SAVE PIC TO SD CARD___"); - - camera.pinout.freenove_s3(); - camera.brownout.disable(); - camera.resolution.vga(); - camera.quality.high(); - - ntp.offsetFromGreenwhich(0); - ntp.isDaylight(); - ntp.server("pool.ntp.org"); - - // init camera - while (!camera.begin().isOk()) - Serial.println(camera.exception.toString()); - - // init SD - while (!sdmmc.begin().isOk()) - Serial.println(sdmmc.exception.toString()); - - // connect to WiFi to sync NTP - while (!wifi.connect().isOk()) - Serial.println(wifi.exception.toString()); - - // get NTP time - while (!ntp.begin().isOk()) - Serial.println(ntp.exception.toString()); - - Serial.println("Camera OK"); - Serial.println("SD card OK"); - Serial.println("NTP OK"); - Serial.print("Current time is "); - Serial.println(ntp.datetime()); -} - -void loop() { - if (!camera.capture().isOk()) { - Serial.println(camera.exception.toString()); - return; - } - - // save under nested directory - String date = ntp.date(); - String datetime = ntp.datetime(); - - if (sdmmc.save(camera.frame).inside(date).to(datetime, "jpg").isOk()) { - Serial.print("File written to "); - Serial.println(sdmmc.session.lastFilename); - } - else Serial.println(sdmmc.session.exception.toString()); -} -``` - -## Object detection - -Running Edge Impulse FOMO object detection is a piece of cake. - -```cpp -#include -#include -#include - -using eloq::camera; -using eloq::ei::fomo; - -void setup() { - delay(3000); - Serial.begin(115200); - Serial.println("__EDGE IMPULSE FOMO (NO-PSRAM)__"); - - // camera settings - camera.pinout.freenove_s3(); - camera.brownout.disable(); - camera.resolution.yolo(); - camera.pixformat.rgb565(); - - // init camera - while (!camera.begin().isOk()) - Serial.println(camera.exception.toString()); - - Serial.println("Camera OK"); - Serial.println("Put object in front of camera"); -} - - -void loop() { - if (!camera.capture().isOk()) { - Serial.println(camera.exception.toString()); - return; - } - - // run FOMO - if (!fomo.run().isOk()) { - Serial.println(fomo.exception.toString()); - return; - } - - // how many objects were found? - Serial.printf( - "Found %d object(s) in %dms\n", - fomo.count(), - fomo.benchmark.millis() - ); - - // if no object is detected, return - if (!fomo.foundAnyObject()) - return; - - // if you expect to find a single object, use fomo.first - Serial.printf( - "Found %s at (x = %d, y = %d) (size %d x %d). " - "Proba is %.2f\n", - fomo.first.label, - fomo.first.x, - fomo.first.y, - fomo.first.width, - fomo.first.height, - fomo.first.proba - ); - - // if you expect to find many objects, use fomo.forEach - if (fomo.count() > 1) { - fomo.forEach([](int i, bbox_t bbox) { - Serial.printf( - "#%d) Found %s at (x = %d, y = %d) (size %d x %d). " - "Proba is %.2f\n", - i + 1, - bbox.label, - bbox.x, - bbox.y, - bbox.width, - bbox.height, - bbox.proba - ); - }); - } -} -``` \ No newline at end of file +RoboSoccer Camera Object Detection From 3cbe3cefe8b517d323cbb78fd6ae7f840e1a223a Mon Sep 17 00:00:00 2001 From: Aditya Rao - IIT Madras <166688891+aditya-rao-iit-m@users.noreply.github.com> Date: Tue, 6 May 2025 14:19:15 +0530 Subject: [PATCH 2/2] Update pinout.h --- src/eloquent_esp32cam/camera/pinout.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/eloquent_esp32cam/camera/pinout.h b/src/eloquent_esp32cam/camera/pinout.h index d7e99e40..0d82d037 100644 --- a/src/eloquent_esp32cam/camera/pinout.h +++ b/src/eloquent_esp32cam/camera/pinout.h @@ -183,6 +183,30 @@ namespace Eloquent { return true; } + /** + * + */ + bool robosoccer_esp32_s3() { + pins.d0 = 15; + pins.d1 = 17; + pins.d2 = 18; + pins.d3 = 16; + pins.d4 = 14; + pins.d5 = 12; + pins.d6 = 11; + pins.d7 = 48; + pins.xclk = 10; + pins.pclk = 13; + pins.vsync = 38; + pins.href = 47; + pins.sccb_sda = 40; + pins.sccb_scl = 39; + pins.pwdn = -1; + pins.reset = -1; + pins.flashlight = -1; + return true; + } + /** * */