Commit 3901557b authored by Andrey Filippov's avatar Andrey Filippov

depth map BG - added switching to nearest

parent ad220366
......@@ -255,6 +255,7 @@ public class BiQuadParameters {
public double mll_min_disp_change_lma = 0.003; // stop re-measure when difference is below, LMA, 120 pairs
public int mll_max_refines_lma = 4;
public int mll_max_refines_bg = 5;
public int mll_max_bg_nearest = 1; // number of selecting BG until switching to "nearest" to prevent switching to BG of BG
public boolean mll_generate_scene_outlines = false; // Uses 2 GB - change format, add dimensions (separate color for ref)
......@@ -700,6 +701,8 @@ public class BiQuadParameters {
"Abandon disparity refinement for tiles where disparity does not converge after this number of passes");
gd.addNumericField("Number of BG disparity refine passes (final, 120 pairs with LMA)", this.mll_max_refines_bg, 0,3,"",
"Measure BG disparity for the tiles that have dual correlation maximums");
gd.addNumericField("Number of BG passes until switching to the \"nearest\" selection", this.mll_max_bg_nearest, 0,3,"",
"only for the first BG passes select BG, later switch to \"nearest\" selection to prevent cascade FG->BG,... FG->BG switching");
gd.addCheckbox ("Generate scene outlines", this.mll_generate_scene_outlines,
"Generate and save scene outlines for scene series (need to change format, it is 2GB with uncompressed Tiff)");
......@@ -1003,6 +1006,7 @@ public class BiQuadParameters {
this.mll_min_disp_change_lma= gd.getNextNumber();
this.mll_max_refines_lma= (int) gd.getNextNumber();
this.mll_max_refines_bg= (int) gd.getNextNumber();
this.mll_max_bg_nearest= (int) gd.getNextNumber();
this.mll_generate_scene_outlines= gd.getNextBoolean();
this.mll_add_combo= gd.getNextBoolean();
......@@ -1253,6 +1257,7 @@ public class BiQuadParameters {
properties.setProperty(prefix+"mll_min_disp_change_lma", this.mll_min_disp_change_lma+"");
properties.setProperty(prefix+"mll_max_refines_lma", this.mll_max_refines_lma+"");
properties.setProperty(prefix+"mll_max_refines_bg", this.mll_max_refines_bg+"");
properties.setProperty(prefix+"mll_max_bg_nearest", this.mll_max_bg_nearest+"");
properties.setProperty(prefix+"mll_generate_scene_outlines",this.mll_generate_scene_outlines+"");
properties.setProperty(prefix+"mll_add_combo", this.mll_add_combo+"");
......@@ -1500,6 +1505,7 @@ public class BiQuadParameters {
if (properties.getProperty(prefix+"mll_min_disp_change_lma")!=null) this.mll_min_disp_change_lma=Double.parseDouble(properties.getProperty(prefix+"mll_min_disp_change_lma"));
if (properties.getProperty(prefix+"mll_max_refines_lma")!=null) this.mll_max_refines_lma=Integer.parseInt(properties.getProperty(prefix+"mll_max_refines_lma"));
if (properties.getProperty(prefix+"mll_max_refines_bg")!=null) this.mll_max_refines_bg=Integer.parseInt(properties.getProperty(prefix+"mll_max_refines_bg"));
if (properties.getProperty(prefix+"mll_max_bg_nearest")!=null) this.mll_max_bg_nearest=Integer.parseInt(properties.getProperty(prefix+"mll_max_bg_nearest"));
if (properties.getProperty(prefix+"mll_generate_scene_outlines")!=null) this.mll_generate_scene_outlines=Boolean.parseBoolean(properties.getProperty(prefix+"mll_generate_scene_outlines"));
if (properties.getProperty(prefix+"mll_add_combo")!=null) this.mll_add_combo=Boolean.parseBoolean(properties.getProperty(prefix+"mll_add_combo"));
......@@ -1747,6 +1753,7 @@ public class BiQuadParameters {
bqp.mll_min_disp_change_lma = this.mll_min_disp_change_lma;
bqp.mll_max_refines_lma = this.mll_max_refines_lma;
bqp.mll_max_refines_bg = this.mll_max_refines_bg;
bqp.mll_max_bg_nearest = this.mll_max_bg_nearest;
bqp.mll_generate_scene_outlines = this.mll_generate_scene_outlines;
bqp.mll_add_combo = this.mll_add_combo;
......
......@@ -4437,6 +4437,11 @@ public class OpticalFlow {
} else if (nrefine == (clt_parameters.rig.mll_max_refines_pre + clt_parameters.rig.mll_max_refines_lma + 1)) {
clt_parameters.img_dtt.bimax_dual_only = false; // not just dual only
}
if (nrefine == (clt_parameters.rig.mll_max_refines_pre + clt_parameters.rig.mll_max_refines_lma + clt_parameters.rig.mll_max_bg_nearest)) {
clt_parameters.img_dtt.bimax_combine_mode = Correlation2d.CAMEL_NEAREST;
}
int mcorr_sel = Correlation2d.corrSelEncode(clt_parameters.img_dtt,num_sensors);
double [][] disparity_map =
correlateInterscene(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment