Skip to content

Commit 63c7e50

Browse files
committed
[filterSfM] add MSE of scores logging between iterations
1 parent 26751bb commit 63c7e50

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/software/pipeline/main_filterSfM.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,11 +410,22 @@ bool filterObservations(SfMData& sfmData, int maxNbObservationsPerLandmark, int
410410
}
411411
}
412412
// update scores at end of iteration
413-
#pragma omp parallel for
413+
double error = 0.;
414+
#pragma omp parallel for reduction(+:error)
414415
for(auto id = 0; id < landmarksData.size(); id++)
415416
{
417+
double error_j = 0.;
418+
for(auto j = 0; j < viewScoresData_t[id].size(); j++)
419+
{
420+
const auto& v = viewScoresData_t[id][j] - viewScoresData[id].second[j];
421+
error_j += v * v;
422+
}
423+
error_j /= viewScoresData_t[id].size();
424+
error += error_j;
416425
viewScoresData[id].second = std::move(viewScoresData_t[id]);
417426
}
427+
error /= landmarksData.size();
428+
ALICEVISION_LOG_INFO("MSE at iteration " << i << ": " << error);
418429
}
419430
ALICEVISION_LOG_INFO("Propagating neighbors observation scores: done");
420431

0 commit comments

Comments
 (0)