From 1f704a3b447d8a6dedbde25b143dac534eeb6a49 Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Wed, 14 Jun 2023 18:23:02 -0500 Subject: [PATCH 1/3] Update mode_mean.h: remove mean_p[012] --- src/include/mode_mean.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/include/mode_mean.h b/src/include/mode_mean.h index cdad2e3e3..275a86c1d 100644 --- a/src/include/mode_mean.h +++ b/src/include/mode_mean.h @@ -54,11 +54,6 @@ struct modeMeanSetting { double const shuttersteps = 6.0; // shuttersteps int const historySize = 3; // Number of last images for mean target calculation. - - // ExposureChange (Steps) = p0 + p1 * diff + (p2*diff)^2 - double mean_p0 = DEFAULT_MEAN_P0_RPi; - double mean_p1 = DEFAULT_MEAN_P1_RPi; - double mean_p2 = DEFAULT_MEAN_P2_RPi; }; bool aegInit(config, raspistillSetting &, modeMeanSetting &); From 84c60fc28d765aba346e690834be1c5c8c10c44c Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Wed, 14 Jun 2023 18:26:22 -0500 Subject: [PATCH 2/3] Update mode_mean.cpp: use cg->myModeMeanSetting instead of currentModeMeanSetting --- src/mode_mean.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mode_mean.cpp b/src/mode_mean.cpp index 66434ad32..be6a9a001 100644 --- a/src/mode_mean.cpp +++ b/src/mode_mean.cpp @@ -245,22 +245,22 @@ void aegGetNextExposureSettings(config * cg, // fast forward if (fastforward || meanDiff > (cg->myModeMeanSetting.currentMean_threshold * multiplier1)) { // We are fairly far off from desired mean so make a big change next time. - ExposureChange = std::max(1.0, currentModeMeanSetting.mean_p0 + (currentModeMeanSetting.mean_p1 * mean_diff) + pow(currentModeMeanSetting.mean_p2 * mean_diff, 2.0)); + ExposureChange = std::max(1.0, cg->myModeMeanSetting.mean_p0 + (cg->myModeMeanSetting.mean_p1 * mean_diff) + pow(cg->myModeMeanSetting.mean_p2 * mean_diff, 2.0)); Log(3, " > fast forward ExposureChange now %d (meanDiff=%1.3f > %.2f*threshold=%1.3f)\n", - ExposureChange, meanDiff, multiplier1, cg->myModeMeanSetting.currentMean_threshold*multiplier1); + ExposureChange, meanDiff, multiplier1, cg->myModeMeanSetting.currentMean_threshold * multiplier1); } else if (meanDiff > (cg->myModeMeanSetting.currentMean_threshold * multiplier2)) { // We are somewhat far off from desired mean so make a big change next time. - ExposureChange = std::max(1.0, currentModeMeanSetting.mean_p0 + (currentModeMeanSetting.mean_p1 * mean_diff) + (pow(currentModeMeanSetting.mean_p2 * mean_diff, 2.0) / 2.0)); + ExposureChange = std::max(1.0, cg->myModeMeanSetting.mean_p0 + (cg->myModeMeanSetting.mean_p1 * mean_diff) + (pow(cg->myModeMeanSetting.mean_p2 * mean_diff, 2.0) / 2.0)); Log(3, " > medium forward ExposureChange now %d (meanDiff=%1.3f > %.2f*threshold=%1.3f)\n", - ExposureChange, meanDiff, multiplier2, cg->myModeMeanSetting.currentMean_threshold*multiplier2); + ExposureChange, meanDiff, multiplier2, cg->myModeMeanSetting.currentMean_threshold * multiplier2); } // slow forward else if (meanDiff > cg->myModeMeanSetting.currentMean_threshold) { // We are fairly close to desired mean so make a small change next time. - ExposureChange = std::max(1.0, currentModeMeanSetting.mean_p0 + currentModeMeanSetting.mean_p1 * mean_diff); + ExposureChange = std::max(1.0, cg->myModeMeanSetting.mean_p0 + cg->myModeMeanSetting.mean_p1 * mean_diff); Log(3, " > slow forward ExposureChange now %d (meanDiff=%1.3f, %.2f*threshold=%1.3f)\n", - ExposureChange, meanDiff, multiplier2, cg->myModeMeanSetting.currentMean_threshold*multiplier2); + ExposureChange, meanDiff, multiplier2, cg->myModeMeanSetting.currentMean_threshold * multiplier2); } else { // We are within the threshold From 08ccb67526e036af700ec2f5ed827adf358dda45 Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Wed, 14 Jun 2023 18:28:04 -0500 Subject: [PATCH 3/3] Update capture_RPi.cpp: deleted unneeded lines --- src/capture_RPi.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/capture_RPi.cpp b/src/capture_RPi.cpp index 54caa0bfc..b539d19fa 100644 --- a/src/capture_RPi.cpp +++ b/src/capture_RPi.cpp @@ -539,9 +539,6 @@ myModeMeanSetting.dayMean = CG.myModeMeanSetting.dayMean; myModeMeanSetting.nightMean = CG.myModeMeanSetting.nightMean; myModeMeanSetting.dayMean_threshold = CG.myModeMeanSetting.dayMean_threshold; myModeMeanSetting.nightMean_threshold = CG.myModeMeanSetting.nightMean_threshold; -myModeMeanSetting.mean_p0 = CG.myModeMeanSetting.mean_p0; -myModeMeanSetting.mean_p1 = CG.myModeMeanSetting.mean_p1; -myModeMeanSetting.mean_p2 = CG.myModeMeanSetting.mean_p2; displaySettings(CG);