Android L0 版本 awb Perference gain 不生效问题
时间:10-02
整理:3721RD
点击:
[DESCRIPTION]
CAMERA_tuning_para_sensorNamemipiraw.cpp文件中修改AWB preference color gain不起作用。
[SOLUTION]
1:MT6582/MT6592 KK 版本的AWB preference color gain 修改是在 camera_tuning_para_SensorNamemipiraw.cpp中。
即下面部分:

L 版本升级的话,增加了 针对不同 LV 下 不同色温下 AWB Preference Gain 的调整。
如果直接修改camera_tuning_para_SensorNamemipiraw.cpp 文件中 Preference Gain部分,是不会 生效的。
在 L0 版本上需要做如下修改:
sensor_awb.cpp Path:alps\vendor\mediatek\proprietary\custom\ [$platform,$project] \hal\imgsensor_src\sensor_awb.cpp中
(1) Add
- AWB_PARAM2_T&getAWBParam2_SensorName();
- Add #if defined(SensorNameDefine)
- case SensorNameId:
- return getAWBParam2_SensorName ();
- #endif
- AWB_PARAM2_T& getAWBParam2_IMX135();
- AWB_PARAM2_T& getAWBParam2(int sensorId)
- {
- switch(sensorId)
- {
- #if defined(IMX135_MIPI_RAW)
- case IMX135MIPI_SENSOR_ID:
- return getAWBParam2_IMX135();
- #endif
- default:
- return getAWBParam2_default();
- }
- return getAWBParam2_default();
- }
- AWB_PARAM2_T& getAWBParam2_IMX135()
- {
- static AWB_PARAM2_T rAWBParam =
- { {
- // LV0 LV1 LV2 LV3 LV4 LV5 LV6 LV7 LV8 LV9
- {
- {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512,512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512,512}, {512, 512, 512},
- // LV10 LV11 LV12 LV13 LV14 LV15 LV16 LV17 LV18
- {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512,512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 515,512}
- }, // STROBE
- {
- {490, 512, 512}, {490, 512, 512}, {490, 512, 512}, {490, 512, 512}, {490,512, 512}, {490, 512, 512}, {490, 512, 512}, {490, 512, 512}, {490, 512,512}, {490, 512, 512},
- {490, 512, 512}, {490, 512, 512}, {490, 512, 512}, {490, 512, 512}, {490,512, 512}, {490, 512, 512}, {490, 512, 512}, {490, 512, 512}, {490, 512,512}
- }, // TUNGSTEN
- {
- {512, 508, 577}, {512, 508, 577}, {512, 508, 577}, {512, 508, 577}, {512,508, 577}, {512, 508, 577}, {512, 508, 577}, {512, 508, 577}, {512, 508,577}, {512, 508, 577},
- {512, 508, 577}, {512, 508, 577}, {512, 508, 577}, {512, 508, 577}, {512,508, 577}, {512, 508, 577}, {512, 508, 577}, {512, 508, 577}, {512, 508,577}
- }, // WARM F
- {
- {520, 512, 512}, {520, 512, 512}, {520, 512, 512}, {520, 512, 512}, {520,512, 512}, {520, 512, 512}, {520, 512, 512}, {520, 512, 512}, {520, 512,512}, {520, 512, 512},
- {520, 512, 512}, {520, 512, 512}, {520, 512, 512}, {520, 512, 512}, {520,512, 512}, {520, 512, 512}, {520, 512, 512}, {520, 512, 512}, {520, 512,512}
- }, // F
- {
- {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512,512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512,512}, {512, 512, 512},
- {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512,512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512,512}
- }, // CWF
- {
- {518, 512, 512}, {518, 512, 512}, {518, 512, 512}, {518, 512, 512}, {518,512, 512}, {518, 512, 512}, {518, 512, 512}, {518, 512, 512}, {518, 512,512}, {518, 512, 512},
- {518, 512, 512}, {518, 512, 512}, {518, 512, 512}, {518, 512, 512}, {518,512, 512}, {518, 512, 512}, {518, 512, 512}, {518, 512, 512}, {518, 512,512}
- }, // DAYLIGHT
- {
- {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512,512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512,512}, {512, 512, 512},
- {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512,512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512,512}
- }, // SHADE
- {
- {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512,512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512,512}, {512, 512, 512},
- {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512,512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512,512}
- } // DAYLIGHT F
- }
- };
- return rAWBParam;
不同色温下不同LV 下 AWB Preference Gain的修改在 awb_tuning_custom_main.cpp或者 awb_tuning_custom_sub.cpp 档案中
但是这样的修改,会影响到 减弱的所有camera 的效果。
awb_tuning_custom_main.cpp或者awb_tuning_custom_sub.cpp 档案 路径:
alps\vendor\mediatek\proprietary\custom\ [$platform,$project] \hal\camera_3a\awb_tuning_custom_main.cpp
因此如果要客制化不同 色温下不同LV 下 AWB Preference Gain的话,建议参考如下说明:
- sensor_awb.cpp
- Path:alps\vendor\mediatek\proprietary\custom\ [$platform,$project]
(1) Add
- AWB_PARAM2_T&getAWBParam2_SensorName();
- #if defined(SensorNameDefine) case SensorNameId:
- return getAWBParam2_SensorName ();
- #endif
- AWB_PARAM2_T& getAWBParam2_IMX135();
- AWB_PARAM2_T& getAWBParam2(int sensorId)
- {
- switch(sensorId)
- {
- #if defined(IMX135_MIPI_RAW)
- case IMX135MIPI_SENSOR_ID:
- return getAWBParam2_IMX135();
- #endif
- default:
- return getAWBParam2_default();
- }
- return getAWBParam2_default();
- }
色温下不同LV 下 AWB Preference Gain 。 如下以 IMX135 为例说明:
- AWB_PARAM2_T& getAWBParam2_IMX135()
- {
- static AWB_PARAM2_T rAWBParam =
- { {
- // LV0 LV1 LV2 LV3 LV4 LV5 LV6 LV7 LV8 LV9
- {
- {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512,512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512,512}, {512, 512, 512},
- // LV10 LV11 LV12 LV13 LV14 LV15 LV16 LV17 LV18
- {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512,512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 515,512}
- }, // STROBE
- {
- {490, 512, 512}, {490, 512, 512}, {490, 512, 512}, {490, 512, 512}, {490,512, 512}, {490, 512, 512}, {490, 512, 512}, {490, 512, 512}, {490, 512,512}, {490, 512, 512},
- {490, 512, 512}, {490, 512, 512}, {490, 512, 512}, {490, 512, 512}, {490,512, 512}, {490, 512, 512}, {490, 512, 512}, {490, 512, 512}, {490, 512,512}
- }, // TUNGSTEN
- {
- {512, 508, 577}, {512, 508, 577}, {512, 508, 577}, {512, 508, 577}, {512,508, 577}, {512, 508, 577}, {512, 508, 577}, {512, 508, 577}, {512, 508,577}, {512, 508, 577},
- {512, 508, 577}, {512, 508, 577}, {512, 508, 577}, {512, 508, 577}, {512,508, 577}, {512, 508, 577}, {512, 508, 577}, {512, 508, 577}, {512, 508,577}
- }, // WARM F
- {
- {520, 512, 512}, {520, 512, 512}, {520, 512, 512}, {520, 512, 512}, {520,512, 512}, {520, 512, 512}, {520, 512, 512}, {520, 512, 512}, {520, 512,512}, {520, 512, 512},
- {520, 512, 512}, {520, 512, 512}, {520, 512, 512}, {520, 512, 512}, {520,512, 512}, {520, 512, 512}, {520, 512, 512}, {520, 512, 512}, {520, 512,512}
- }, // F
- {
- {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512,512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512,512}, {512, 512, 512},
- {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512,512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512,512}
- }, // CWF
- {
- {518, 512, 512}, {518, 512, 512}, {518, 512, 512}, {518, 512, 512}, {518,512, 512}, {518, 512, 512}, {518, 512, 512}, {518, 512, 512}, {518, 512,512}, {518, 512, 512},{518, 512, 512}, {518, 512, 512}, {518, 512, 512}, {518, 512, 512}, {518,512, 512}, {518, 512, 512}, {518, 512, 512}, {518, 512, 512}, {518, 512,512}}, // DAYLIGHT{{512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512,512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512,512}, {512, 512, 512},{512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512,512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512,512}}, // SHADE{{512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512,512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512,512}, {512, 512, 512},{512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512,512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512, 512}, {512, 512,512}} // DAYLIGHT F}};
- return rAWBParam;
