better transition

pull/20238/head
Comma Device 4 years ago
parent 1b5c4d9089
commit 0d036de205
  1. 6
      selfdrive/camerad/cameras/camera_common.cc
  2. 2
      selfdrive/camerad/cameras/camera_qcom2.cc

@ -315,9 +315,9 @@ void set_exposure_target(CameraState *c, int x_start, int x_end, int x_skip, int
lum_cur += lum_binning[lum_med]; lum_cur += lum_binning[lum_med];
#ifdef QCOM2 #ifdef QCOM2
int lum_med_tmp = 0; int lum_med_tmp = 0;
int hb = HLC_THRESH; int hb = HLC_THRESH + (10 - c->analog_gain);
if (lum_cur > 0 && lum_med > hb) { if (lum_cur > 0 && lum_med > hb) {
lum_med_tmp = 4 * (lum_med - hb) + 100; lum_med_tmp = (lum_med - hb) + 100;
} }
lum_med_alt = lum_med_alt>lum_med_tmp?lum_med_alt:lum_med_tmp; lum_med_alt = lum_med_alt>lum_med_tmp?lum_med_alt:lum_med_tmp;
#endif #endif
@ -325,7 +325,7 @@ void set_exposure_target(CameraState *c, int x_start, int x_end, int x_skip, int
break; break;
} }
} }
lum_med = lum_med_alt>0 ? lum_med + lum_med/32*lum_cur*(lum_med_alt - lum_med)/lum_total/2:lum_med; lum_med = lum_med_alt>0 ? lum_med + lum_med*lum_cur*(lum_med_alt - lum_med)/lum_total/32:lum_med;
camera_autoexposure(c, lum_med / 256.0); camera_autoexposure(c, lum_med / 256.0);
} }

@ -1003,7 +1003,7 @@ static void set_camera_exposure(CameraState *s, float grey_frac) {
// TODO: get stats from sensor? // TODO: get stats from sensor?
float target_grey = 0.4 - ((float)(s->analog_gain + 4*s->dc_gain_enabled) / 48.0f); float target_grey = 0.4 - ((float)(s->analog_gain + 4*s->dc_gain_enabled) / 48.0f);
float exposure_factor = 1 + 30 * pow((target_grey - grey_frac), 3); float exposure_factor = 1 + 30 * pow((target_grey - grey_frac), 3);
exposure_factor = std::max(exposure_factor, 0.4f); exposure_factor = std::max(exposure_factor, 0.56f);
if (s->camera_num != 1) { if (s->camera_num != 1) {
s->ef_filtered = (1 - EF_LOWPASS_K) * s->ef_filtered + EF_LOWPASS_K * exposure_factor; s->ef_filtered = (1 - EF_LOWPASS_K) * s->ef_filtered + EF_LOWPASS_K * exposure_factor;

Loading…
Cancel
Save