Can't update image quality based on ESP32-S3 - OV5640 sensor settings

Hi

I am writing this post to ask for the community’s help with an issue that I’m having with OV5640 sensor settings.

I use a custom board with an ESP32-S3 chip connected to an OV5640 sensor. I’m using platformio and trying to update the sensor settings like brightness, vFlip, and hMirror as usual:

// Initialize the camera
esp_err_t err = esp_camera_init(&config);
delay(1000);   // added a 1-second delay to let the camera sensor get stable (without this, the image quality was very unstable with a green tint
sensor_t *s = esp_camera_sensor_get();
s->set_hmirror(s, 1);

Even when using settings like this, nothing changes the image quality. So basically even when I specifically ask it to mirror the image, I always get an inverted image (regardless of what I set the setting as)

s->set_hmirror(s, 1);
//or 
s->set_brightness(s, 2);

I am trying to figure out what is causing this.
Below is my platformio.ini

[env:esp32cam]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino

platform_packages = 
	platformio/tool-openocd-esp32

board_build.mcu = esp32s3
board_build.flash_mode = dio            
board_build.partitions = huge_app.csv   
board_upload.flash_size: 4MB
board_build.memory_type= dio_opi       
board_build.f_flash = 80000000L
board_build.f_cpu = 240000000L
board_upload.maximum_ram_size = 2097152     ; RAM - 2MB
board_upload.maximum_size = 4194304     ; FLASH - 4MB


build_unflags = -std=gnu++11

build_flags = 
        -std=gnu++17
        -DBOARD_HAS_PSRAM
        -DARDUINO_ESP32S3_DEV
        -DARDUINO_USB_CDC_ON_BOOT=1
        -DARDUINO_USB_MODE=1
lib_deps = 
	espressif/esp32-camera@^2.0.4
	bblanchon/ArduinoJson @ ~6.21.0
	fhessel/esp32_https_server @ ^1.0.0

upload_speed = 921600
monitor_speed = 115200

If you can suggest anything, I’d be grateful.

Thanks!

If I remember correctly - it’s been a while - there are already some images in the buffer where the settings are not yet applied.

If you retrieve several images, the settings should become visible at some point.

I think the buffer can hold 4 images - depending on the psram size.
Everything should be correct for the 5th image.

Thanks for your reply @sivar2311

But the thing is, I get an updated image each time I move the camera; it’s just that the sensor settings are not applied. If the pictures were stored in the buffer, I would not get a real-time scene from the camera, right?

I’m using

config.grab_mode = CAMERA_GRAB_LATEST;
config.fb_count = 2;

to get the latest frame each time.

In this case, the settings should be available after grabbing the third frame. I don’t know how often you grab the frames. If you only grab a single frame, you will not see the changed settings.

But as I said, it’s been a while since I dealt with this.