diff --git a/reader/JFJochReaderImage.cpp b/reader/JFJochReaderImage.cpp index 20f8a577..90f0bdef 100644 --- a/reader/JFJochReaderImage.cpp +++ b/reader/JFJochReaderImage.cpp @@ -130,7 +130,7 @@ void JFJochReaderImage::ProcessInputImage(const void *data, size_t npixel, int64 } } - auto_foreground = count_histogram.Percentile(99.9).value_or(10); + auto_foreground = count_histogram.Percentile(auto_foreground_range).value_or(10); // Export top pixels (already sorted descending) into the existing vector interface for (int i = 0; i < top_pixels_acc.Size(); i++) { @@ -232,7 +232,7 @@ void JFJochReaderImage::AddImage(const JFJochReaderImage &other) { } } - auto_foreground = count_histogram.Percentile(99.9).value_or(10); + auto_foreground = count_histogram.Percentile(auto_foreground_range).value_or(10); for (int i = 0; i < top_pixels_acc.Size(); i++) { const auto &e = top_pixels_acc[i]; diff --git a/reader/JFJochReaderImage.h b/reader/JFJochReaderImage.h index 84eaaf9d..f9d159a1 100644 --- a/reader/JFJochReaderImage.h +++ b/reader/JFJochReaderImage.h @@ -42,7 +42,7 @@ class JFJochReaderImage { // This histogram operates in square root of count from 0 to 10^20 Histogram count_histogram{100000}; - constexpr static float auto_foreground_range = 0.001f; + constexpr static float auto_foreground_range = 99.0f; int32_t auto_foreground; void CalcAutoContrast();