Browse files

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...
1 parent 5dbd520 commit 86d79b0004195ba88c6eda884ac63714cc7dd1a8 Zack Moratto committed Sep 3, 2012
Showing with 14 additions and 5 deletions.
  1. +6 −2 src/asp/Core/StereoSettings.cc
  2. +2 −0 src/asp/Core/StereoSettings.h
  3. +4 −2 src/asp/Tools/stereo_corr.cc
  4. +2 −1 src/asp/Tools/stereo_rfne.cc
View
8 src/asp/Core/StereoSettings.cc
@@ -76,7 +76,9 @@ namespace asp {
("corr-kernel", po::value(&global.kernel)->default_value(Vector2i(21,21),"21,21"),
"Kernel sized used for integer correlator.")
("corr-search", po::value(&global.search_range)->default_value(BBox2i(0,0,0,0), "auto"),
- "Disparity search range. Specify in format: hmin,vmin,hmax,vmax.");
+ "Disparity search range. Specify in format: hmin,vmin,hmax,vmax.")
+ ("corr-max-levels", po::value(&global.corr_max_levels)->default_value(5),
+ "Max pyramid levels to process when using the integer correlator. (0 is just a single level).");
po::options_description backwards_compat_options("Aliased backwards compatibility options");
backwards_compat_options.add_options()
@@ -99,7 +101,9 @@ namespace asp {
("disable-h-subpixel", po::bool_switch(&global.disable_h_subpixel),
"Disable calculation of subpixel in horizontal direction.")
("disable-v-subpixel", po::bool_switch(&global.disable_v_subpixel),
- "Disable calculation of subpixel in vertical direction.");
+ "Disable calculation of subpixel in vertical direction.")
+ ("subpixel-max-levels", po::value(&global.subpixel_max_levels)->default_value(2),
+ "Max pyramid levels to process when using the BayesEM refinement. (0 is just a single level).");
po::options_description experimental_subpixel_options("Experimental Subpixel Options");
experimental_subpixel_options.add_options()
View
2 src/asp/Core/StereoSettings.h
@@ -84,6 +84,7 @@ namespace asp {
vw::uint16 cost_mode; /* 0 = absolute difference
1 = squared difference
2 = normalized cross correlation */
+ vw::uint16 corr_max_levels; // Max pyramid levels to process. 0 hits only once.
// search range, used to define the
// search range of D_sub.
@@ -95,6 +96,7 @@ namespace asp {
1 = affine, robust weighting
2 = affine, bayes weighting
3 = affine, bayes EM weighting */
+ vw::uint16 subpixel_max_levels; // Max pyramid levels to process. 0 hits only once.
// EMSubpixelCorrelator Options (mode 3 only)
int subpixel_affine_iter;
View
6 src/asp/Tools/stereo_corr.cc
@@ -113,7 +113,8 @@ class SeededCorrelatorView : public ImageViewBase<SeededCorrelatorView<Image1T,
m_left_mask, m_right_mask,
m_preproc_func, local_search_range,
stereo_settings().kernel, m_cost_mode,
- stereo_settings().xcorr_threshold );
+ stereo_settings().xcorr_threshold,
+ stereo_settings().corr_max_levels );
return corr_view.prerasterize( bbox );
} else if ( stereo_settings().seed_option > 1 ) {
@@ -127,7 +128,8 @@ class SeededCorrelatorView : public ImageViewBase<SeededCorrelatorView<Image1T,
m_left_mask, m_right_mask,
m_preproc_func, stereo_settings().search_range,
stereo_settings().kernel, m_cost_mode,
- stereo_settings().xcorr_threshold );
+ stereo_settings().xcorr_threshold,
+ stereo_settings().corr_max_levels );
return corr_view.prerasterize( bbox );
}
View
3 src/asp/Tools/stereo_rfne.cc
@@ -97,7 +97,8 @@ void stereo_refinement( Options& opt ) {
bayes_em_subpixel( disparity_disk_image,
left_disk_image, right_disk_image,
PreFilter(stereo_settings().slogW),
- stereo_settings().subpixel_kernel );
+ stereo_settings().subpixel_kernel,
+ stereo_settings().subpixel_max_levels );
} else if (stereo_settings().subpixel_mode == 3) {
// Affine and Bayes subpixel refinement always use the

0 comments on commit 86d79b0

Please sign in to comment.