Skip to content

Commit c09e531

Browse files
Your Nameclaude
andcommitted
fix(exposure): guard the Median EV log line against the missing-metadata sentinel
Complements the per-image EV guard: when no view has exposure metadata the median exposure is the -1 sentinel, so log2(1/median) printed -nan(ind) in the "Median EV" info line. Guard it the same way with a 0.0 fallback. Log-only. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 2337c1e commit c09e531

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/software/pipeline/main_prepareDenseScene.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ bool prepareDenseScene(const SfMData& sfmData,
130130

131131
// for exposure correction
132132
const double medianCameraExposure = sfmData.getMedianCameraExposureSetting().getExposure();
133-
ALICEVISION_LOG_INFO("Median Camera Exposure: " << medianCameraExposure << ", Median EV: " << std::log2(1.0 / medianCameraExposure));
133+
// guard the log2 as above: a missing-metadata median (-1 sentinel) would otherwise print a NaN Median EV
134+
const double medianEV = (medianCameraExposure > 0.0) ? std::log2(1.0 / medianCameraExposure) : 0.0;
135+
ALICEVISION_LOG_INFO("Median Camera Exposure: " << medianCameraExposure << ", Median EV: " << medianEV);
134136

135137
#pragma omp parallel for num_threads(3)
136138
for (int i = 0; i < viewIds.size(); ++i)

0 commit comments

Comments
 (0)