Sumeet Sharma
Sumeet Sharma

Reputation: 21

OV2640 inverted/green tint problem with ESP32-CAM

This is about the OV2640 cameras that come along with ESP32-CAM.

One set of my cameras work perfectly (sharp colourful and straight picture) with vflip & hflip = true. So I aligned my code that way.

While others give an 'inverted picture' with same code. When I remove vflip & hflip, the picture straightens but it is a 'green tinted picture'.

My ov2640 initializations are based on Igrr's (https://github.com/igrr/esp32-cam-demo). I am not using it directly but used guidance & pieces that I found relevant.

Interestingly, the Arduino example (https://www.instructables.com/ESP-32-Camera-Streaming-Video-Over-WiFi-Getting-St/) shows the correct picture (straight, no green tint) with these cameras!

I have double checked my OV2640 initialisation settings vs the ones done in Igrr's (behind Arduino) code but found no difference. Also tried various white balance/saturation/brightness/contrast related settings but no improvement. When auto-white-balance is switched-on at the end of all settings, picture turns blue.

Is anyone else facing these? Problem 1 - different OV2640 cameras behaving differently in terms of default vertical alignment? Is there a way to programatically detect this?

Problem 2 - when inverted (i.e., vflip & hflip = true), picture shows green tint (specially pink appears green) & otherwise loses colours (appears grey)

EDIT:

After SCCB initialisation, I run the following code (jpeg_init) to do ov2640 configuration.

esp_err_t jpeg_init(void)
{
  uint8_t i=0;
  if (write_reg(SENSOR_SELECT, COM7, COM7_SRST) != ESP_OK)
    return ESP_FAIL;
  
  vTaskDelay(10 / portTICK_PERIOD_MS);
  if (write_regs(ov2640_initial_settings_cif) != ESP_OK)
    return ESP_FAIL;
  ESP_LOGI(TAG_I2C, "ov2640_initial_settings_cif done");
  
  vTaskDelay(10 / portTICK_PERIOD_MS);
  if (write_regs(ov2640_settings_jpeg3) != ESP_OK)
    return ESP_FAIL; 
  ESP_LOGI(TAG_I2C, "ov2640_settings_jpeg3 done");
  
  vTaskDelay(10 / portTICK_PERIOD_MS);
  if (write_reg(DSP_SELECT, R_BYPASS, R_BYPASS_DSP_BYPAS) != ESP_OK)
    return ESP_FAIL;
  
  // settings for svga
  vTaskDelay(10 / portTICK_PERIOD_MS);
  if(write_regs(ov2640_settings_to_svga) != ESP_OK)
    return ESP_FAIL;
  ESP_LOGI(TAG_I2C, "ov2640_settings_to_svga done");
  
  vTaskDelay(10 / portTICK_PERIOD_MS);
  if (write_regs(win_regs) != ESP_OK)
    return ESP_FAIL;
  ESP_LOGI(TAG_I2C, "win_regs done");
  
  // settings for svga
  if (write_reg(SENSOR_SELECT, CLKRC, 0x00) !=ESP_OK)  
    return ESP_FAIL;
  if (write_reg(DSP_SELECT, R_DVP_SP, 0x08) !=ESP_OK) 
    return ESP_FAIL;
  vTaskDelay(10 / portTICK_PERIOD_MS);
  
  if (write_reg(DSP_SELECT, R_BYPASS, R_BYPASS_DSP_EN) != ESP_OK)
    return ESP_FAIL;
  
  //required when changing resolution
  vTaskDelay(10 / portTICK_PERIOD_MS);
  if (write_regs(ov2640_settings_jpeg3) != ESP_OK)
    return ESP_FAIL; 
  ESP_LOGI(TAG_I2C, "ov2640_settings_jpeg3 done");
  vTaskDelay(10 / portTICK_PERIOD_MS);
  
  if (set_reg_bits(SENSOR_SELECT, COM9, 5, 7, 0) != ESP_OK) // gainceiling = 0
    return ESP_FAIL;
  if (set_reg_bits(DSP_SELECT, CTRL3, 7, 1, 0) != ESP_OK) // set_bpc_dsp = false
    return ESP_FAIL;
  if (set_reg_bits(DSP_SELECT, CTRL3, 6, 1, 1) != ESP_OK) // set_wpc_dsp = true
    return ESP_FAIL;
  if (set_reg_bits(DSP_SELECT, CTRL1, 1, 1, 1) != ESP_OK) // set_lenc_dsp = true
    return ESP_FAIL;
  if (write_reg(DSP_SELECT, QS, 12) != ESP_OK) // quality = 12 Qs = quantization scale factor -- if jpeg
    return ESP_FAIL;
  vTaskDelay(10 / portTICK_PERIOD_MS);
  
  ESP_LOGI(TAG_I2C, "jpeg init done");
  return ESP_OK;
}

And here is the ov2640_regs.h that tells what is being written into which register:

#define DSP_SELECT 0 
#define SENSOR_SELECT 1


// DSP register bank FF=0x00
#define R_BYPASS            0x05
#define QS                  0x44
#define CTRLI               0x50
#define HSIZE               0x51
#define VSIZE               0x52
#define XOFFL               0x53
#define YOFFL               0x54
#define VHYX                0x55
#define DPRP                0x56
#define TEST                0x57
#define ZMOW                0x5A
#define ZMOH                0x5B
#define ZMHH                0x5C
#define BPADDR              0x7C
#define BPDATA              0x7D
#define CTRL2               0x86
#define CTRL3               0x87
#define SIZEL               0x8C
#define HSIZE8              0xC0
#define VSIZE8              0xC1
#define CTRL0               0xC2
#define CTRL1               0xC3
#define R_DVP_SP            0xD3
#define IMAGE_MODE          0xDA
#define RESET               0xE0
#define REGED               0xED  // was missing in original file
#define MS_SP               0xF0
#define SS_ID               0xF7
#define SS_CTRL             0xF8  // was mentioned as 0xF7 in original file
#define MC_BIST             0xF9
#define MC_AL               0xFA
#define MC_AH               0xFB
#define MC_D                0xFC
#define P_CMD               0xFD
#define P_STATUS            0xFE
#define BANK_SEL            0xFF  // register name in datasheet RA_DLMT. 0 = DSP related registers, 1 = Sensor related registers

#define R_BYPASS_DSP_EN         0x00
#define R_BYPASS_DSP_BYPAS      0x01

#define CTRLI_LP_DP         0x80
#define CTRLI_ROUND         0x40

#define CTRL0_AEC_EN        0x80
#define CTRL0_AEC_SEL       0x40
#define CTRL0_STAT_SEL      0x20
#define CTRL0_VFIRST        0x10
#define CTRL0_YUV422        0x08
#define CTRL0_YUV_EN        0x04
#define CTRL0_RGB_EN        0x02
#define CTRL0_RAW_EN        0x01

#define CTRL1_AWB           0x08 // Enable AWB 

#define CTRL2_DCW_EN        0x20
#define CTRL2_SDE_EN        0x10
#define CTRL2_UV_ADJ_EN     0x08
#define CTRL2_UV_AVG_EN     0x04
#define CTRL2_CMX_EN        0x01

#define CTRL3_BPC_EN        0x80
#define CTRL3_WPC_EN        0x40

#define R_DVP_SP_AUTO_MODE  0x80

#define IMAGE_MODE_Y8_DVP_EN    0x40
#define IMAGE_MODE_JPEG_EN      0x10
#define IMAGE_MODE_YUV422       0x00
#define IMAGE_MODE_RAW10        0x04
#define IMAGE_MODE_RGB565       0x08
#define IMAGE_MODE_HREF_VSYNC   0x02
#define IMAGE_MODE_LBYTE_FIRST  0x01

#define RESET_MICROC            0x40
#define RESET_SCCB              0x20
#define RESET_JPEG              0x10
#define RESET_DVP               0x04
#define RESET_IPU               0x02
#define RESET_CIF               0x01

#define MC_BIST_RESET           0x80
#define MC_BIST_BOOT_ROM_SEL    0x40
#define MC_BIST_12KB_SEL        0x20
#define MC_BIST_12KB_MASK       0x30
#define MC_BIST_512KB_SEL       0x08
#define MC_BIST_512KB_MASK      0x0C
#define MC_BIST_BUSY_BIT_R      0x02
#define MC_BIST_MC_RES_ONE_SH_W 0x02
#define MC_BIST_LAUNCH          0x01


/*typedef enum {
    BANK_DSP, BANK_SENSOR, BANK_MAX
} ov2640_bank_t; */

// Sensor register bank FF=0x01
#define GAIN                0x00
#define COM1                0x03
#define REG04               0x04
#define REG08               0x08
#define COM2                0x09
#define REG_PID             0x0A  // datasheet name is - Product ID number MSB
#define REG_VER             0x0B  // datasheet name is - Product ID number LSB
#define COM3                0x0C
#define COM4                0x0D  // not in datasheet
#define AEC                 0x10
#define CLKRC               0x11
#define COM7                0x12
#define COM8                0x13
#define COM9                0x14 // AGC gain ceiling 
#define COM10               0x15
#define HSTART              0x17  // datasheet name is HREFST. Horizontal window start
#define HSTOP               0x18  // datasheet name is HREFEND
#define VSTART              0x19  // datasheet name is VSTRT
#define VSTOP               0x1A  // datasheet name is VEND
#define MIDH                0x1C
#define MIDL                0x1D
#define AEW                 0x24
#define AEB                 0x25
#define VV                  0x26
#define REG2A               0x2A  // Line interval adjustment - will impact frame rate. MSB
#define FRARL               0x2B  // LSB
#define ADDVSL              0x2D
#define ADDVSH              0x2E
#define YAVG                0x2F
#define HSDY                0x30 // Reserved in datasheet
#define HEDY                0x31 // Reserved in datasheet
#define REG32               0x32
#define ARCOM2              0x34
#define REG45               0x45  // remaining bits of AGC and AEC
#define FLL                 0x46
#define FLH                 0x47
#define COM19               0x48
#define ZOOMS               0x49
#define COM22               0x4B  // flash light control
#define COM25               0x4E
#define BD50                0x4F
#define BD60                0x50
#define REG5D               0x5D
#define REG5E               0x5E
#define REG5F               0x5F
#define REG60               0x60
#define HISTO_LOW           0x61
#define HISTO_HIGH          0x62

#define REG04_DEFAULT       0x28  // datasheet default value of register is 0x20
#define REG04_HFLIP_IMG     0x80
#define REG04_VFLIP_IMG     0x40
#define REG04_VREF_EN       0x10
#define REG04_HREF_EN       0x08
#define REG04_SET(x)        (REG04_DEFAULT|x)

#define CLKRC_2X            0x80
#define CLKRC_2X_UXGA       (0x01 | CLKRC_2X)
#define CLKRC_2X_SVGA       CLKRC_2X
#define CLKRC_2X_CIF        CLKRC_2X

#define COM2_STDBY          0x10
#define COM2_OUT_DRIVE_1x   0x00
#define COM2_OUT_DRIVE_2x   0x01
#define COM2_OUT_DRIVE_3x   0x02
#define COM2_OUT_DRIVE_4x   0x03

#define COM3_DEFAULT        0x38
#define COM3_BAND_50Hz      0x04
#define COM3_BAND_60Hz      0x00
#define COM3_BAND_AUTO      0x02
#define COM3_BAND_SET(x)    (COM3_DEFAULT|x)

#define COM7_SRST           0x80
#define COM7_RES_UXGA       0x00 // UXGA 
#define COM7_RES_SVGA       0x40 // SVGA 
#define COM7_RES_CIF        0x20 // CIF  
#define COM7_ZOOM_EN        0x04 // Enable Zoom 
#define COM7_COLOR_BAR      0x02 // Enable Color Bar Test 

#define COM8_DEFAULT        0xC0  // datasheet default value of register is 0xC8 ie agc and aec on
#define COM8_BNDF_EN        0x20 // Enable Banding filter 
#define COM8_AGC_EN         0x04 // AGC Auto/Manual control selection 
#define COM8_AEC_EN         0x01 // Auto/Manual Exposure control 
#define COM8_SET(x)         (COM8_DEFAULT|x)

#define COM9_DEFAULT        0x08 // default value in datasheet is 0x50 ie AGC gain celing 8x. 0x08 means 2x
#define COM9_AGC_GAIN_2x    0x00 // AGC:    2x 
#define COM9_AGC_GAIN_4x    0x01 // AGC:    4x 
#define COM9_AGC_GAIN_8x    0x02 // AGC:    8x 
#define COM9_AGC_GAIN_16x   0x03 // AGC:   16x 
#define COM9_AGC_GAIN_32x   0x04 // AGC:   32x 
#define COM9_AGC_GAIN_64x   0x05 // AGC:   64x 
#define COM9_AGC_GAIN_128x  0x06 // AGC:  128x 
#define COM9_AGC_SET(x)     (COM9_DEFAULT|(x<<5))

#define COM10_HREF_EN       0x80 // HSYNC changes to HREF - In datasheet this is reserved bit
#define COM10_HSYNC_EN      0x40 // HREF changes to HSYNC - In datasheet this is reserved bit
#define COM10_PCLK_FREE     0x20 // PCLK output option: free running PCLK - In datasheet : 0x00= pclk always output 0x20= pclk output qualified by href
#define COM10_PCLK_EDGE     0x10 // Data is updated at the rising edge of PCLK 
#define COM10_HREF_NEG      0x08 // HREF negative 
#define COM10_VSYNC_NEG     0x02 // VSYNC negative 
#define COM10_HSYNC_NEG     0x01 // HSYNC negative - this is reserved bit in the datasheet

#define VV_AGC_TH_SET(h,l)  ((h<<4)|(l&0x0F))

#define REG32_UXGA          0x36
#define REG32_SVGA          0x09
#define REG32_CIF           0x89 // this means pclk freq divide by 2


// 30fps@24MHz
const DRAM_ATTR uint8_t ov2640_initial_settings_cif[][2] = {
  {BANK_SEL, DSP_SELECT},
  {0x2c, 0xff},
  {0x2e, 0xdf},
  {BANK_SEL, SENSOR_SELECT},
  {0x3c, 0x32},
  {CLKRC, 0x01},
  {COM2, COM2_OUT_DRIVE_3x},
  {REG04, REG04_DEFAULT | REG04_VREF_EN | REG04_VFLIP_IMG | REG04_HFLIP_IMG},         // flipping the camera image vertically and horizontally
  // {REG04, REG04_DEFAULT | REG04_VREF_EN | REG04_HFLIP_IMG },                       // flipping the camera image just horizontally
  // {REG04, REG04_DEFAULT | REG04_VREF_EN | REG04_VFLIP_IMG },                  // flipping the camera image just vertically
  // {REG04, REG04_DEFAULT | REG04_VREF_EN },                                            // not flipping the camera image
  {COM8, COM8_DEFAULT | COM8_BNDF_EN | COM8_AGC_EN | COM8_AEC_EN},
  {COM9, COM9_AGC_SET(COM9_AGC_GAIN_8x)},
  {0x2c, 0x0c},
  {0x33, 0x78},
  {0x3a, 0x33},
  {0x3b, 0xfB},
  {0x3e, 0x00},
  {0x43, 0x11},
  {0x16, 0x10},
  {0x39, 0x92},
  {0x35, 0xda},
  {0x22, 0x1a},
  {0x37, 0xc3},
  {0x23, 0x00},
  {ARCOM2, 0xc0},
  {0x06, 0x88},
  {0x07, 0xc0},
  {COM4, 0x87},
  {0x0e, 0x41},
  {0x4c, 0x00},
  {0x4a, 0x81},
  {0x21, 0x99},
  {AEW, 0x40},
  {AEB, 0x38},
  {VV, VV_AGC_TH_SET(8,2)},
  {0x5c, 0x00},
  {0x63, 0x00},
  {HISTO_LOW, 0x70},
  {HISTO_HIGH, 0x80},
  {0x7c, 0x05},
  {0x20, 0x80},
  {0x28, 0x30},
  {0x6c, 0x00},
  {0x6d, 0x80},
  {0x6e, 0x00},
  {0x70, 0x02},
  {0x71, 0x94},
  {0x73, 0xc1},
  {0x3d, 0x34},
  {0x5a, 0x57},
  {BD50, 0xbb},
  {BD60, 0x9c},
  {COM7, COM7_RES_CIF},
  {HSTART, 0x11},
  {HSTOP, 0x43},
  {VSTART, 0x00},
  {VSTOP, 0x25},
  {REG32, 0x89},
  {0x37, 0xc0},
  {BD50, 0xca},
  {BD60, 0xa8},
  {0x6d, 0x00},
  {0x3d, 0x38},
  {BANK_SEL, DSP_SELECT},
  {0xe5, 0x7f},
  {MC_BIST, MC_BIST_RESET | MC_BIST_BOOT_ROM_SEL},
  {0x41, 0x24},
  {RESET, RESET_JPEG | RESET_DVP},
  {0x76, 0xff},
  {0x33, 0xa0},
  {0x42, 0x20},
  {0x43, 0x18},
  {0x4c, 0x00},
  {CTRL3, CTRL3_WPC_EN | 0x10 },
  {0x88, 0x3f},
  {0xd7, 0x03},
  {0xd9, 0x10},
  {R_DVP_SP, R_DVP_SP_AUTO_MODE | 0x02},
  {0xc8, 0x08},
  {0xc9, 0x80},
  {BPADDR, 0x00},
  {BPDATA, 0x00},
  {BPADDR, 0x03},
  {BPDATA, 0x48},
  {BPDATA, 0x48},
  {BPADDR, 0x08},
  {BPDATA, 0x20},
  {BPDATA, 0x10},
  {BPDATA, 0x0e},
  {0x90, 0x00},
  {0x91, 0x0e},
  {0x91, 0x1a},
  {0x91, 0x31},
  {0x91, 0x5a},
  {0x91, 0x69},
  {0x91, 0x75},
  {0x91, 0x7e},
  {0x91, 0x88},
  {0x91, 0x8f},
  {0x91, 0x96},
  {0x91, 0xa3},
  {0x91, 0xaf},
  {0x91, 0xc4},
  {0x91, 0xd7},
  {0x91, 0xe8},
  {0x91, 0x20},
  {0x92, 0x00},
  {0x93, 0x06},
  {0x93, 0xe3},
  {0x93, 0x05},
  {0x93, 0x05},
  {0x93, 0x00},
  {0x93, 0x04},
  {0x93, 0x00},
  {0x93, 0x00},
  {0x93, 0x00},
  {0x93, 0x00},
  {0x93, 0x00},
  {0x93, 0x00},
  {0x93, 0x00},
  {0x96, 0x00},
  {0x97, 0x08},
  {0x97, 0x19},
  {0x97, 0x02},
  {0x97, 0x0c},
  {0x97, 0x24},
  {0x97, 0x30},
  {0x97, 0x28},
  {0x97, 0x26},
  {0x97, 0x02},
  {0x97, 0x98},
  {0x97, 0x80},
  {0x97, 0x00},
  {0x97, 0x00},
  {0xa4, 0x00},
  {0xa8, 0x00},
  {0xc5, 0x11},
  {0xc6, 0x51},
  {0xbf, 0x80},
  {0xc7, 0x10},
  {0xb6, 0x66},
  {0xb8, 0xA5},
  {0xb7, 0x64},
  {0xb9, 0x7C},
  {0xb3, 0xaf},
  {0xb4, 0x97},
  {0xb5, 0xFF},
  {0xb0, 0xC5},
  {0xb1, 0x94},
  {0xb2, 0x0f},
  {0xc4, 0x5c},
  {CTRL1, 0xfd},
  {0x7f, 0x00},
  {0xe5, 0x1f},
  {0xe1, 0x67},
  {0xdd, 0x7f},
  {IMAGE_MODE, 0x00},
  {RESET, 0x00},
  {R_BYPASS, R_BYPASS_DSP_EN},
  {0, 0}
};


const DRAM_ATTR uint8_t ov2640_settings_to_svga[][2] = {
  {BANK_SEL, SENSOR_SELECT},
  {COM7, COM7_RES_SVGA},
  
  //Set the sensor output window
  {COM1, 0x0A},
  {REG32, REG32_SVGA},
  {HSTART, 0x11},
  {HSTOP, 0x43},
  {VSTART, 0x00},
  {VSTOP, 0x4b},
  
  //{CLKRC, 0x00},
  {0x37, 0xc0},
  {BD50, 0xca},
  {BD60, 0xa8},
  {0x5a, 0x23},
  {0x6d, 0x00},
  {0x3d, 0x38},
  {0x39, 0x92},
  {0x35, 0xda},
  {0x22, 0x1a},
  {0x37, 0xc3},
  {0x23, 0x00},
  {ARCOM2, 0xc0},
  {0x06, 0x88},
  {0x07, 0xc0},
  {COM4, 0x87},
  {0x0e, 0x41},
  {0x42, 0x03},
  {0x4c, 0x00},
  {BANK_SEL, DSP_SELECT},
  {RESET, RESET_DVP},
  
  //Set the sensor resolution (UXGA, SVGA, CIF)
  {HSIZE8, 0x64},
  {VSIZE8, 0x4B},
  {SIZEL, 0x00},
  
  //Set the image window size >= output size
  {HSIZE, 0xC8},
  {VSIZE, 0x96},
  {XOFFL, 0x00},
  {YOFFL, 0x00},
  {VHYX, 0x00},
  {TEST, 0x00},
  
  {CTRL2, CTRL2_DCW_EN | 0x1D},
  {CTRLI, CTRLI_LP_DP | 0x00},
  //{R_DVP_SP, 0x08},
  {0, 0}
};


const DRAM_ATTR uint8_t ov2640_settings_jpeg3[][2] = {
  {BANK_SEL, DSP_SELECT},
  {RESET, RESET_JPEG | RESET_DVP},
  {IMAGE_MODE, IMAGE_MODE_JPEG_EN | IMAGE_MODE_HREF_VSYNC},
  {0xD7, 0x03},
  {0xE1, 0x77},
  {0xE5, 0x1F},
  {0xD9, 0x10},
  {0xDF, 0x80},
  {0x33, 0x80},
  {0x3C, 0x10},
  {0xEB, 0x30},
  {0xDD, 0x7F},
  {RESET, 0x00},
  {0, 0}
};

// max_x is for resolution / 4. w = width of output window / 4
//const int max_x = 100, max_y = 74, offset_x = 0, offset_y = 0, w = 100, h = 74; // for cif
 const int max_x = 200, max_y = 150, offset_x = 0, offset_y = 0, w = 160, h = 120; // for svga
// const int max_x = 400, max_y = 300, offset_x = 0, offset_y = 0, w = 400, h = 300; // for uxga jpeg 1600x1200
//const int max_x = 400, max_y = 300, offset_x = 0, offset_y = 0, w = 160, h = 120; // for uxga jpeg 640x480

uint8_t win_regs[][2] = {
  {BANK_SEL, DSP_SELECT},
  {HSIZE, max_x & 0xFF},
  {VSIZE, max_y & 0xFF},
  {XOFFL, offset_x & 0xFF},
  {YOFFL, offset_y & 0xFF},
  {VHYX, ((max_y >> 1) & 0X80) | ((offset_y >> 4) & 0X70) | ((max_x >> 5) & 0X08) | ((offset_y >> 8) & 0X07)},
  {TEST, (max_x >> 2) & 0X80},
  {ZMOW, (w)&0xFF},
  {ZMOH, (h)&0xFF},
  {ZMHH, ((h>>6)&0x04)|((w>>8)&0x03)},
  {0, 0}
};

Upvotes: 2

Views: 3487

Answers (3)

Dimitre L
Dimitre L

Reputation: 3

I had this problem today, the red become green in the picture. to solve this I've added another bit flip to my flip function, so the register HREF and VREF are inverted too. All perfect now:

#define REG04               0x04
#define REG04_DEFAULT       0x28
#define REG04_HFLIP_IMG     0x80
#define REG04_VFLIP_IMG     0x40
#define REG04_VREF_EN       0x10
#define REG04_HREF_EN       0x08

if (horiz) {
    reg |= REG04_HFLIP_IMG;
    reg |= REG04_HREF_EN;
} 
else {
    reg &= ~REG04_HFLIP_IMG;
    reg &= ~REG04_HREF_EN;
}

if (vert) {
    reg |= REG04_VFLIP_IMG;
    reg |= REG04_VREF_EN;
} 
else {
    reg &= ~REG04_VFLIP_IMG;
    reg &= ~REG04_VREF_EN;
}

Upvotes: 0

verpas
verpas

Reputation: 95

If you used the build in functions provided by the esp_camera library your life would be a lot easier.

Do this to get sensor data and to set the registers using the functions,

sensor_t* sensor = esp_camera_sensor_get();

sensor->set_gain_ctrl(sensor, 0);
sensor->set_exposure_ctrl(sensor, 0);
.
.
.

Look into the libary to find what values you could use for each function.

To remove the green tint try disabling all of the auto functions except lenc, and set the sensor settings after initialisation to white balance mode 3 or 4, it should get rid of the green tint. The sensor initialises with AGC and AWB enabled so you need to disable them and fix the white balance before taking a picture. That's what worked for me.

So just to re-state,

  1. Initialise,
  2. Set settings to remove the auto gain/wb,
  3. Take pic,
  4. Green tint removed,

Last thing you could try is to take some pictures before you get the picture you want. So you would save to the frame buffer and then return the frame buffer multiple times. Hope this helps someone even though this was posted two years ago.

Upvotes: 1

Peter
Peter

Reputation: 31

Try do more photos in a row. I had problems with green tint also. Tried different options and then i found on some forum that you need do more than just one photo to have nice looking photo. So i tried 1.photo green tint, second photo too, but third photo clear image. Nice.

Upvotes: 2

Related Questions