Skip to content

Commit

Permalink
camerad: increase dcam ae min (#34455)
Browse files Browse the repository at this point in the history
* never dip below 0.125

* clamp is double
  • Loading branch information
ZwX1616 authored Jan 23, 2025
1 parent aca1567 commit 0ca726e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions system/camerad/cameras/camera_qcom2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ void CameraState::update_exposure_score(float desired_ev, int exp_t, int exp_g_i

void CameraState::set_camera_exposure(float grey_frac) {
if (!camera.enabled) return;
std::vector<double> target_grey_minimums = {0.1, 0.1, 0.125}; // wide, road, driver

const float dt = 0.05;

const float ts_grey = 10.0;
Expand All @@ -143,8 +145,8 @@ void CameraState::set_camera_exposure(float grey_frac) {
const auto &sensor = camera.sensor;
const float cur_ev_ = cur_ev[camera.buf.cur_frame_data.frame_id % 3] * sensor->ev_scale;

// Scale target grey between 0.1 and 0.4 depending on lighting conditions
float new_target_grey = std::clamp(0.4 - 0.3 * log2(1.0 + sensor->target_grey_factor*cur_ev_) / log2(6000.0), 0.1, 0.4);
// Scale target grey between min and 0.4 depending on lighting conditions
float new_target_grey = std::clamp(0.4 - 0.3 * log2(1.0 + sensor->target_grey_factor*cur_ev_) / log2(6000.0), target_grey_minimums[camera.cc.camera_num], 0.4);
float target_grey = (1.0 - k_grey) * target_grey_fraction + k_grey * new_target_grey;

float desired_ev = std::clamp(cur_ev_ / sensor->ev_scale * target_grey / grey_frac, sensor->min_ev, sensor->max_ev);
Expand Down

0 comments on commit 0ca726e

Please sign in to comment.