ESP32 with OV2640 Camera

Dzandaa
Posts: 4
Joined: Tue May 28, 2019 11:00 am

ESP32 with OV2640 Camera

Postby Dzandaa » Tue May 28, 2019 5:25 pm

I have a TTGO T-Camera ESP32 WROVER with PSRAM and Camera Module OV2640

I use Arduino IDE with ESP32 Core Installation version: 1.02
The Camera Brightness, Contrast, Saturation, slider on the "CameraWebServer" doesn't not react correctly, also in a program, the last action deletes other actions, for example changing the saturation after the brightness reset the brightness
  1. //  Value and Type are int
  2.   sensor_t * s = esp_camera_sensor_get();    
  3.     switch(Type)
  4.     {
  5.       case CBrightness:
  6.         s->set_brightness(s, Value);  
  7.       break;  
  8.       case CSaturation:
  9.         s->set_saturation(s, Value);  
  10.       break;
  11.       case CContrast:
  12.         s->set_contrast(s, Value);  
  13.       break;      
  14.     }  
  15.  
I checked the camera code in comparison with the Datasheet of the OV2640 and at first sight, it seems correct.

Any idea?

Thank you.

tchalabi
Posts: 3
Joined: Sat Jun 19, 2021 9:43 pm

Re: ESP32 with OV2640 Camera

Postby tchalabi » Sat Jun 04, 2022 2:05 am

I'm struggling with the same problem.

? Were you able to find a solution?

Dzandaa
Posts: 4
Joined: Tue May 28, 2019 11:00 am

Re: ESP32 with OV2640 Camera

Postby Dzandaa » Sun Jun 05, 2022 10:52 am

Hi,

No, Sorry

Dzandaa
Posts: 4
Joined: Tue May 28, 2019 11:00 am

Re: ESP32 with OV2640 Camera

Postby Dzandaa » Sun Jun 05, 2022 11:02 am

Hi again,

I found this solution on Github, but don't test it.

Strange problems in adjusting the saturation and the brightness in ov2640
These bugs do not actually exist and are a problem of the available documents
When you execute the following commands
set_brightness(s,2);
set_contrast(s,2);
set_brightness(s,2);
The last command is always active and the previous commands are canceled.
To solve this problem, you must activate the desired effect and this is done with the following command

Run the following command at the end of all settings.

unsigned char enable_effect= 1(saturation and hue enable)+
2(aditional saturation enable)+
4(brighnes and contrast enable)+
8(spital effect1 enable green -> blue)+
16(spital effect1 enable gray -> read)+
32(remove (UV) in YUV color system)+
64(enable negative effect)+
128(remove (Y) in YUV color system) ;
write_SCCB(0xff, 0x00);
write_SCCB(0x7c, 0x00);
write_SCCB(0x7d,enable_effect);

command
write_SCCB(0x7c, ADRESS);
Preparing the address for data injection

ofter that use
The following command to inject data
write_SCCB(0x7d,byte_0);
write_SCCB(0x7d,byte_1);
write_SCCB(0x7d,byte_2);
.
.
.

The memory structure is as follows
byte_0 =enable_effect
byte_0->bit0 =saturation and hue
byte_0->bit1 =saturation enable
byte_0->bit2 =brighnes and contrast enable
byte_0->bit3 =green -> blue spitial effect (Antique and blunish and greenish and readdish and b&w) enable
byte_0->bit4 =gray -> read spitial effect (Antique and blunish and greenish and readdish and b&w) enable
byte_0->bit5 =remove (UV) in YUV color system
byte_0->bit6 =negative enable
byte_0->bit7 =remove (Y) in YUV color system
byte_1 =saturation1 0-255
byte_2 =hue 0-255
byte_3 =saturation2 0-255
byte_4 =reenter saturation2 in documents
byte_5 =spital effect green -> blue 0-255
byte_6 =spital effect gray -> read 0-255
byte_7 =contrast uper eadge 0-255
byte_8 =contrast lower eadge 0-255
byte_9 =brighnes 0-255
byte_10= if byte_10==4 contrast effective

Who is online

Users browsing this forum: No registered users and 50 guests