From 939d4f8dd27a00ccb1fecff039f621f108f46a26 Mon Sep 17 00:00:00 2001 From: ZwX1616 Date: Mon, 1 Mar 2021 16:35:43 -0800 Subject: [PATCH] Tici art4 (#20210) * adjust gamma * trust that light * trust that chart * unsrgb Co-authored-by: Comma Device old-commit-hash: dd2bba0b4294ca62416f57ad342f0dfb459b790e --- selfdrive/camerad/cameras/camera_qcom2.cc | 4 ++-- selfdrive/camerad/cameras/real_debayer.cl | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/selfdrive/camerad/cameras/camera_qcom2.cc b/selfdrive/camerad/cameras/camera_qcom2.cc index 58068756bb..8685b9c5ec 100644 --- a/selfdrive/camerad/cameras/camera_qcom2.cc +++ b/selfdrive/camerad/cameras/camera_qcom2.cc @@ -1054,8 +1054,8 @@ static void set_camera_exposure(CameraState *s, float grey_frac) { struct i2c_random_wr_payload exp_reg_array[] = { {0x3366, AG}, // analog gain {0x3362, (uint16_t)(s->dc_gain_enabled?0x1:0x0)}, // DC_GAIN - {0x305A, 0x0108}, // red gain - {0x3058, 0x00FB}, // blue gain + {0x305A, 0x00F8}, // red gain + {0x3058, 0x0122}, // blue gain {0x3056, 0x009A}, // g1 gain {0x305C, 0x009A}, // g2 gain {0x3012, (uint16_t)s->exposure_time}, // integ time diff --git a/selfdrive/camerad/cameras/real_debayer.cl b/selfdrive/camerad/cameras/real_debayer.cl index 982d3d06a2..00b914bc22 100644 --- a/selfdrive/camerad/cameras/real_debayer.cl +++ b/selfdrive/camerad/cameras/real_debayer.cl @@ -4,19 +4,19 @@ const half black_level = 42.0; const __constant half3 color_correction[3] = { // post wb CCM - (half3)(1.25985206, -0.378923, -0.21356857), - (half3)(-0.11117607, 1.3962182, -0.46342976), - (half3)(-0.21523926, -0.13449348, 1.47665819), + (half3)(1.82717181, -0.31231438, 0.07307673), + (half3)(-0.5743977, 1.36858544, -0.53183455), + (half3)(-0.25277411, -0.05627105, 1.45875782), }; // tone mapping params const half cpk = 0.75; const half cpb = 0.125; -const half cpxk = 0.01; +const half cpxk = 0.0025; const half cpxb = 0.01; half mf(half x, half cp) { - half rk = 8.6 - 66*cp; + half rk = 9 - 100*cp; if (x > cp) { return (rk * (x-cp) * (1-(cpk*cp+cpb)) * (1+1/(rk*(1-cp))) / (1+rk*(x-cp))) + cpk*cp + cpb; } else if (x < cp) { @@ -28,7 +28,7 @@ half mf(half x, half cp) { half3 color_correct(half3 rgb, int ggain) { half3 ret = (0,0,0); - half cpx = clamp(0.03h, 0.1h, cpxb + cpxk * min(10, ggain)); + half cpx = clamp(0.01h, 0.05h, cpxb + cpxk * min(10, ggain)); ret += (half)rgb.x * color_correction[0]; ret += (half)rgb.y * color_correction[1]; ret += (half)rgb.z * color_correction[2];