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); 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 &); 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