ESP-EYE (ESP32) Poor Picture Quality

Any suggestions for improving the image quality on my ESP-EYE? I’ve tried various distances from the camera, different background colors, and different resolutions. Here are a few examples:


Those were captured by going to Data Acquisition on the Edge Impulse website, connecting my ESP32, and clicking Start sampling.

Project ID:

Context/Use case:
My daughter and I are building a Lego block sorter for an elementary school project, so reliability far exceeds the need for speed or being able to detect a large variety of different blocks. We’ve built a light tunnel to eliminate shadows, but the photo quality is very poor. Thank you in advance!

Hi @jimmejames,

That sounds like a fun project! Are you using the pre-compiled firmware on the ESP-EYE and controlling image collection from Edge Impulse? Or did you use the deprecated example firmware here: GitHub - edgeimpulse/example-esp32-cam: Builds and runs an exported image classification impulse on ESP32 Cam?

In my experience, the cameras on many of these small dev boards (i.e. ESP-EYE, Arduino Portenta) are not very good. You should be able to adjust the focus by carefully rotating the plastic housing around the lens (e.g. using needle nose pliers). It looks like you may also have too much lighting on the first two images. The fourth image looks about right (lighting-wise), and is probably about as good as you’re going to get from these cameras.

I might recommend trying this firmware (GitHub - easytarget/esp32-cam-webserver: Expanded version of the Espressif ESP webcam) to see if the image quality looks any better and how it compares to what you are seeing in the Edge Impulse Studio.

1 Like

Appreciate the suggestions! I used the example from here, replaced the AI_Thinker pinout with an ESP-EYE pinout, and uploaded to my board as a ESP32 Dev Module in the Arduino IDE 2.0.3. The picture was good enough (and fast enough) that it allowed me to adjust the focus.

Here’s the image from the above example:

As for the firmware, I followed the Edge Impulse steps through Data acquisition, to Impulse design, and onto Versioning and Deployment. On the Deployment tab, I selected ESP-EYE (ESP32) and used the export to upload the build to my ESP32. I took that build, uploaded it to my ESP32, and it generated the below image. (Note, I didn’t disconnect or change anything about the ESP-EYE between taking the above and below images. EDIT: except upload EI to it, if this was not obvious).

Most surprising, the image from the web server is about 58KB, the 480x320 from EI is about 5KB, and the 64x64 image is about 2KB (I don’t know why one is rotate 180 deg from the other). Is it possible to capture in a higher resolution in EI? We will build a training data set from photos we take from our setup, but I’d like to get the camera in the final configuration to maximize the detection probability.

You set the image resolution inside the Edge Impulse Studio on the Create Impulse - Create Impulse - Image Data Block. You can go higher in resolution but the ESP may not have the RAM to accommodate larger images for input to the Impulse.

1 Like

Thank you @MMarcial! We added a diode to the 12VDC source to decrease the brightness of the light tunnel (will continue to experiment) and have played with the Image Data variables to find a sweet spot. Here are a couple examples, but the image quality has significantly improved!

Couple examples at different image resolutions (480x480 and 672x672):


1 Like