Skip to content
This repository
Browse code

stereo: Make max pyrmaid level configurable

Users can set how many max pyramid levels to use for the integer
correlator or bayes em. They don't have direct control because there
are other constraints on how many levels there can be.
  • Loading branch information...
commit 86d79b0004195ba88c6eda884ac63714cc7dd1a8 1 parent 5dbd520
Zack Moratto zmoratto authored
8 src/asp/Core/StereoSettings.cc
@@ -76,7 +76,9 @@ namespace asp {
76 76 ("corr-kernel", po::value(&global.kernel)->default_value(Vector2i(21,21),"21,21"),
77 77 "Kernel sized used for integer correlator.")
78 78 ("corr-search", po::value(&global.search_range)->default_value(BBox2i(0,0,0,0), "auto"),
79   - "Disparity search range. Specify in format: hmin,vmin,hmax,vmax.");
  79 + "Disparity search range. Specify in format: hmin,vmin,hmax,vmax.")
  80 + ("corr-max-levels", po::value(&global.corr_max_levels)->default_value(5),
  81 + "Max pyramid levels to process when using the integer correlator. (0 is just a single level).");
80 82
81 83 po::options_description backwards_compat_options("Aliased backwards compatibility options");
82 84 backwards_compat_options.add_options()
@@ -99,7 +101,9 @@ namespace asp {
99 101 ("disable-h-subpixel", po::bool_switch(&global.disable_h_subpixel),
100 102 "Disable calculation of subpixel in horizontal direction.")
101 103 ("disable-v-subpixel", po::bool_switch(&global.disable_v_subpixel),
102   - "Disable calculation of subpixel in vertical direction.");
  104 + "Disable calculation of subpixel in vertical direction.")
  105 + ("subpixel-max-levels", po::value(&global.subpixel_max_levels)->default_value(2),
  106 + "Max pyramid levels to process when using the BayesEM refinement. (0 is just a single level).");
103 107
104 108 po::options_description experimental_subpixel_options("Experimental Subpixel Options");
105 109 experimental_subpixel_options.add_options()
2  src/asp/Core/StereoSettings.h
@@ -84,6 +84,7 @@ namespace asp {
84 84 vw::uint16 cost_mode; /* 0 = absolute difference
85 85 1 = squared difference
86 86 2 = normalized cross correlation */
  87 + vw::uint16 corr_max_levels; // Max pyramid levels to process. 0 hits only once.
87 88
88 89 // search range, used to define the
89 90 // search range of D_sub.
@@ -95,6 +96,7 @@ namespace asp {
95 96 1 = affine, robust weighting
96 97 2 = affine, bayes weighting
97 98 3 = affine, bayes EM weighting */
  99 + vw::uint16 subpixel_max_levels; // Max pyramid levels to process. 0 hits only once.
98 100
99 101 // EMSubpixelCorrelator Options (mode 3 only)
100 102 int subpixel_affine_iter;
6 src/asp/Tools/stereo_corr.cc
@@ -113,7 +113,8 @@ class SeededCorrelatorView : public ImageViewBase<SeededCorrelatorView<Image1T,
113 113 m_left_mask, m_right_mask,
114 114 m_preproc_func, local_search_range,
115 115 stereo_settings().kernel, m_cost_mode,
116   - stereo_settings().xcorr_threshold );
  116 + stereo_settings().xcorr_threshold,
  117 + stereo_settings().corr_max_levels );
117 118
118 119 return corr_view.prerasterize( bbox );
119 120 } else if ( stereo_settings().seed_option > 1 ) {
@@ -127,7 +128,8 @@ class SeededCorrelatorView : public ImageViewBase<SeededCorrelatorView<Image1T,
127 128 m_left_mask, m_right_mask,
128 129 m_preproc_func, stereo_settings().search_range,
129 130 stereo_settings().kernel, m_cost_mode,
130   - stereo_settings().xcorr_threshold );
  131 + stereo_settings().xcorr_threshold,
  132 + stereo_settings().corr_max_levels );
131 133
132 134 return corr_view.prerasterize( bbox );
133 135 }
3  src/asp/Tools/stereo_rfne.cc
@@ -97,7 +97,8 @@ void stereo_refinement( Options& opt ) {
97 97 bayes_em_subpixel( disparity_disk_image,
98 98 left_disk_image, right_disk_image,
99 99 PreFilter(stereo_settings().slogW),
100   - stereo_settings().subpixel_kernel );
  100 + stereo_settings().subpixel_kernel,
  101 + stereo_settings().subpixel_max_levels );
101 102
102 103 } else if (stereo_settings().subpixel_mode == 3) {
103 104 // Affine and Bayes subpixel refinement always use the

0 comments on commit 86d79b0

Please sign in to comment.
Something went wrong with that request. Please try again.