aboutsummaryrefslogtreecommitdiff
path: root/src/poser_sba.c
diff options
context:
space:
mode:
authorJustin Berger <j.david.berger@gmail.com>2018-04-07 10:15:23 -0600
committerJustin Berger <j.david.berger@gmail.com>2018-04-08 16:19:39 -0600
commitbb0d186e967421c48ba781759063dca165f69df2 (patch)
tree3a6bdfe417bc53b675c335fd01c03449bdf740b3 /src/poser_sba.c
parent5b07e56094f2f765d679ac06bc07d4081338bb29 (diff)
downloadlibsurvive-bb0d186e967421c48ba781759063dca165f69df2.tar.gz
libsurvive-bb0d186e967421c48ba781759063dca165f69df2.tar.bz2
Detailed messages about sba failures
Diffstat (limited to 'src/poser_sba.c')
-rw-r--r--src/poser_sba.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/poser_sba.c b/src/poser_sba.c
index 827e420..1eefc80 100644
--- a/src/poser_sba.c
+++ b/src/poser_sba.c
@@ -294,23 +294,23 @@ static double run_sba_find_3d_structure(SBAData *d, PoserDataLight *pdl, Survive
}
double rtn = -1;
- if (status > 0 && (info[1] / meas_size * 2) < d->max_error) {
+ bool status_failure = status <= 0;
+ bool error_failure = (info[1] / meas_size * 2) >= d->max_error;
+ if (!status_failure && !error_failure) {
d->failures_to_reset_cntr = d->failures_to_reset;
quatnormalize(soLocation.Rot, soLocation.Rot);
*out = soLocation;
rtn = info[1] / meas_size * 2;
- } else if ((info[1] / meas_size * 2) >= d->max_error) {
+ } else if (error_failure) {
d->stats.error_failures++;
}
{
SurviveContext *ctx = so->ctx;
// Docs say info[0] should be divided by meas; I don't buy it really...
- static int cnt = 0;
- if (cnt++ > 1000 || meas_size < d->required_meas || (info[1] / meas_size * 2) > d->max_error) {
- // SV_INFO("%f original reproj error for %u meas", (info[0] / meas_size * 2), (int)meas_size);
- // SV_INFO("%f cur reproj error", (info[1] / meas_size * 2));
- cnt = 0;
+ if (error_failure) {
+ SV_INFO("%f original reproj error for %u meas", (info[0] / meas_size * 2), (int)meas_size);
+ SV_INFO("%f cur reproj error", (info[1] / meas_size * 2));
}
}