jfjoch_viewer: Auto foreground uses 99% of pixels

This commit is contained in:
2025-12-12 15:39:01 +01:00
parent 01adfa342b
commit a124b14f9a
2 changed files with 3 additions and 3 deletions

View File

@@ -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];

View File

@@ -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();