From d6bd5e15c4208b2487a67fc53a91e7edbe600502 Mon Sep 17 00:00:00 2001 From: Oleg Alexandrov Date: Fri, 25 Feb 2022 19:08:32 -0800 Subject: [PATCH] Turn off some writing of debug data --- 3rdparty/msmw/libstereo/libstereo.cpp | 49 ++++++++++++++----------- 3rdparty/msmw/libstereo/libstereoCV.cpp | 42 +++++++++++---------- 2 files changed, 50 insertions(+), 41 deletions(-) diff --git a/3rdparty/msmw/libstereo/libstereo.cpp b/3rdparty/msmw/libstereo/libstereo.cpp index ab3b341a..7aa3a48e 100644 --- a/3rdparty/msmw/libstereo/libstereo.cpp +++ b/3rdparty/msmw/libstereo/libstereo.cpp @@ -935,9 +935,11 @@ namespace libIIPStable { prolate[f]( prolate[f].offx[i] , prolate[f].offy[i] ) = w5[f][2*w5_lens[f] + i]; } - char stri[1024]; - sprintf(stri, "p%d.tif", f); - prolate[f].save(stri); + if (STEREOVERBOSE) { + char stri[1024]; + sprintf(stri, "p%d.tif", f); + prolate[f].save(stri); + } } } @@ -1052,8 +1054,10 @@ namespace libIIPStable { } - odist.save("debug_dists_left.tif"); - odistr.save("debug_dists_right.tif"); + if (STEREOVERBOSE) { + odist.save("debug_dists_left.tif"); + odistr.save("debug_dists_right.tif"); + } @@ -1137,31 +1141,34 @@ namespace libIIPStable { stereo_cost_filter(odist, omask, discard_threshold, oBin); stereo_cost_filter(odistr, omask2, discard_threshold, oBin2); - oBin.save("debug_cost_histogram0.tif"); - omask.save("debug_cost_histogram1.tif"); - + if (STEREOVERBOSE) { + oBin.save("debug_cost_histogram0.tif"); + omask.save("debug_cost_histogram1.tif"); + } + for (int i=0; i < omask.wh(); i++) if (oBin[i] <= 0) omask[i] = oBin[i]; for (int i=0; i < omask2.wh(); i++) if (oBin2[i] <= 0) omask2[i] = oBin2[i]; - omask.save("debug_cost_histogram2.tif"); + if (STEREOVERBOSE) { + omask.save("debug_cost_histogram2.tif"); + } } - - // TODO: DEBUG REMOVE THIS - char stri[1024]; - sprintf(stri, "win%d.tif", strPar.currentScale); - oChoice.save(stri); - sprintf(stri, "disp%d.tif", strPar.currentScale); - odisp.save(stri); - sprintf(stri, "cost%d.tif", strPar.currentScale); - odist.save(stri); - sprintf(stri, "mask%d.tif", strPar.currentScale); - omask.save(stri); - + if (STEREOVERBOSE) { + char stri[1024]; + sprintf(stri, "win%d.tif", strPar.currentScale); + oChoice.save(stri); + sprintf(stri, "disp%d.tif", strPar.currentScale); + odisp.save(stri); + sprintf(stri, "cost%d.tif", strPar.currentScale); + odist.save(stri); + sprintf(stri, "mask%d.tif", strPar.currentScale); + omask.save(stri); + } // Update min and max diff --git a/3rdparty/msmw/libstereo/libstereoCV.cpp b/3rdparty/msmw/libstereo/libstereoCV.cpp index 196ddee8..cd2b9a15 100644 --- a/3rdparty/msmw/libstereo/libstereoCV.cpp +++ b/3rdparty/msmw/libstereo/libstereoCV.cpp @@ -1767,11 +1767,12 @@ void compute_subpixel_match_multiple_windows_one_direction( cflimage *images1, c } - - for(int f=0; f