@@ -128,6 +128,9 @@ public class BiQuadParameters {
...
@@ -128,6 +128,9 @@ public class BiQuadParameters {
publicdoublepf_boost_low_density=0.8;// Strength assigned to fake tiles from neighbors (the lower - the higher)
publicdoublepf_boost_low_density=0.8;// Strength assigned to fake tiles from neighbors (the lower - the higher)
// Apply when filling gaps, not when growing
// Apply when filling gaps, not when growing
// 9, // clt_parameters.rig.pf_smpl_radius, // smpl_radius, // int smpl_radius,
publicintpf_fourq_radius=9;// How far to look for a plane for the final pass with 4-corners support
publicintpf_fourq_min=1;// Each of the 4 corners should have at least this number of tiles.
publicintpf_fourq_min=1;// Each of the 4 corners should have at least this number of tiles.
publicintpf_fourq_gap=1;// Symmetrical vertical and horizontal center areas that do not belong to any corner
publicintpf_fourq_gap=1;// Symmetrical vertical and horizontal center areas that do not belong to any corner
...
@@ -165,6 +168,25 @@ public class BiQuadParameters {
...
@@ -165,6 +168,25 @@ public class BiQuadParameters {
publicintltavg_max_iter=20;//
publicintltavg_max_iter=20;//
publicdoubleltavg_min_change=0.01;//
publicdoubleltavg_min_change=0.01;//
publicintltavg_ref_smpl_radius=11;// final int smpl_radius,
publicintltavg_ref_smpl_num=40;// final int smpl_num_narrow, // = 3; // Number after removing worst (should be >1)
publicdoubleltavg_ref_max_adiff=0.15;// final double max_adiff, // Maximal absolute difference between the center tile and friends
publicdoubleltavg_ref_max_rdiff=0.04;// final double max_rdiff, // Maximal relative difference between the center tile and friends
publicdoubleltavg_ref_smpl_arms=0.1;// final double smpl_arms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
publicdoubleltavg_ref_smpl_rrms=0.01;// final double smpl_rrms, // = 0.005; // Maximal RMS/disparity in addition to smplRms
publicintltavg_num_lt_refine=20;// Maximal number of iterations with averaged low textures
publicdoubleltavg_strong_tol=0.3;// When combining normal measurements with low texture/correlation averaging use strong normal if they are close to averaged
publicdoubleltavg_weak_tol=0.1;// When combining normal measurements with low texture/correlation averaging use weak normal if they are close to averaged
// expand lt horizontally if it ends with the same or nearer
publicbooleanltavg_expand_lt=true;
publicintltavg_expand_dist=4;
publicdoubleltavg_expand_tol=0.15;// expand LT right and left if it ends with same or nearer tile
publicdoubleltavg_expand_floor=0.5;// multiply single-tile strength floor for correlation-average
publicintltavg_expand_sample_num=5;// minimal number of samples in expansion mode
// Rig ltfar - recovering far objects that could not be resolved with just a single quad camera
// Rig ltfar - recovering far objects that could not be resolved with just a single quad camera
publicbooleanltfar_en=true;// Enable recovering far objects over infinity area
publicbooleanltfar_en=true;// Enable recovering far objects over infinity area
publicbooleanltfar_auto_floor=true;// Automatically detect strength floor (false - use (lt_trusted_strength*lt_strength_rfloor)
publicbooleanltfar_auto_floor=true;// Automatically detect strength floor (false - use (lt_trusted_strength*lt_strength_rfloor)
...
@@ -410,6 +432,8 @@ public class BiQuadParameters {
...
@@ -410,6 +432,8 @@ public class BiQuadParameters {
gd.addNumericField("Strength assigned to fake tiles from neighbors (the lower - the higher)",this.pf_boost_low_density,4,6,"pix",
gd.addNumericField("Strength assigned to fake tiles from neighbors (the lower - the higher)",this.pf_boost_low_density,4,6,"pix",
"Returned strength assigned to the tiles increases with this value - seems to be a bug");
"Returned strength assigned to the tiles increases with this value - seems to be a bug");
gd.addNumericField("How far to look for a plane for the final pass with 4-corners support",this.pf_fourq_radius,0,3,"",
"Plane fitting half-width during filling gaps with tiles required in four corners (to avoid extending areas, only fill inside)");
gd.addNumericField("Each of the 4 corners should have at least this number of tiles",this.pf_fourq_min,0,3,"",
gd.addNumericField("Each of the 4 corners should have at least this number of tiles",this.pf_fourq_min,0,3,"",
"Apply (>0) only for filling gaps, not during expansion. It requires that every of the 4 corners of the sample square has this number of tiles for a plane");
"Apply (>0) only for filling gaps, not during expansion. It requires that every of the 4 corners of the sample square has this number of tiles for a plane");
...
@@ -476,6 +500,38 @@ public class BiQuadParameters {
...
@@ -476,6 +500,38 @@ public class BiQuadParameters {
"Safety limit for smoothing iterations ");
"Safety limit for smoothing iterations ");
gd.addNumericField("Minimal disparity change to continue smoothing",this.ltavg_min_change,4,6,"pix","");
gd.addNumericField("Minimal disparity change to continue smoothing",this.ltavg_min_change,4,6,"pix","");
gd.addNumericField("How far to extend around a tile when refining averaging correlation measuremnts by planes ",this.ltavg_ref_smpl_radius,0,3,"tiles",
"Process a aquare centered at the current tile withthe side of twice this value plus 1 (2*pf_smpl_radius + 1)");
gd.addNumericField("Number after remaining in the sample square after removing worst fitting tiles",this.ltavg_ref_smpl_num,0,3,"",
"When fitting planes the outliers are removed until the number of remaining tiles equals this value");
gd.addNumericField("Maximal absolute disparity difference between the plane and tiles that fit",this.ltavg_ref_max_adiff,4,6,"pix",
"Maximal absolute disparity difference for fitting. Combined with the next one (relative) ");
gd.addNumericField("Maximal relative (to center disparity) difference between the plane and tiles that fit",this.ltavg_ref_max_rdiff,4,6,"pix/pix",
"This value is multipled by the tile disparity and added to the maximal absolute difference");
gd.addNumericField("Maximal absolute RMS of the remaining tiles in a sample",this.ltavg_ref_smpl_arms,4,6,"pix",
"After removing outliers RMS of the remaining tiles must be less than this value");
gd.addNumericField("Maximal relative (to center disparity) RMS of the remaining tiles in a sample",this.ltavg_ref_smpl_rrms,4,6,"pix/pix",
"Relative RMS times disparity is added to the absolute one");
gd.addNumericField("Maximal number of low texture/averaging correlation passes",this.ltavg_num_lt_refine,0,3,"",
"Will also exit when maximal tile disparity change falls below ltavg_min_change (..continue smoothing above)");
gd.addNumericField("Strong tile difference to averaged to be accepted",this.ltavg_strong_tol,4,6,"pix",
"When combining normal measurements with low texture/correlation averaging use strong normal if they are close to averaged");
gd.addNumericField("Weak trusted tile difference to averaged to be accepted",this.ltavg_weak_tol,4,6,"pix",
"When combining normal measurements with low texture/correlation averaging use weak normal if they are close to averaged");
gd.addCheckbox("Try to expand low-texture areas right and left if it borders with same or nearer",this.ltavg_expand_lt,
"Slightly expand (mostly pavement) if there is FG object near");
gd.addNumericField("How far to extend LT area",this.ltavg_expand_dist,0,3,"",
"Consider empty tiles within this distance from the LT processed area");
gd.addNumericField("The limit tiles should not be farther then extended by more than this value",this.ltavg_expand_tol,4,6,"pix",
"Expand LT area horizonatally until it meets non-empty tile if that tile is closer or at the same (to this tolerance) distance");
gd.addNumericField("Fraction of single-tile correlation strength floor for averaged correlation",this.ltavg_expand_floor,4,6,"",
"Strength floor for averaging corre;ation relative to the single-tile correlation");
gd.addNumericField("Number after remaining in the sample during final expansion of LT area",this.ltavg_expand_sample_num,0,3,"",
"Small absoute number is OK here (may overlap with just a quater of teh sample square. This nuber will be combined with fraction of all defined tiles in a sample square");
gd.addTab("Rig Far","Parameters related to the ML files generation for the dual-quad camera rig");
gd.addTab("Rig Far","Parameters related to the ML files generation for the dual-quad camera rig");
gd.addCheckbox("Enable recovering far objects over infinity area",this.ltfar_en,
gd.addCheckbox("Enable recovering far objects over infinity area",this.ltfar_en,
"Try to use tiles that were treated as infinity by a single quad camera");
"Try to use tiles that were treated as infinity by a single quad camera");
...
@@ -654,6 +710,7 @@ public class BiQuadParameters {
...
@@ -654,6 +710,7 @@ public class BiQuadParameters {
this.pf_use_alt=gd.getNextBoolean();
this.pf_use_alt=gd.getNextBoolean();
this.pf_goal_fraction_rms=gd.getNextNumber();
this.pf_goal_fraction_rms=gd.getNextNumber();
this.pf_boost_low_density=gd.getNextNumber();
this.pf_boost_low_density=gd.getNextNumber();
this.pf_fourq_radius=(int)gd.getNextNumber();
this.pf_fourq_min=(int)gd.getNextNumber();
this.pf_fourq_min=(int)gd.getNextNumber();
this.pf_fourq_gap=(int)gd.getNextNumber();
this.pf_fourq_gap=(int)gd.getNextNumber();
...
@@ -689,6 +746,23 @@ public class BiQuadParameters {
...
@@ -689,6 +746,23 @@ public class BiQuadParameters {
afloor,// final double str_floor, // absolute strength floor
afloor,// final double str_floor, // absolute strength floor
clt_parameters.rig.pf_disp_afloor,// final double pf_disp_afloor, // = 0.1; // When selecting the best fit from the alternative disparities, divide by difference increased by this
clt_parameters.rig.pf_disp_afloor,// final double pf_disp_afloor, // = 0.1; // When selecting the best fit from the alternative disparities, divide by difference increased by this
clt_parameters.rig.pf_disp_rfloor);// final double pf_disp_rfloor) // = 0.02; // Increase pf_disp_afloor for large disparities
clt_parameters.rig.pf_disp_rfloor);// final double pf_disp_rfloor) // = 0.02; // Increase pf_disp_afloor for large disparities
intref_smpl_radius=clt_parameters.rig.ltavg_ref_smpl_radius;// 11; // final int smpl_radius,
intref_smpl_num=50;// final int smpl_num_narrow, // = 3; // Number after removing worst (should be >1)
intref_smpl_num=clt_parameters.rig.ltavg_ref_smpl_num;// 40; // final int smpl_num_narrow, // = 3; // Number after removing worst (should be >1)
doubleref_max_adiff=0.15;// final double max_adiff, // Maximal absolute difference between the center tile and friends
doubleref_max_adiff=clt_parameters.rig.ltavg_ref_max_adiff;//0.15; // final double max_adiff, // Maximal absolute difference between the center tile and friends
doubleref_max_rdiff=0.04;// final double max_rdiff, // Maximal relative difference between the center tile and friends
doubleref_max_rdiff=clt_parameters.rig.ltavg_ref_max_rdiff;//0.04; // final double max_rdiff, // Maximal relative difference between the center tile and friends
doubleref_smpl_arms=0.1;// final double smpl_arms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
doubleref_smpl_arms=clt_parameters.rig.ltavg_ref_smpl_arms;//0.1; // final double smpl_arms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
doubleref_smpl_rrms=0.01;// final double smpl_rrms, // = 0.005; // Maximal RMS/disparity in addition to smplRms
doubleref_smpl_rrms=clt_parameters.rig.ltavg_ref_smpl_rrms;//0.01; // final double smpl_rrms, // = 0.005; // Maximal RMS/disparity in addition to smplRms
intnum_lt_refine=clt_parameters.rig.ltavg_num_lt_refine;// 20; // make a parameter
afloor,// final double str_floor, // absolute strength floor
strength_pow,// double strength_pow,
clt_parameters.rig.pf_disp_afloor,// final double pf_disp_afloor, // = 0.1; // When selecting the best fit from the alternative disparities, divide by difference increased by this
smpl_radius,// int smpl_radius,
clt_parameters.rig.pf_disp_rfloor);// final double pf_disp_rfloor) // = 0.02; // Increase pf_disp_afloor for large disparities
afloor,// final double str_floor, // absolute strength floor
clt_parameters.rig.pf_disp_afloor,// final double pf_disp_afloor, // = 0.1; // When selecting the best fit from the alternative disparities, divide by difference increased by this
clt_parameters.rig.pf_disp_rfloor);// final double pf_disp_rfloor) // = 0.02; // Increase pf_disp_afloor for large disparities
lt_strength,// final double [] src_strength, // if not null will be used for weighted pull
lt_select,// final boolean [] selection,
neib_pull,// final double neib_pull, // pull to weighted average relative to pull to the original disparity value. If 0.0 - will only update former NaN-s
false,// boolean notch_mode, // use notch filter for inter-camera correlation to detect poles
lt_radius,// int lt_rad, // low texture mode - inter-correlation is averaged between the neighbors before argmax-ing, using (2*notch_mode+1)^2 square
// use set from parameters
clt_parameters.rig.no_int_x0,// boolean no_int_x0, // do not offset window to integer maximum - used when averaging low textures to avoid "jumps" for very wide
threadsMax,// final int threadsMax, // maximal number of threads to launch
updateStatus,// updateStatus, // final boolean updateStatus,
lt_radius,// final int lt_radius, // low texture mode - inter-correlation is averaged between the neighbors before argmax-ing, using (2*notch_mode+1)^2 square
biScan,// final BiScan biScan,
min_disparity,// final double min_disparity, // keep original disparity far tiles
trusted_strength,// final double trusted_strength, // trusted correlation strength
trusted_strength,// final double trusted_strength, // trusted correlation strength
strength_rfloor,// final double strength_rfloor, // strength floor - relative to trusted
expand_floor*strength_rfloor,// final double strength_rfloor, // strength floor - relative to trusted
cond_rtrusted,// final double cond_rtrusted, // minimal strength to consider - fraction of trusted
strength_pow,//final double strength_pow, // raise strength-floor to this power
strength_pow,// final double strength_pow, // raise strength-floor to this power
ref_smpl_radius,// final int smpl_radius,
smpl_radius,// final int smpl_radius,
smpl_fract,// final double smpl_fract, // Number of friends among all neighbors
smpl_num,// final int smpl_num, // = 3; // Number after removing worst (should be >1)
ref_smpl_num,// final int ref_smpl_num, // = 3; // Number after removing worst (should be >1)
smpl_fract,// final double smpl_fract, // Number of friends among all neighbors
ref_max_adiff,// final double max_adiff, // Maximal absolute difference betweenthe center tile and friends
max_adiff,// final double max_adiff, // Maximal absolute difference betweenthe center tile and friends
ref_max_rdiff,// final double max_rdiff, // Maximal relative difference between the center tile and friends
max_rdiff,// final double max_rdiff, // Maximal relative difference between the center tile and friends
max_atilt,// final double max_atilt, // = 2.0; // pix per tile
max_atilt,// final double max_atilt, // = 2.0; // pix per tile
max_rtilt,// final double max_rtilt, // = 0.2; // (pix / disparity) per tile
max_rtilt,// final double max_rtilt, // = 0.2; // (pix / disparity) per tile
ref_smpl_arms,// final double smpl_arms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
smpl_arms,// final double smpl_arms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
ref_smpl_rrms,// final double smpl_rrms, // = 0.005; // Maximal RMS/disparity in addition to smplRms
smpl_rrms,// final double smpl_rrms, // = 0.005; // Maximal RMS/disparity in addition to smplRms
damp_tilt,// final double damp_tilt, // = 0.001; // Tilt cost for damping insufficient plane data
damp_tilt,// final double damp_tilt, // = 0.001; // Tilt cost for damping insufficient plane data
rwsigma,// final double rwsigma, // = 0.7; // influence of far neighbors diminish as a Gaussian with this sigma
rwsigma,// final double rwsigma, // = 0.7; // influence of far neighbors diminish as a Gaussian with this sigma
goal_fraction_rms,//final double goal_fraction_rms, // Try to make rms to be this fraction of maximal acceptable by removing outliers
clt_parameters.tileX,// final int dbg_x,
max_iter,// final int max_iterations,
clt_parameters.tileY,// final int dbg_y,
min_change,// final double min_change,
debugLevel);// final int debugLevel);
double[]density=biScan.getDensity(
strong_only,// final boolean strong_only,
need_tiles,// 20, // 10, // final int need_tiles,
max_radius,// 20, // 15, // final int max_radius,
clt_parameters.tileX,// final int dbg_x,
clt_parameters.tileX,// final int dbg_x,
clt_parameters.tileY,// final int dbg_y,
clt_parameters.tileY,// final int dbg_y,
debugLevel+2);// final int debugLevel
threadsMax,// final int threadsMax, // maximal number of threads to launch
lt_strength,// final double [] src_strength, // if not null will be used for weighted pull
lt_select,// final boolean [] selection,
neib_pull,// final double neib_pull, // pull to weighted average relative to pull to the original disparity value. If 0.0 - will only update former NaN-s
false,// boolean notch_mode, // use notch filter for inter-camera correlation to detect poles
lt_radius,// int lt_rad, // low texture mode - inter-correlation is averaged between the neighbors before argmax-ing, using (2*notch_mode+1)^2 square
// use set from parameters
clt_parameters.rig.no_int_x0,// boolean no_int_x0, // do not offset window to integer maximum - used when averaging low textures to avoid "jumps" for very wide
threadsMax,// final int threadsMax, // maximal number of threads to launch
updateStatus,// updateStatus, // final boolean updateStatus,
lt_radius,// final int lt_radius, // low texture mode - inter-correlation is averaged between the neighbors before argmax-ing, using (2*notch_mode+1)^2 square
biScan,// final BiScan biScan,
min_disparity,// final double min_disparity, // keep original disparity far tiles
trusted_strength,// final double trusted_strength, // trusted correlation strength
strength_rfloor,// final double strength_rfloor, // strength floor - relative to trusted
strength_pow,//final double strength_pow, // raise strength-floor to this power
ref_smpl_radius,// final int smpl_radius,
smpl_fract,// final double smpl_fract, // Number of friends among all neighbors
ref_smpl_num,// final int ref_smpl_num, // = 3; // Number after removing worst (should be >1)
ref_max_adiff,// final double max_adiff, // Maximal absolute difference betweenthe center tile and friends
ref_max_rdiff,// final double max_rdiff, // Maximal relative difference between the center tile and friends
max_atilt,// final double max_atilt, // = 2.0; // pix per tile
max_rtilt,// final double max_rtilt, // = 0.2; // (pix / disparity) per tile
ref_smpl_arms,// final double smpl_arms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
ref_smpl_rrms,// final double smpl_rrms, // = 0.005; // Maximal RMS/disparity in addition to smplRms
damp_tilt,// final double damp_tilt, // = 0.001; // Tilt cost for damping insufficient plane data
rwsigma,// final double rwsigma, // = 0.7; // influence of far neighbors diminish as a Gaussian with this sigma
goal_fraction_rms,//final double goal_fraction_rms, // Try to make rms to be this fraction of maximal acceptable by removing outliers
max_iter,// final int max_iterations,
min_change,// final double min_change,
clt_parameters.tileX,// final int dbg_x,
clt_parameters.tileY,// final int dbg_y,
threadsMax,// final int threadsMax, // maximal number of threads to launch
ds3[0], // disparity_bimap[ImageDtt.BI_TARGET_INDEX], // ds1[0], // final double [] src_disparity,
null, // lt_strength, // final double [] src_strength, // if not null will be used for weighted pull
lt_select, // final boolean [] selection,
0.0, // only gaps neib_pull, // final double neib_pull, // pull to weighted average relative to pull to the original disparity value. If 0.0 - will only update former NaN-s
max_iter, // final int max_iterations,
min_change, // final double min_change,
clt_parameters.tileX, // final int dbg_x,
clt_parameters.tileY, // final int dbg_y,
debugLevel+2); // final int debugLevel
// Set disparity_bimap[ImageDtt.BI_TARGET_INDEX]from processed disparity