Commit 421e0704 authored by Andrey Filippov's avatar Andrey Filippov

Extracted filter parameters to a class, working on far objects

parent 8991226b
......@@ -896,22 +896,23 @@ public class CLTPass3d{
double step_threshold,
double min_disparity,
double max_disparity,
double strength_floor,
double strength_pow,
// double strength_floor,
// double strength_pow,
double stBlurSigma,
boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
int smplSide, // = 2; // Sample size (side of a square)
int smplNum, // = 3; // Number after removing worst
double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
boolean smplWnd, // use window functions for the samples
double max_abs_tilt, // 2.0; // pix per tile
double max_rel_tilt, // 0.2; // (pix / disparity) per tile
double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
MeasuredLayersFilterParameters mlfp,
// int smplSide, // = 2; // Sample size (side of a square)
// int smplNum, // = 3; // Number after removing worst
// double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// boolean smplWnd, // use window functions for the samples
// double max_abs_tilt, // 2.0; // pix per tile
// double max_rel_tilt, // 0.2; // (pix / disparity) per tile
// double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
int measSel)
{
......@@ -922,21 +923,22 @@ public class CLTPass3d{
step_threshold,
min_disparity,
max_disparity,
strength_floor,
strength_pow,
// strength_floor,
// strength_pow,
stBlurSigma,
smplMode, // = true; // Use sample mode (false - regular tile mode)
smplSide, // = 2; // Sample size (side of a square)
smplNum, // = 3; // Number after removing worst
smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
smplWnd, // final boolean smplWnd, // use window functions for the samples
max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
mlfp,
// smplSide, // = 2; // Sample size (side of a square)
// smplNum, // = 3; // Number after removing worst
// smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // final boolean smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
// true, // boolean null_if_none,
measSel);
return this.superTiles;
......@@ -946,18 +948,19 @@ public class CLTPass3d{
boolean [][] tile_sel, // null or per-measurement layer, per-tile selection. For each layer null - do not use, {} - use all
boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
int smplSide, // = 2; // Sample size (side of a square)
int smplNum, // = 3; // Number after removing worst
double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
boolean smplWnd, // use window functions for the samples
double max_abs_tilt, // 2.0; // pix per tile
double max_rel_tilt, // 0.2; // (pix / disparity) per tile
double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
MeasuredLayersFilterParameters mlfp,
// int smplSide, // = 2; // Sample size (side of a square)
// int smplNum, // = 3; // Number after removing worst
// double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// boolean smplWnd, // use window functions for the samples
// double max_abs_tilt, // 2.0; // pix per tile
// double max_rel_tilt, // 0.2; // (pix / disparity) per tile
// double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
int measSel)
{
......@@ -969,18 +972,19 @@ public class CLTPass3d{
tile_sel, // null or per-measurement layer, per-tile selection. For each layer null - do not use, {} - use all
smplMode, // = true; // Use sample mode (false - regular tile mode)
smplSide, // = 2; // Sample size (side of a square)
smplNum, // = 3; // Number after removing worst
smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
smplWnd, // use window functions for the samples
max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
mlfp,
// smplSide, // = 2; // Sample size (side of a square)
// smplNum, // = 3; // Number after removing worst
// smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
measSel);
}
......
......@@ -2358,8 +2358,8 @@ public class EyesisCorrectionParameters {
public double max_corr_radius = 3.5; // maximal distance from int max to consider
public int enhortho_width = 2; // reduce weight of center correlation pixels from center (0 - none, 1 - center, 2 +/-1 from center)
public double enhortho_scale = 0.0; // 0.2; // multiply center correlation pixels (inside enhortho_width)
// public int enhortho_width = 2; // reduce weight of center correlation pixels from center (0 - none, 1 - center, 2 +/-1 from center)
// public double enhortho_scale = 0.0; // 0.2; // multiply center correlation pixels (inside enhortho_width)
public boolean max_corr_double = false; // NOT USED double pass when masking center of mass to reduce preference for integer values
public int corr_mode = 2; // which correlation mode to use: 0 - integer max, 1 - center of mass, 2 - polynomial
......@@ -2613,31 +2613,32 @@ public class EyesisCorrectionParameters {
public double stStepNear = 0.5; // Disparity histogram step for near objects
public double stStepThreshold = 1.0; // Disparity threshold to switch from linear to logarithmic steps
public double stMinDisparity = 0.0; // Minimal disparity (center of a bin)
// public double stMaxDisparity = 15.0; // Maximal disparity (center of a bin)
public double stFloor = 0.1; // Subtract from strength, discard negative
public double stPow = 1.0; // raise strength to this power
// moved to MeasuredLayersFilterParameters
// public double stFloor = 0.1; // Subtract from strength, discard negative
// public double stPow = 1.0; // raise strength to this power
public double stSigma = 1.5; // Blur disparity histogram (sigma in bins)
public double stMinBgDisparity = 0.0; // Minimal backgroubnd disparity to extract as a maximum from the supertiles
public double stMinBgFract = 0.1; // Minimal fraction of the disparity histogram to use as background
public double stUseDisp = 0.12; // Use background disparity from supertiles if tile strength is less
public double stStrengthScale = 50.0; // Multiply st strength if used instead of regular strength
public boolean stSmplMode = true; // Use sample mode (false - regular tile mode)
public int stSmplSide = 3; // Sample size (side of a square)
public int stSmplNum = 5; // Number after removing worst
public double stSmplRms = 0.3; // Maximal RMS of the remaining tiles in a sample
public boolean stSmplWnd = false; // Use window function for the samples (TODO: change default to true after testing)
// public int stSmplSide = 3; // Sample size (side of a square)
// public int stSmplNum = 5; // Number after removing worst
// public double stSmplRms = 0.3; // Maximal RMS of the remaining tiles in a sample
// public boolean stSmplWnd = false; // Use window function for the samples (TODO: change default to true after testing)
// Additional parameters to prevent increase of the distance to far (small) objects. It happens because of averaging bg and fg disparities
// These parameters are also used when expanding tiles from the known ones.
public double fs_max_abs_tilt = 2.0; // Maximal absolute tilt in pixels/tile
public double fs_max_rel_tilt = 0.2; // Maximal relative tilt in pixels/tile/disparity
public double fs_damp_tilt = 0.001; // Tilt cost for damping insufficient plane data
public double fs_min_tilt_disp = 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
public double fs_transition = 1.0; // Mode transition range (between tilted and maximal disparity)
public int fs_far_mode = 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
public double fs_far_power = 3.0; // Raise disparity to this power before averaging for far objects
// public double fs_max_abs_tilt = 2.0; // Maximal absolute tilt in pixels/tile
// public double fs_max_rel_tilt = 0.2; // Maximal relative tilt in pixels/tile/disparity
// public double fs_damp_tilt = 0.001; // Tilt cost for damping insufficient plane data
// public double fs_min_tilt_disp = 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// public double fs_transition = 1.0; // Mode transition range (between tilted and maximal disparity)
// public int fs_far_mode = 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// public double fs_far_power = 3.0; // Raise disparity to this power before averaging for far objects
public int stGrowSel = 2; // Grow initial selection before processing supertiles, odd - ortho. <0 - use all tiles
......@@ -2994,7 +2995,8 @@ public class EyesisCorrectionParameters {
public boolean show_planes = false; // show planes
public double [] vertical_xyz = {0.0,1.0,0.0}; // real world up unit vector in camera CS (x - right, y - up, z - to camera};
public ImageDttParameters img_dtt = new ImageDttParameters();
public ImageDttParameters img_dtt = new ImageDttParameters();
public MeasuredLayersFilterParameters mlfp = new MeasuredLayersFilterParameters();
public HashMap<String,Double> z_corr_map = new HashMap<String,Double>();
public static String Z_CORR_PREFIX = "z_corr.";
......@@ -3047,8 +3049,8 @@ public class EyesisCorrectionParameters {
properties.setProperty(prefix+"max_corr_sigma", this.max_corr_sigma +"");
properties.setProperty(prefix+"max_corr_radius", this.max_corr_radius +"");
properties.setProperty(prefix+"enhortho_width", this.enhortho_width +"");
properties.setProperty(prefix+"enhortho_scale", this.enhortho_scale +"");
// properties.setProperty(prefix+"enhortho_width", this.enhortho_width +"");
// properties.setProperty(prefix+"enhortho_scale", this.enhortho_scale +"");
properties.setProperty(prefix+"max_corr_double", this.max_corr_double+"");
......@@ -3276,28 +3278,29 @@ public class EyesisCorrectionParameters {
properties.setProperty(prefix+"stStepNear", this.stStepNear +"");
properties.setProperty(prefix+"stStepThreshold", this.stStepThreshold +"");
properties.setProperty(prefix+"stMinDisparity", this.stMinDisparity +"");
// properties.setProperty(prefix+"stMaxDisparity", this.stMaxDisparity +"");
properties.setProperty(prefix+"stFloor", this.stFloor +"");
properties.setProperty(prefix+"stPow", this.stPow +"");
properties.setProperty(prefix+"stSigma", this.stSigma +"");
properties.setProperty(prefix+"stMinBgDisparity", this.stMinBgDisparity +"");
properties.setProperty(prefix+"stMinBgFract", this.stMinBgFract +"");
properties.setProperty(prefix+"stUseDisp", this.stUseDisp +"");
properties.setProperty(prefix+"stStrengthScale", this.stStrengthScale +"");
properties.setProperty(prefix+"stSmplMode", this.stSmplMode+"");
properties.setProperty(prefix+"stSmplSide", this.stSmplSide+"");
properties.setProperty(prefix+"stSmplNum", this.stSmplNum+"");
properties.setProperty(prefix+"stSmplRms", this.stSmplRms +"");
properties.setProperty(prefix+"stSmplWnd", this.stSmplWnd+"");
properties.setProperty(prefix+"fs_max_abs_tilt", this.fs_max_abs_tilt+"");
properties.setProperty(prefix+"fs_max_rel_tilt", this.fs_max_rel_tilt+"");
properties.setProperty(prefix+"fs_damp_tilt", this.fs_damp_tilt+"");
properties.setProperty(prefix+"fs_min_tilt_disp", this.fs_min_tilt_disp+"");
properties.setProperty(prefix+"fs_transition", this.fs_transition+"");
properties.setProperty(prefix+"fs_far_mode", this.fs_far_mode+"");
properties.setProperty(prefix+"fs_far_power", this.fs_far_power+"");
/// properties.setProperty(prefix+"stFloor", this.stFloor +""); // mlfp.strength_floor
/// properties.setProperty(prefix+"stPow", this.stPow +""); // mlfp.strength_pow
properties.setProperty(prefix+"stSigma", this.stSigma +""); // keep
properties.setProperty(prefix+"stMinBgDisparity", this.stMinBgDisparity +""); // keep
properties.setProperty(prefix+"stMinBgFract", this.stMinBgFract +""); // keep
properties.setProperty(prefix+"stUseDisp", this.stUseDisp +""); // keep
properties.setProperty(prefix+"stStrengthScale", this.stStrengthScale +""); // keep
properties.setProperty(prefix+"stSmplMode", this.stSmplMode+""); // keep
/// properties.setProperty(prefix+"stSmplSide", this.stSmplSide+""); // mlfp.smplSide
/// properties.setProperty(prefix+"stSmplNum", this.stSmplNum+""); // mlfp.smplNum
/// properties.setProperty(prefix+"stSmplRms", this.stSmplRms +""); // mlfp.smplRms
/// properties.setProperty(prefix+"stSmplWnd", this.stSmplWnd+""); // mlfp.smplWnd
/// properties.setProperty(prefix+"fs_max_abs_tilt", this.fs_max_abs_tilt+""); // mlfp.max_abs_tilt
/// properties.setProperty(prefix+"fs_max_rel_tilt", this.fs_max_rel_tilt+""); // mlfp.max_rel_tilt
/// properties.setProperty(prefix+"fs_damp_tilt", this.fs_damp_tilt+""); // mlfp.damp_tilt
/// properties.setProperty(prefix+"fs_min_tilt_disp", this.fs_min_tilt_disp+""); // mlfp.min_tilt_disp
/// properties.setProperty(prefix+"fs_transition", this.fs_transition+""); // mlfp.transition
/// properties.setProperty(prefix+"fs_far_mode", this.fs_far_mode+""); // mlfp.far_mode
/// properties.setProperty(prefix+"fs_far_power", this.fs_far_power+""); // mlfp.far_power
properties.setProperty(prefix+"stGrowSel", this.stGrowSel+"");
properties.setProperty(prefix+"stMeasSel", this.stMeasSel+"");
......@@ -3624,7 +3627,9 @@ public class EyesisCorrectionParameters {
properties.setProperty(prefix+Z_CORR_PREFIX+entry.getKey(), entry.getValue().toString());
}
}
img_dtt.setProperties(prefix+"_img_dtt", properties);
img_dtt.setProperties (prefix+"_img_dtt", properties);
mlfp.setProperties (prefix+"_mlfp", properties);
}
public void getProperties(String prefix,Properties properties){
if (properties.getProperty(prefix+"transform_size")!=null) this.transform_size=Integer.parseInt(properties.getProperty(prefix+"transform_size"));
......@@ -3672,8 +3677,10 @@ public class EyesisCorrectionParameters {
if (properties.getProperty(prefix+"max_corr_sigma")!=null) this.max_corr_sigma=Double.parseDouble(properties.getProperty(prefix+"max_corr_sigma"));
if (properties.getProperty(prefix+"max_corr_radius")!=null)this.max_corr_radius=Double.parseDouble(properties.getProperty(prefix+"max_corr_radius"));
if (properties.getProperty(prefix+"enhortho_width")!=null) this.enhortho_width=Integer.parseInt(properties.getProperty(prefix+"enhortho_width"));
if (properties.getProperty(prefix+"enhortho_scale")!=null) this.enhortho_scale=Double.parseDouble(properties.getProperty(prefix+"enhortho_scale"));
// for compatibility with old settings
if (properties.getProperty(prefix+"enhortho_width")!=null) this.img_dtt.enhortho_width=Integer.parseInt(properties.getProperty(prefix+"enhortho_width"));
if (properties.getProperty(prefix+"enhortho_scale")!=null) this.img_dtt.enhortho_scale=Double.parseDouble(properties.getProperty(prefix+"enhortho_scale"));
// for compatibility with old settings
if (properties.getProperty(prefix+"max_corr_double")!=null)this.max_corr_double=Boolean.parseBoolean(properties.getProperty(prefix+"max_corr_double"));
if (properties.getProperty(prefix+"corr_mode")!=null) this.corr_mode=Integer.parseInt(properties.getProperty(prefix+"corr_mode"));
......@@ -3902,8 +3909,7 @@ public class EyesisCorrectionParameters {
if (properties.getProperty(prefix+"stStepThreshold")!=null) this.stStepThreshold=Double.parseDouble(properties.getProperty(prefix+"stStepThreshold"));
if (properties.getProperty(prefix+"stMinDisparity")!=null) this.stMinDisparity=Double.parseDouble(properties.getProperty(prefix+"stMinDisparity"));
// if (properties.getProperty(prefix+"stMaxDisparity")!=null) this.stMaxDisparity=Double.parseDouble(properties.getProperty(prefix+"stMaxDisparity"));
if (properties.getProperty(prefix+"stFloor")!=null) this.stFloor=Double.parseDouble(properties.getProperty(prefix+"stFloor"));
if (properties.getProperty(prefix+"stPow")!=null) this.stPow=Double.parseDouble(properties.getProperty(prefix+"stPow"));
if (properties.getProperty(prefix+"stSigma")!=null) this.stSigma=Double.parseDouble(properties.getProperty(prefix+"stSigma"));
if (properties.getProperty(prefix+"stMinBgDisparity")!=null) this.stMinBgDisparity=Double.parseDouble(properties.getProperty(prefix+"stMinBgDisparity"));
if (properties.getProperty(prefix+"stMinBgFract")!=null) this.stMinBgFract=Double.parseDouble(properties.getProperty(prefix+"stMinBgFract"));
......@@ -3911,21 +3917,23 @@ public class EyesisCorrectionParameters {
if (properties.getProperty(prefix+"stStrengthScale")!=null) this.stStrengthScale=Double.parseDouble(properties.getProperty(prefix+"stStrengthScale"));
if (properties.getProperty(prefix+"stSmplMode")!=null) this.stSmplMode=Boolean.parseBoolean(properties.getProperty(prefix+"stSmplMode"));
if (properties.getProperty(prefix+"stSmplSide")!=null) this.stSmplSide=Integer.parseInt(properties.getProperty(prefix+"stSmplSide"));
if (properties.getProperty(prefix+"stSmplNum")!=null) this.stSmplNum=Integer.parseInt(properties.getProperty(prefix+"stSmplNum"));
if (properties.getProperty(prefix+"stSmplRms")!=null) this.stSmplRms=Double.parseDouble(properties.getProperty(prefix+"stSmplRms"));
if (properties.getProperty(prefix+"stSmplWnd")!=null) this.stSmplWnd=Boolean.parseBoolean(properties.getProperty(prefix+"stSmplWnd"));
if (properties.getProperty(prefix+"fs_max_abs_tilt")!=null) this.fs_max_abs_tilt=Double.parseDouble(properties.getProperty(prefix+"fs_max_abs_tilt"));
if (properties.getProperty(prefix+"fs_max_rel_tilt")!=null) this.fs_max_rel_tilt=Double.parseDouble(properties.getProperty(prefix+"fs_max_rel_tilt"));
if (properties.getProperty(prefix+"fs_damp_tilt")!=null) this.fs_damp_tilt=Double.parseDouble(properties.getProperty(prefix+"fs_damp_tilt"));
if (properties.getProperty(prefix+"fs_min_tilt_disp")!=null) this.fs_min_tilt_disp=Double.parseDouble(properties.getProperty(prefix+"fs_min_tilt_disp"));
if (properties.getProperty(prefix+"fs_transition")!=null) this.fs_transition=Double.parseDouble(properties.getProperty(prefix+"fs_transition"));
if (properties.getProperty(prefix+"fs_far_mode")!=null) this.fs_far_mode=Integer.parseInt(properties.getProperty(prefix+"fs_far_mode"));
if (properties.getProperty(prefix+"fs_far_power")!=null) this.fs_far_power=Double.parseDouble(properties.getProperty(prefix+"fs_far_power"));
// next kept for compatibility with old configs
if (properties.getProperty(prefix+"stFloor")!=null) this.mlfp.strength_floor=Double.parseDouble(properties.getProperty(prefix+"stFloor"));
if (properties.getProperty(prefix+"stPow")!=null) this.mlfp.strength_pow=Double.parseDouble(properties.getProperty(prefix+"stPow"));
if (properties.getProperty(prefix+"stSmplSide")!=null) this.mlfp.smplSide=Integer.parseInt(properties.getProperty(prefix+"stSmplSide"));
if (properties.getProperty(prefix+"stSmplNum")!=null) this.mlfp.smplNum=Integer.parseInt(properties.getProperty(prefix+"stSmplNum"));
if (properties.getProperty(prefix+"stSmplRms")!=null) this.mlfp.smplRms=Double.parseDouble(properties.getProperty(prefix+"stSmplRms"));
if (properties.getProperty(prefix+"stSmplWnd")!=null) this.mlfp.smplWnd=Boolean.parseBoolean(properties.getProperty(prefix+"stSmplWnd"));
if (properties.getProperty(prefix+"fs_max_abs_tilt")!=null) this.mlfp.max_abs_tilt=Double.parseDouble(properties.getProperty(prefix+"fs_max_abs_tilt"));
if (properties.getProperty(prefix+"fs_max_rel_tilt")!=null) this.mlfp.max_rel_tilt=Double.parseDouble(properties.getProperty(prefix+"fs_max_rel_tilt"));
if (properties.getProperty(prefix+"fs_damp_tilt")!=null) this.mlfp.damp_tilt=Double.parseDouble(properties.getProperty(prefix+"fs_damp_tilt"));
if (properties.getProperty(prefix+"fs_min_tilt_disp")!=null) this.mlfp.min_tilt_disp=Double.parseDouble(properties.getProperty(prefix+"fs_min_tilt_disp"));
if (properties.getProperty(prefix+"fs_transition")!=null) this.mlfp.transition=Double.parseDouble(properties.getProperty(prefix+"fs_transition"));
if (properties.getProperty(prefix+"fs_far_mode")!=null) this.mlfp.far_mode=Integer.parseInt(properties.getProperty(prefix+"fs_far_mode"));
if (properties.getProperty(prefix+"fs_far_power")!=null) this.mlfp.far_power=Double.parseDouble(properties.getProperty(prefix+"fs_far_power"));
// end of next kept for compatibility with old configs
if (properties.getProperty(prefix+"stGrowSel")!=null) this.stGrowSel=Integer.parseInt(properties.getProperty(prefix+"stGrowSel"));
......@@ -4258,7 +4266,8 @@ public class EyesisCorrectionParameters {
z_corr_map.put(s.substring(li), Double.parseDouble(properties.getProperty(s)));
}
}
img_dtt.setProperties(prefix+"_img_dtt", properties);
img_dtt.getProperties (prefix+"_img_dtt", properties);
mlfp.getProperties (prefix+"_mlfp", properties);
}
public boolean showJDialog() {
......@@ -4293,7 +4302,8 @@ public class EyesisCorrectionParameters {
gd.addNumericField("Value (max) in vignetting data to correspond to 1x in the kernel", this.vignetting_max, 3);
gd.addNumericField("Do not try to correct vignetting smaller than this fraction of max", this.vignetting_range, 3);
gd.addNumericField("Kernel step in pixels (has 1 kernel margin on each side)", this.kernel_step, 0);
gd.addNumericField("Nominal (rectilinear) disparity between side of square cameras (pix)", this.disparity, 3);
gd.addNumericField("Nominal (rectilinear) disparity between side of square cameras (pix)", this.disparity, 3,7,"pix",
"Used when rendering 4 images");
gd.addNumericField("Inverse distance to infinity (misalignment correction)", this.z_correction, 6);
gd.addCheckbox ("Perform correlation", this.correlate);
gd.addNumericField("Bitmask of pairs to combine in the composite (top, bottom, left,righth)", this.corr_mask, 0);
......@@ -4313,18 +4323,12 @@ public class EyesisCorrectionParameters {
gd.addNumericField("Select all-pair correlation type to use 0 - CM, 1 - poly", this.corr_select, 0);
gd.addTab ("imageDtt", "Setup extra ImageDtt parameters - eventually all will be set that way");
gd.addCheckbox ("Enable ImageDtt correlation debug layers", this.img_dtt.corr_mode_debug);
gd.addCheckbox ("Replace CM layer with mixed/new poly one", this.img_dtt.mix_corr_poly);
gd.addNumericField("Use poly mode if strength is greater than", this.img_dtt.min_poly_strength, 3,6,"", "AND condition");
gd.addNumericField("Use poly if it does not differ from CM more than by ", this.img_dtt.max_poly_diff, 3,6,"pix", "AND condition");
gd.addNumericField("When calculating poly raise correlation value to this power", this.img_dtt.poly_pwr, 3,6,"", "Trying to reduce sticking to integer values");
gd.addCheckbox ("When calculating poly multiply strength by correlation value (more important)", this.img_dtt.poly_value_to_weight);
// moved
this.img_dtt.dialogQuestions(gd);
gd.addTab ("vert/hor", "Enhance detection of horizontal/vertical features (when enh_ortho is enabled for tile");
gd.addMessage("--- Enhance detection of horizontal/vertical features (when enh_ortho is enabled for tile ---");
gd.addNumericField("Reduce weight of center correlation pixels from center (0 - none, 1 - center, 2 +/-1 from center)", this.enhortho_width, 0);
gd.addNumericField("Multiply center correlation pixels (inside enhortho_width) (1.0 - disables enh_orttho)", this.enhortho_scale, 3);
gd.addCheckbox ("Double pass when masking center of mass to reduce preference for integer values", this.max_corr_double);
......@@ -4335,7 +4339,7 @@ public class EyesisCorrectionParameters {
gd.addTab ("tileTasks", "tiles tasks (current tile_task_op = "+this.tile_task_op+")");
gd.addMessage("--- tiles tasks (current tile_task_op = "+this.tile_task_op+") ---");
gd.addCheckbox ("Enhace ortho lines detection (enh_ortho)", ImageDtt.getOrthoLines(this.tile_task_op));
gd.addCheckbox ("Enhance ortho lines detection (enh_ortho)", ImageDtt.getOrthoLines(this.tile_task_op));
gd.addCheckbox ("Force disparity for image rendering (false - use found from tile correlation)", ImageDtt.getForcedDisparity(this.tile_task_op));
gd.addNumericField("Bitmask of used images (1 - top left, 2 - top right, 4 - bottom left, 8 bottom right)", ImageDtt.getImgMask(this.tile_task_op), 0);
gd.addNumericField("Bitmask of used pairs (1 - top, 2 - bottom, 4 - left, 8 - right)", ImageDtt.getPairMask(this.tile_task_op), 0);
......@@ -4596,39 +4600,15 @@ public class EyesisCorrectionParameters {
gd.addTab ("Supertiles", "Build supertiles (plates)");
// gd.addNumericField("Maximal disparity (center of a bin)", this.stMaxDisparity, 6);
gd.addMessage ("Maximal disparity (center of a bin) - using grow_disp_max="+this.grow_disp_max);
gd.addNumericField("Subtract from strength, discard negative", this.stFloor, 6);
gd.addNumericField("Raise strength to this power ", this.stPow, 6);
// gd.addNumericField("Subtract from strength, discard negative", this.stFloor, 6);
// gd.addNumericField("Raise strength to this power ", this.stPow, 6);
gd.addNumericField("Blur disparity histogram (sigma in bins)", this.stSigma, 6);
gd.addNumericField("Minimal backgroubnd disparity to extract as a maximum from the supertiles", this.stMinBgDisparity, 6);
gd.addNumericField("Minimal fraction of the disparity histogram to use as background", this.stMinBgFract, 6);
gd.addNumericField("Use background disparity from supertiles if tile strength is less", this.stUseDisp, 6);
gd.addNumericField("Multiply st strength if used instead of regular strength ", this.stStrengthScale, 6);
gd.addMessage ("Sample filtering mode");
gd.addCheckbox ("Use sample mode (false - regular tile mode)", this.stSmplMode);
gd.addNumericField("Sample size (side of a square)", this.stSmplSide, 0);
gd.addNumericField("Number after removing worst", this.stSmplNum, 0);
gd.addNumericField("Maximal RMS of the remaining tiles in a sample", this.stSmplRms, 6);
gd.addCheckbox ("Use window function for the samples", this.stSmplWnd);
gd.addMessage ("Additional parameters to prevent increase of the distance to far (small) objects",
"These parameters are also used when expanding tiles from the known ones");
gd.addNumericField("Maximal absolute plane \"tilt\" in pixels/tile", this.fs_max_abs_tilt, 4, 6,
"pix/tile", "difference between disparity of the neighbor tiles in disparity space image");
gd.addNumericField("Maximal relative plane \"tilt\"", this.fs_max_rel_tilt, 4, 6,
"1/tile", "pixel/tile tilte divided by the full disparity of the tle");
gd.addNumericField("Tilt cost for damping insufficient plane data", this.fs_damp_tilt, 6, 8,
"", "Allows to find plane when there are not enough tiles to process");
gd.addNumericField("Disparity switch between filtering modes", this.fs_min_tilt_disp, 4,6,
"pix","Objects that are closer (larger disparity) use tilted plane model, far objects use maximal amon neighbors disparity");
gd.addNumericField("Mode transition range (between tilted and maximal disparity)", this.fs_transition, 4,6,
"pix","Disparity range to gradually switch between maximal and tilted modes");
gd.addNumericField("Far objects filtering mode (0 - off, 1,2 - power of disparity)", this.fs_far_mode, 0,3,
"","So far only 2 far modes: 1 - remove outliers from both sides, 2 - only from far side, 0 - use tilted mode for all tiles");
gd.addNumericField("Raise disparity to this power before averaging for far objects", this.fs_far_power, 4,6,
"", "Parameter to specify preference of the larger disparity when averaging");
// gd.addMessage ("Sample filtering mode");
gd.addMessage ("Other supertile parameters");
gd.addNumericField("Grow initial selection before processing supertiles, odd - ortho. <0 - use all tiles",this.stGrowSel, 0);
......@@ -4647,6 +4627,38 @@ public class EyesisCorrectionParameters {
gd.addNumericField("Disregard weaker tiles when combining scans for vertical correlation", this.combine_min_vert, 6);
// gd.addNumericField("Do not re-measure correlation if target disparity differs from some previous by this",this.unique_tolerance, 6);
gd.addTab ("Tile Filter", "Filter for measured tile data");
gd.addCheckbox ("Use sample mode (false - regular tile mode)", this.stSmplMode);
gd.addNumericField("Sure strength", this.mlfp.strength_sure, 4,6,"",
"Do not filter tile disparities above this strength level (on top of strength floor");
gd.addNumericField("Strength floor", this.mlfp.strength_floor, 4,6,"",
"Subtract from strength, discard negative");
gd.addNumericField("Raise strength to this power ", this.mlfp.strength_pow, 6);
gd.addNumericField("Sample size (side of a square)", this.mlfp.smplSide, 0);
gd.addNumericField("Number after removing worst", this.mlfp.smplNum, 0);
gd.addNumericField("Maximal RMS of the remaining tiles in a sample", this.mlfp.smplRms, 6);
gd.addCheckbox ("Use window function for the samples", this.mlfp.smplWnd);
gd.addMessage ("Additional parameters to prevent increase of the distance to far (small) objects",
"These parameters are also used when expanding tiles from the known ones");
gd.addNumericField("Maximal absolute plane \"tilt\" in pixels/tile", this.mlfp.max_abs_tilt, 4, 6,
"pix/tile", "difference between disparity of the neighbor tiles in disparity space image");
gd.addNumericField("Maximal relative plane \"tilt\"", this.mlfp.max_rel_tilt, 4, 6,
"1/tile", "pixel/tile tilte divided by the full disparity of the tle");
gd.addNumericField("Tilt cost for damping insufficient plane data", this.mlfp.damp_tilt, 6, 8,
"", "Allows to find plane when there are not enough tiles to process");
gd.addNumericField("Disparity switch between filtering modes", this.mlfp.min_tilt_disp, 4,6,
"pix","Objects that are closer (larger disparity) use tilted plane model, far objects use maximal amon neighbors disparity");
gd.addNumericField("Mode transition range (between tilted and maximal disparity)", this.mlfp.transition, 4,6,
"pix","Disparity range to gradually switch between maximal and tilted modes");
gd.addNumericField("Far objects filtering mode (0 - off, 1,2 - power of disparity)", this. mlfp.far_mode, 0,3,
"","So far only 2 far modes: 1 - remove outliers from both sides, 2 - only from far side, 0 - use tilted mode for all tiles");
gd.addNumericField("Raise disparity to this power before averaging for far objects", this.mlfp.far_power, 4,6,
"", "Parameter to specify preference of the larger disparity when averaging");
gd.addTab ("Grow", "Growing disparity range to scan");
gd.addMessage ("========= Growing disparity range to scan ========");
gd.addNumericField("Try these number of tiles around known ones", this.grow_sweep, 0);
......@@ -5034,16 +5046,7 @@ public class EyesisCorrectionParameters {
this.corr_select = (int) gd.getNextNumber();
this.img_dtt.corr_mode_debug= gd.getNextBoolean();
this.img_dtt.mix_corr_poly= gd.getNextBoolean();
this.img_dtt.min_poly_strength= gd.getNextNumber();
this.img_dtt.max_poly_diff= gd.getNextNumber();
this.img_dtt.poly_pwr= gd.getNextNumber();
this.img_dtt.poly_value_to_weight= gd.getNextBoolean();
this.enhortho_width= (int) gd.getNextNumber();
this.enhortho_scale= gd.getNextNumber();
this.img_dtt.dialogAnswers(gd);
this.max_corr_double= gd.getNextBoolean();
this.corr_mode= (int) gd.getNextNumber();
......@@ -5275,28 +5278,12 @@ public class EyesisCorrectionParameters {
this.stStepThreshold= gd.getNextNumber();
this.stMinDisparity= gd.getNextNumber();
// this.stMaxDisparity= gd.getNextNumber();
this.stFloor= gd.getNextNumber();
this.stPow= gd.getNextNumber();
this.stSigma= gd.getNextNumber();
this.stMinBgDisparity= gd.getNextNumber();
this.stMinBgFract= gd.getNextNumber();
this.stUseDisp= gd.getNextNumber();
this.stStrengthScale= gd.getNextNumber();
this.stSmplMode= gd.getNextBoolean();
this.stSmplSide= (int) gd.getNextNumber();
this.stSmplNum= (int) gd.getNextNumber();
this.stSmplRms= gd.getNextNumber();
this.stSmplWnd= gd.getNextBoolean();
this.fs_max_abs_tilt= gd.getNextNumber();
this.fs_max_rel_tilt= gd.getNextNumber();
this.fs_damp_tilt = gd.getNextNumber();
this.fs_min_tilt_disp= gd.getNextNumber();
this.fs_transition= gd.getNextNumber();
this.fs_far_mode= (int) gd.getNextNumber();
this.fs_far_power= gd.getNextNumber();
this.stGrowSel= (int) gd.getNextNumber();
this.stMeasSel= (int) gd.getNextNumber();
this.stSmallDiff= gd.getNextNumber();
......@@ -5312,6 +5299,25 @@ public class EyesisCorrectionParameters {
this.combine_min_strength= gd.getNextNumber();
this.combine_min_hor= gd.getNextNumber();
this.combine_min_vert= gd.getNextNumber();
///--------------------
this.stSmplMode= gd.getNextBoolean();
this.mlfp.strength_sure= gd.getNextNumber();
this.mlfp.strength_floor= gd.getNextNumber();
this.mlfp.strength_pow= gd.getNextNumber();
this.mlfp.smplSide= (int) gd.getNextNumber();
this.mlfp.smplNum= (int) gd.getNextNumber();
this.mlfp.smplRms= gd.getNextNumber();
this.mlfp.smplWnd= gd.getNextBoolean();
this.mlfp.max_abs_tilt= gd.getNextNumber();
this.mlfp.max_rel_tilt= gd.getNextNumber();
this.mlfp.damp_tilt = gd.getNextNumber();
this.mlfp.min_tilt_disp= gd.getNextNumber();
this.mlfp.transition= gd.getNextNumber();
this.mlfp.far_mode= (int) gd.getNextNumber();
this.mlfp.far_power= gd.getNextNumber();
// this.unique_tolerance= gd.getNextNumber();
this.grow_sweep= (int) gd.getNextNumber();
this.grow_disp_max= gd.getNextNumber();
......@@ -5615,7 +5621,6 @@ public class EyesisCorrectionParameters {
this.show_flaps_dirs= gd.getNextBoolean();
this.show_first_clusters= gd.getNextBoolean();
this.show_planes= gd.getNextBoolean();
/**/
return true;
}
......@@ -5775,7 +5780,6 @@ public class EyesisCorrectionParameters {
this.taEnWeakFgnd= gd.getNextBoolean();
this.taEnFlaps= gd.getNextBoolean();
this.taEnMismatch= gd.getNextBoolean();
return true;
}
public boolean modifyZCorr (String title) {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -57,6 +57,7 @@ public class ImageDtt {
static int QUAD = 4; // number of cameras in camera
static int GREEN_CHN = 2; // index of green channel
static int DISPARITY_INDEX_INT = 0; // 0 - disparity from correlation integer pixels, 1 - ortho
// Now DISPARITY_INDEX_CM may be POLY with backup from CM (for bad correlation)
static int DISPARITY_INDEX_CM = 2; // 2 - disparity from correlation "center mass", 3 - ortho (only used for fine correction)
static int DISPARITY_INDEX_HOR = 4; // disparity from correlation of the horizontal pairs with center suppressed
static int DISPARITY_INDEX_HOR_STRENGTH = 5; // strength for hor mode (emphasis on vertical lines)
......@@ -72,10 +73,19 @@ public class ImageDtt {
static int DBG1_INDEX = 18; // index of dbg1 data (poly 1)
static int DBG2_INDEX = 19; // index of dbg2 data (poly 2)
static int DBG3_INDEX = 20; // index of dbg3 data (poly 3)
static int DBG4_INDEX = 21; // index of dbg3 data (poly 3)
static int DBG5_INDEX = 22; // index of dbg3 data (poly 3)
static int DBG6_INDEX = 23; // index of dbg3 data (poly 3)
static int DBG7_INDEX = 24; // index of dbg3 data (poly 3)
static int DBG8_INDEX = 25; // index of dbg3 data (poly 3)
static int DBG9_INDEX = 26; // index of dbg3 data (poly 3)
static int DBG10_INDEX = 27; // index of dbg3 data (poly 3)
static int DBG11_INDEX = 28; // index of dbg3 data (poly 3)
static int DBG12_INDEX = 29; // index of dbg3 data (poly 3)
static String [] DISPARITY_TITLES = {
"int_disp","int_y_disp","cm_disp","cm_y_disp","hor_disp","hor_strength","vert_disp","vert_strength",
"poly_disp", "poly_y_disp", "strength_disp", "vary_disp","diff0","diff1","diff2","diff3","overexp",
"dbg0","dbg1","dbg2","dbg3"};
"dbg0","dbg1","dbg2","dbg3","dbg4","dbg5","dbg6","dbg7","dbg8","dbg9","dbg10","dbg11","dbg12"};
static int TCORR_COMBO_RSLT = 0; // normal combined correlation from all selected pairs (mult/sum)
static int TCORR_COMBO_SUM = 1; // sum of channel correlations from all selected pairs
......@@ -1403,8 +1413,8 @@ public class ImageDtt {
final double max_corr_sigma, // 1.5; // weights of points around global max to find fractional
final double max_corr_radius, // 3.5;
final int enhortho_width, // 2; // reduce weight of center correlation pixels from center (0 - none, 1 - center, 2 +/-1 from center)
final double enhortho_scale, // 0.2; // multiply center correlation pixels (inside enhortho_width)
// final int enhortho_width, // 2; // reduce weight of center correlation pixels from center (0 - none, 1 - center, 2 +/-1 from center)
// final double enhortho_scale, // 0.2; // multiply center correlation pixels (inside enhortho_width)
final boolean max_corr_double, //"Double pass when masking center of mass to reduce preference for integer values
final int corr_mode, // Correlation mode: 0 - integer max, 1 - center of mass, 2 - polynomial
......@@ -1435,6 +1445,7 @@ public class ImageDtt {
final int globalDebugLevel)
{
// final boolean debug_ports_coordinates = (debug_tileX == -1234);
final double poly_corr = imgdtt_params.poly_corr_scale; // maybe add per-tile task bits to select none/near/far
final boolean macro_mode = macro_scale != 1; // correlate tile data instead of the pixel data
final int quad = 4; // number of subcameras
final int numcol = 3; // number of colors
......@@ -1468,18 +1479,43 @@ public class ImageDtt {
final double [] enh_ortho_scale = new double [corr_size];
for (int i = 0; i < corr_size; i++){
if ((i < (transform_size - enhortho_width)) || (i > (transform_size - 2 + enhortho_width))) enh_ortho_scale[i] = 1.0;
else enh_ortho_scale[i] = enhortho_scale;
if ((i < (transform_size - imgdtt_params.enhortho_width)) || (i > (transform_size - 2 + imgdtt_params.enhortho_width))) {
enh_ortho_scale[i] = 1.0;
} else {
enh_ortho_scale[i] = imgdtt_params.enhortho_scale;
}
if (i == (transform_size-1)) enh_ortho_scale[i] = 0.0 ; // hardwired 0 in the center
enh_ortho_scale[i] *= Math.sin(Math.PI*(i+1.0)/(2*transform_size));
}
if (globalDebugLevel > 0){
System.out.println("enhortho_width="+ enhortho_width+" enhortho_scale="+ enhortho_scale);
System.out.println("enhortho_width="+ imgdtt_params.enhortho_width+" enhortho_scale="+ imgdtt_params.enhortho_scale);
for (int i = 0; i < corr_size; i++){
System.out.println(" enh_ortho_scale["+i+"]="+ enh_ortho_scale[i]);
}
}
// Create window to select center correlation strip using
// ortho_height - full width of non-zero elements
// ortho_eff_height - effective height (ration of the weighted column sum to the center value)
int wcenter = transform_size - 1;
final double [] ortho_weights = new double [corr_size]; // [15]
for (int i = 0; i < corr_size; i++){
if ((i >= wcenter - imgdtt_params.ortho_height/2) && (i <= wcenter + imgdtt_params.ortho_height/2)) {
double dx = 1.0*(i-wcenter)/(imgdtt_params.ortho_height/2 + 1);
ortho_weights[i] = 0.5*(1.0+Math.cos(Math.PI*dx))/imgdtt_params.ortho_eff_height;
}
}
if (globalDebugLevel > 0){
System.out.println("ortho_height="+ imgdtt_params.ortho_height+" ortho_eff_height="+ imgdtt_params.ortho_eff_height);
for (int i = 0; i < corr_size; i++){
System.out.println(" ortho_weights["+i+"]="+ ortho_weights[i]);
}
}
if (globalDebugLevel > 0) {
System.out.println("clt_aberrations_quad_corr(): width="+width+" height="+height+" transform_size="+transform_size+
" debug_tileX="+debug_tileX+" debug_tileY="+debug_tileY+" globalDebugLevel="+globalDebugLevel);
......@@ -1832,10 +1868,7 @@ public class ImageDtt {
}
System.out.println();
}
}
} // end of debug_for_fpga
clt_data[i][chn][tileY][tileX] = new double [4][];
fract_shiftsXY[i] = extract_correct_tile( // return a pair of residual offsets
......@@ -1916,7 +1949,6 @@ public class ImageDtt {
if (clt_corr_combo != null){ // not null - calculate correlations
tcorr_tpartial=new double[corr_pairs.length][numcol+1][4][transform_len];
// tcorr_tcombo = new double[quad][transform_len];
tcorr_partial = new double[quad][numcol+1][];
for (int pair = 0; pair < corr_pairs.length; pair++){
......@@ -1991,6 +2023,7 @@ public class ImageDtt {
}
}
// make symmetrical around the disparity direction (horizontal) (here using just average, not mul/sum mixture)
// symmetry can be added to result, not individual (if sum - yes, but with multiplication - not)
if (corr_sym && (clt_mismatch == null)){ // when measuring clt_mismatch symmetry should be off !
for (int chn = firstColor; chn <= numcol; chn++){
for (int i = 1 ; i < transform_size; i++){
......@@ -2199,9 +2232,33 @@ public class ImageDtt {
corr_max_weights_poly, // [(radius+1) * (radius+1)]
max_search_radius_poly, // max_search_radius, for polynomial - always use 1
imgdtt_params.poly_pwr, // double value_pwr, // raise value to this power (trying to compensate sticking to integer values)
imgdtt_params.poly_value_to_weight, //boolean poly_value_to_weight, // multiply weight by value
imgdtt_params.poly_vasw_pwr, // double poly_vasw_pwr, // multiply weight by value
debugMax);
// Possible to bypass ortho calculation for bad tiles?
double [][] corr_max_ortho = new double[2][];
// return argmax, max, half-width
corr_max_ortho[0] = getMaxXSOrtho2( // get fractional center using a quadratic polynomial
tcorr_combo[TCORR_COMBO_HOR], // double [] data, // [data_size * data_size]
ortho_weights, // double [] enhortho_scales, // [data_size]
corr_size, // int data_size,
imgdtt_params.ortho_nsamples, // int num_samples, // number of samples to keep (5?)
imgdtt_params.ortho_vasw_pwr, // double value_as_weight, // use positive value as sample weight
(globalDebugLevel > -2) && (tileX == debug_tileX) && (tileY == debug_tileY)); // debugMax);
corr_max_ortho[1] = getMaxXSOrtho2( // get fractional center using a quadratic polynomial
tcorr_combo[TCORR_COMBO_VERT],// double [] data, // [data_size * data_size]
ortho_weights, // double [] enhortho_scales, // [data_size]
corr_size, // int data_size,
imgdtt_params.ortho_nsamples, // int num_samples, // number of samples to keep (5?)
imgdtt_params.ortho_vasw_pwr, // double value_as_weight, // use positive value as sample weight
(globalDebugLevel > -2) && (tileX == debug_tileX) && (tileY == debug_tileY)); // debugMax);
// (globalDebugLevel > 0) && (tileX == debug_tileX) && (tileY == debug_tileY)); // debugMax);
// disparity_map[DISPARITY_INDEX_HOR][tIndex] = transform_size - 1 - corr_max_XS_hor[0];
// disparity_map[DISPARITY_INDEX_HOR_STRENGTH][tIndex] = corr_max_XS_hor[1];
//double
if (corr_max_XY != null){
corr_max_XY[0] = transform_size - 1 -corr_max_XY[0];
......@@ -2211,15 +2268,27 @@ public class ImageDtt {
corr_max_XY[0] = Double.NaN;
corr_max_XY[1] = Double.NaN;
}
/*
if (corr_max_XY != null){
disparity_map[DISPARITY_INDEX_POLY][tIndex] = transform_size - 1 -corr_max_XY[0];
disparity_map[DISPARITY_INDEX_POLY+1][tIndex] = transform_size - 1 -corr_max_XY[1];
if (corr_max_ortho[0] != null){
corr_max_ortho[0][0] = transform_size - 1 -corr_max_ortho[0][0];
} else {
disparity_map[DISPARITY_INDEX_POLY][tIndex] = Double.NaN;
disparity_map[DISPARITY_INDEX_POLY+1][tIndex] = Double.NaN;
corr_max_ortho[0] = new double[3];
corr_max_ortho[0][0] = Double.NaN;
corr_max_ortho[0][1] = Double.NaN;
corr_max_ortho[0][2] = Double.NaN;
}
*/
if (corr_max_ortho[1] != null){
corr_max_ortho[1][0] = transform_size - 1 -corr_max_ortho[1][0];
} else {
corr_max_ortho[1] = new double[3];
corr_max_ortho[1][0] = Double.NaN;
corr_max_ortho[1][1] = Double.NaN;
corr_max_ortho[1][2] = Double.NaN;
}
disparity_map[DISPARITY_INDEX_POLY][tIndex] = corr_max_XY[0];
disparity_map[DISPARITY_INDEX_POLY+1][tIndex] = corr_max_XY[1];
......@@ -2232,26 +2301,101 @@ public class ImageDtt {
}
if (disparity_map[DBG1_INDEX] != null) {
disparity_map[DBG1_INDEX][tIndex] = disparity_map[DBG0_INDEX][tIndex];
if (!Double.isNaN(corr_max_XY[0]) &&
(Math.abs(disparity_map[DISPARITY_INDEX_CM][tIndex] - corr_max_XY[0]) < imgdtt_params.max_poly_diff) &&
disparity_map[DBG3_INDEX][tIndex] = Double.NaN;
if ((corr_max_XY.length > 4) &&
!Double.isNaN(corr_max_XY[3]) && !Double.isNaN(corr_max_XY[4]) &&
(corr_max_XY[3] < imgdtt_params.max_poly_hwidth) &&
(corr_max_XY[4] < imgdtt_params.max_poly_hwidth) &&
(disparity_map[DISPARITY_STRENGTH_INDEX][tIndex] > imgdtt_params.min_poly_strength)) { // debug threshold
disparity_map[DBG1_INDEX][tIndex] = corr_max_XY[0];
disparity_map[DBG3_INDEX][tIndex] = Double.NaN;
} else { // show only "bad" and strong poly
if (disparity_map[DISPARITY_STRENGTH_INDEX][tIndex] > imgdtt_params.min_poly_strength) {
disparity_map[DBG3_INDEX][tIndex] = disparity_map[DBG2_INDEX][tIndex];
} else {
disparity_map[DBG3_INDEX][tIndex] = Double.NaN;
}
disparity_map[DBG3_INDEX][tIndex] = corr_max_XY[0]; // Double.NaN;
}
}
/*
if (disparity_map[DBG6_INDEX] != null) {
if ((corr_max_XY.length > 4) &&
(disparity_map[DISPARITY_STRENGTH_INDEX][tIndex] > imgdtt_params.min_poly_strength)) {
// disparity_map[DBG4_INDEX][tIndex] = corr_max_XY[2]; // value
disparity_map[DBG5_INDEX][tIndex] = corr_max_XY[3]; // half-width x
disparity_map[DBG6_INDEX][tIndex] = corr_max_XY[4]; // half-width y
disparity_map[DBG4_INDEX][tIndex] = (corr_max_XY[3]-corr_max_XY[4]); // value
} else {
disparity_map[DBG5_INDEX][tIndex] = Double.NaN;
disparity_map[DBG6_INDEX][tIndex] = Double.NaN;
disparity_map[DBG4_INDEX][tIndex] = Double.NaN;
}
// if (disparity_map[DBG3_INDEX] != null) {
// disparity_map[DBG3_INDEX][tIndex] = disparity_map[DBG2_INDEX][tIndex] - disparity_map[DBG0_INDEX][tIndex];
// }
}
if (imgdtt_params.mix_corr_poly) {
*/
if (disparity_map[DBG12_INDEX] != null) {
if ((corr_max_XY.length > 4) && // only show for strong enough poly correlation
(disparity_map[DISPARITY_STRENGTH_INDEX][tIndex] > imgdtt_params.min_poly_strength)) {
disparity_map[DBG4_INDEX ][tIndex] = corr_max_XY[0]; // argmax
disparity_map[DBG7_INDEX ][tIndex] = corr_max_XY[2]; // max
disparity_map[DBG10_INDEX][tIndex] = corr_max_XY[3]; // half-width x
disparity_map[DBG5_INDEX ][tIndex] = corr_max_ortho[0][0]; // argmax
disparity_map[DBG8_INDEX ][tIndex] = corr_max_ortho[0][1]; // max
disparity_map[DBG11_INDEX][tIndex] = corr_max_ortho[0][2]; // half-width x
disparity_map[DBG6_INDEX ][tIndex] = corr_max_ortho[1][0]; // argmax
disparity_map[DBG9_INDEX ][tIndex] = corr_max_ortho[1][1]; // max
disparity_map[DBG12_INDEX][tIndex] = corr_max_ortho[1][2]; // half-width x
} else {
disparity_map[DBG4_INDEX ][tIndex] = Double.NaN;
disparity_map[DBG5_INDEX ][tIndex] = Double.NaN;
disparity_map[DBG6_INDEX ][tIndex] = Double.NaN;
disparity_map[DBG7_INDEX ][tIndex] = Double.NaN;
disparity_map[DBG8_INDEX ][tIndex] = Double.NaN;
disparity_map[DBG9_INDEX ][tIndex] = Double.NaN;
disparity_map[DBG10_INDEX][tIndex] = Double.NaN;
disparity_map[DBG11_INDEX][tIndex] = Double.NaN;
disparity_map[DBG12_INDEX][tIndex] = Double.NaN;
}
}
// use poly only if half-width y < limit (now it is ~2.0 for good corr)
if (imgdtt_params.mix_corr_poly) { // regardless of debug
// apply
disparity_map[DISPARITY_INDEX_CM][tIndex] = disparity_map[DBG1_INDEX][tIndex];
// TODO: add Y for correction !!!!
if ((corr_max_XY.length > 4) && !Double.isNaN(corr_max_XY[3]) && !Double.isNaN(corr_max_XY[4]) &&
(corr_max_XY[3] < imgdtt_params.max_poly_hwidth) &&
(corr_max_XY[4] < imgdtt_params.max_poly_hwidth) &&
(disparity_map[DISPARITY_STRENGTH_INDEX][tIndex] > imgdtt_params.min_poly_strength)) { // debug threshold
// now CM is actually poly!
double pcorr = (corr_max_XY[3]-corr_max_XY[4]);
if (pcorr > 0.0) {
pcorr *= poly_corr; // maybe add per-tile control far/near/none
} else {
pcorr = 0.0;
}
disparity_map[DISPARITY_INDEX_CM+0][tIndex] = corr_max_XY[0]+pcorr; // only for X
disparity_map[DISPARITY_INDEX_CM+1][tIndex] = corr_max_XY[1];
// correct far objects by using hor/vert correlations
if (imgdtt_params.far_object_correct) {
// check strengths:
if ((corr_max_XY[2] >= imgdtt_params.fo_min_strength) &&
(corr_max_ortho[0][1] >= imgdtt_params.fo_min_strength) &&
(corr_max_ortho[1][1] >= imgdtt_params.fo_min_strength) &&
// check halw-widths
(corr_max_XY[3] <= imgdtt_params.fo_max_hwidth) &&
(corr_max_ortho[0][2] <= imgdtt_params.fo_max_hwidth) &&
(corr_max_ortho[1][2] <= imgdtt_params.fo_max_hwidth)) {
double disp_full = corr_max_XY[0];
double disp_near = Math.max(corr_max_ortho[0][0],corr_max_ortho[1][0]);
double disp_far = Math.min(corr_max_ortho[0][0],corr_max_ortho[1][0]);
if ((disp_full < disp_near) && (disp_full > disp_far)) {
double corr = (disp_near - disp_far) * imgdtt_params.fo_overcorrection + (disp_near -disp_full);
double lim_corr = (disp_near -disp_full) * imgdtt_params.fo_lim_overcorr;
corr = Math.min(corr, lim_corr);
if (corr > 0.0) {
disparity_map[DISPARITY_INDEX_CM+0][tIndex] += corr;
}
}
}
}
}
}
//
......@@ -2886,12 +3030,11 @@ public class ImageDtt {
return rslt;
}
public double [] getMaxXSOrtho( // get fractional center as a "center of mass" inside circle/square from the integer max
public double [] getMaxXSOrtho( // // get fractional center using a quadratic polynomial
double [] data, // [data_size * data_size]
double [] enhortho_scales, // [data_size]
int data_size,
double radius, // positive - within that distance, negative - within 2*(-radius)+1 square
// boolean poly_mode,
boolean debug)
{
double [] corr_1d = new double [data_size];
......@@ -2905,8 +3048,7 @@ public class ImageDtt {
for (int i = 1; i < data_size; i++){
if (corr_1d[i] > corr_1d[icenter]) icenter = i;
}
//calculate as "center of mass"
// int iradius = (int) Math.abs(radius);
double [] coeff = null;
double xcenter = icenter;
double [][] pa_data=null;
......@@ -2927,46 +3069,94 @@ public class ImageDtt {
double strength = corr_1d[icenter] / ((data_size+1) / 2);// scale to ~match regular strength
double [] rslt1 = {xcenter, strength};
return rslt1;
/*
double s0 = 0, sx=00;
int x_min = (int) Math.ceil(xcenter - radius);
if (x_min < 0) x_min = 0;
int x_max = (int) Math.floor(xcenter + radius);
if (x_max >= data_size) x_max = data_size - 1;
for (int x = x_min ; x <= x_max; x++){
double d = corr_1d[x];
s0 += d;
sx += d * x;
}
double [] rslt = {sx / s0, strength}; // scale to ~match regular strength
if (debug){
System.out.println("getMaxXYCmEnhOrtho() -> "+rslt[0]+"/"+rslt[1]);
}
// value as weight (boolean), make 0 if <0,
// select # of points (normally 5 if v_as_w, 3 if not
// calculate x, f(x) and half width
// balance strength? Or just assume appropriate window
// maybe optimized to symmetrical data
public double [] getMaxXSOrtho2( // get fractional center using a quadratic polynomial
double [] data, // [data_size * data_size]
double [] vweights, // [data_size]
int data_size,
int num_samples, // number of samples to keep (5?)
double vasw_pwr, // use value to this power as sample weight
boolean debug)
{
double [] corr_1d = new double [data_size];
for (int j = 0; j < data_size; j++){
corr_1d[j] = 0;
for (int i = 0; i < data_size; i++){
System.out.println("corr_1d["+i+"]="+corr_1d[i]);
corr_1d[j] += data[i * data_size + j] * vweights[i];
}
showDoubleFloatArrays sdfa_instance = new showDoubleFloatArrays(); // just for debugging?
double [] masked_data = new double [data_size*data_size];
for (int j = 0; j < data_size; j++){
for (int i = 0; i < data_size; i++){
masked_data[i * data_size + j] = data[i * data_size + j] * enhortho_scales[i];
}
int hsize = num_samples/2;
int i0 = hsize;
for (int i = hsize; i < (data_size - num_samples + hsize) ; i++){
if (corr_1d[i] > corr_1d[i0]) i0 = i;
}
i0 -= hsize;
double [] coeff = null;
double [][] pa_data=new double[num_samples][(vasw_pwr > 0.0)?3:2];
for (int i = 0; i < num_samples; i++) {
pa_data[i][0] = i + i0;
pa_data[i][1] = corr_1d[i + i0];
if (vasw_pwr > 0.0) {
pa_data[i][2] = Math.pow(Math.abs(pa_data[i][1]), vasw_pwr);
}
}
PolynomialApproximation pa = new PolynomialApproximation(debug?5:0); // debugLevel
coeff = pa.polynomialApproximation1d(pa_data, 2);
double xcenter, fx, hwidth;
if ((coeff == null) || (coeff[2] > 0.0)){
xcenter = i0 + hsize;
fx = corr_1d[i0+hsize];
hwidth = data_size;
} else {
xcenter = - coeff[1]/(2* coeff[2]);
fx = coeff[0] + coeff[1]*xcenter + coeff[2]*xcenter*xcenter;
hwidth = Math.sqrt(-fx/coeff[2]);
}
if (debug){
System.out.println("getMaxXSOrtho2(): getMaxXYPoly(): xcenter="+xcenter+" fx="+fx+" hwidth="+hwidth+" i0="+i0);
System.out.println("vweights[i]=");
for (int i=0; i < vweights.length; i++) System.out.print(vweights[i]+" "); System.out.println();
System.out.println("corr_1d[i]=");
for (int i=0; i < corr_1d.length; i++) System.out.print(corr_1d[i]+" "); System.out.println();
System.out.println("pa_data[i]=");
for (int i=0; i < pa_data.length; i++) System.out.println(i+": "+pa_data[i][0]+" "+pa_data[i][1]+" "+pa_data[i][2]+" ");
if (coeff != null) {
System.out.println("coeff: a = "+coeff[2]+", b="+coeff[1]+", c="+coeff[0]);
}
System.out.println("\n----source data ----------");
for (int i = 0; i < data_size; i++){
for (int j = 0; j < data_size; j++){
System.out.print(String.format(" %6.3f", data[i * data_size + j]));
}
System.out.println();
}
double [][] dbg_data = {data,masked_data};
String [] titles = {"correlation", "enhortho_correlation"};
sdfa_instance.showArrays(dbg_data, data_size, data_size, true, "getMaxXYCmEnhOrtho", titles);
if (coeff != null) System.out.println("a = "+coeff[2]+", b = "+coeff[1]+", c = "+coeff[0]);
System.out.println("xcenter="+xcenter);
if (pa_data != null) {
for (int i = 0; i < pa_data.length; i++){
System.out.println("pa_data["+i+"]={"+pa_data[i][0]+", "+pa_data[i][1]+"}");
System.out.println("\n---- masked ----------");
for (int i = 0; i < data_size; i++){
for (int j = 0; j < data_size; j++){
System.out.print(String.format(" %6.3f", data[i * data_size + j] * vweights[i]));
}
System.out.println();
}
for (int j = 0; j < data_size; j++){
System.out.print(String.format(" %6.3f", corr_1d[j]));
}
System.out.println();
}
double [] rslt = {xcenter, fx, hwidth};
return rslt;
*/
}
public double [] getMaxXYPoly( // get interpolated maximum coordinates using 2-nd degree polynomial
PolynomialApproximation pa,
double [] data, // [data_size * data_size]
......@@ -2975,7 +3165,7 @@ public class ImageDtt {
double [] weights, // [(radius+1) * (radius+1)]
int radius,
double value_pwr, // raise value to this power (trying to compensate sticking to integer values)
boolean poly_value_to_weight, // multiply weight by value
double poly_vasw_pwr, // multiply weight by value to this power
boolean debug)
{
// TODO: make sure it is within 1pxx1px square from the integer maximum? If not - return null and use center of mass instead?
......@@ -3008,7 +3198,7 @@ public class ImageDtt {
}
mdata[indx][2] = new double [1];
mdata[indx][2][0] = weights[ay * (radius + 1) + ax];
if (poly_value_to_weight) mdata[indx][2][0] *= mdata[indx][1][0];
if (poly_vasw_pwr > 0 ) mdata[indx][2][0] *= Math.pow(Math.abs(mdata[indx][1][0]), poly_vasw_pwr);
indx++;
}
}
......@@ -3024,10 +3214,19 @@ public class ImageDtt {
System.out.println(i+": "+mdata[i][0][0]+"/"+mdata[i][0][1]+" z="+mdata[i][1][0]+" w="+mdata[i][2][0]);
}
}
double [] rslt = pa.quadraticMax2d(
// double [] rslt = pa.quadraticMax2d(
double [] rslt = pa.quadraticMaxV2dX2Y2XY( // 6 elements - Xc, Yx, f(x,y), A, B, C (from A*x^2 + B*y^2 +C*x*y+...)
mdata,
1.0E-30,//25, // 1.0E-15,
debug? 4:0);
if (rslt == null) return null;
// calculate width_x and width_y
double hwx = Double.NaN, hwy = Double.NaN;
if ((rslt[2] > 0.0) && (rslt[3] <0.0) && (rslt[4] <0.0)) {
hwx = Math.sqrt(-rslt[2]/rslt[3]);
hwy = Math.sqrt(-rslt[2]/rslt[4]);
}
double [] xyvwh = {rslt[0], rslt[1], rslt[2], hwx, hwy};
if (debug){
System.out.println("after: getMaxXYPoly(): icenter[0] = "+icenter[0]+" icenter[1] = "+icenter[1]);
for (int i = 0; i< mdata.length; i++){
......@@ -3035,7 +3234,7 @@ public class ImageDtt {
}
System.out.println("quadraticMax2d(mdata) --> "+((rslt==null)?"null":(rslt[0]+"/"+rslt[1])));
}
return rslt;
return xyvwh; // rslt;
}
......
import java.util.Properties;
/**
**
** ImageDttParameters - parameters defining TP operations (at first extra)
......@@ -24,40 +22,186 @@ import java.util.Properties;
**
*/
import java.util.Properties;
public class ImageDttParameters {
public boolean corr_mode_debug = true;
public boolean mix_corr_poly = false;
public double min_poly_strength = 0.2;
public double max_poly_diff = 0.6;
public double max_poly_hwidth = 2.5; // Maximal polynomial approximation half-width (in both directions)
public double poly_corr_scale = 2.0; // Shift value if correlation maximum is wide in X than in Y to detect near objects (negative - far ones)
public double poly_pwr = 1.0;
public boolean poly_value_to_weight = true;
public double poly_vasw_pwr = 2.0; // raise value to this power and apply as weight (0 - disable)
public double corr_magic_scale_cm = 1.0; //0.85; // reported correlation offset vs. actual one (not yet understood)
public double corr_magic_scale_poly = 1.0; // 0.95; // reported correlation offset vs. actual one (not yet understood)
public int ortho_height = 7; // height of non-zero weights for hor/vert correlation to compensate borders
public double ortho_eff_height = 2.58; // effective correlation stripe height to match strengths
public int ortho_nsamples = 5; // number of samples to fit parabola
public double ortho_vasw_pwr = 2.0; // use data as weights when fitting parabola (high vale samples are more important (when false use 3 samples only)
public int enhortho_width = 2; // reduce weight of center correlation pixels from center (0 - none, 1 - center, 2 +/-1 from center)
public double enhortho_scale = 0.0; // 0.2; // multiply center correlation pixels (inside enhortho_width)
public boolean far_object_correct = true; // correct far objects by comparing orthogonal correlations
public double fo_min_strength = 0.3; // minimal strength for all correlations (full, hor, vert) to try to correct
public double fo_max_hwidth = 2.4; // maximal half-width for all directions to try to correct far objects
public double fo_overcorrection = 0.0; // add scaled hor/vert difference to the largest of hor/vert disparity
public double fo_lim_overcorr = 2.0; // limit full correction with respect to largest - fullcorr difference
public void dialogQuestions(GenericJTabbedDialog gd) {
gd.addCheckbox ("Enable ImageDtt correlation debug layers", this.corr_mode_debug);
gd.addCheckbox ("Replace CM layer with mixed/new poly one", this.mix_corr_poly);
gd.addNumericField("Use poly mode if strength is greater than", this.min_poly_strength, 3,6,"", "AND condition");
gd.addNumericField("Maximal polynomial approximation half-width", this.max_poly_hwidth, 3,6,"pix", "Maximal polynomial approximation half-width (in both directions), Most now are ~2.0");
gd.addNumericField("Polynomial argmax correction (positive - near, negative - far)", this.poly_corr_scale, 3,6,"×", "Shift value if correlation maximum is wide in X than in Y to detect near objects (negative - far ones)");
gd.addNumericField("When calculating poly raise correlation value to this power", this.poly_pwr, 3,6,"", "Trying to reduce sticking to integer values");
gd.addNumericField("When calculating poly multiply weight by correlation value", this.poly_vasw_pwr,3,6,"",
"Raise value to this power and apply as weight");
gd.addNumericField("Magic scale for CM correlation", this.corr_magic_scale_cm, 3,6,"",
"Reported center of mass correlation value is this part of actual");
gd.addNumericField("Magic scale for Poly correlation", this.corr_magic_scale_poly, 3,6,"",
"Reported polynomial correlation value is this part of actual");
gd.addNumericField("Height of non-zero weights for hor/vert correlation", this.ortho_height, 3);
gd.addNumericField("Effective correlation stripe height to match strengths", this.ortho_eff_height, 3,6,"", "For matching 2-d and 1-d correlation maximums");
gd.addNumericField("Number of samples to fit parabola in ortho mode", this.ortho_nsamples, 3);
gd.addNumericField("Use data as weights when fitting parabola for ortho mode", this.ortho_vasw_pwr,3,6,"",
"Raise value to this power and apply as weight. Reduce width to 3 samples if false, 5 OK when true");
gd.addNumericField("Reduce weight of center correlation pixels from center (0 - none, 1 - center, 2 +/-1 from center)", this.enhortho_width, 0);
gd.addNumericField("Multiply center correlation pixels (inside enhortho_width) (1.0 - disables enh_orttho)", this.enhortho_scale, 3);
gd.addMessage("Far objects correction");
gd.addCheckbox ("Try to correct far objects (make them closer) by hor/vert comparison", this.far_object_correct);
gd.addNumericField("Minimal strength for all correlations (full, hor, vert) to try to correct", this.fo_min_strength, 3,6,"",
"Do not correct if any of the full, hor or vert strength is lower than this");
gd.addNumericField("Maximal correlation half-width", this.fo_max_hwidth, 3,6,"",
"Do not correct if any of the full, hor or vert half-width is above this");
gd.addNumericField("Overcorrection scale", this.fo_overcorrection, 3,6,"",
"Add scaled hor/vert difference to the largest of hor/vert disparity. Use 0 to just select largest of disparities");
gd.addNumericField("Limit overcorrection", this.fo_lim_overcorr, 3,6,"",
"Limit full correction with respect to largest - fullcorr difference. 1.0 does not allow overcorrection, < 1.0 - the result will be closer to full correction");
}
public void dialogAnswers(GenericJTabbedDialog gd) {
this.corr_mode_debug= gd.getNextBoolean();
this.mix_corr_poly= gd.getNextBoolean();
this.min_poly_strength= gd.getNextNumber();
this.max_poly_hwidth= gd.getNextNumber();
this.poly_corr_scale= gd.getNextNumber();
this.poly_pwr= gd.getNextNumber();
this.poly_vasw_pwr= gd.getNextNumber();
this.corr_magic_scale_cm= gd.getNextNumber();
this.corr_magic_scale_poly= gd.getNextNumber();
this.ortho_height = (int) gd.getNextNumber();
this.ortho_eff_height= gd.getNextNumber();
this.ortho_nsamples = (int) gd.getNextNumber();
this.ortho_vasw_pwr = gd.getNextNumber();
this.enhortho_width= (int) gd.getNextNumber();
this.enhortho_scale= gd.getNextNumber();
this.far_object_correct = gd.getNextBoolean();
this.fo_min_strength = gd.getNextNumber();
this.fo_max_hwidth = gd.getNextNumber();
this.fo_overcorrection = gd.getNextNumber();
this.fo_lim_overcorr = gd.getNextNumber();
}
public void setProperties(String prefix,Properties properties){
properties.setProperty(prefix+"corr_mode_debug", this.corr_mode_debug+"");
properties.setProperty(prefix+"mix_corr_poly", this.mix_corr_poly+"");
properties.setProperty(prefix+"min_poly_strength", this.min_poly_strength+"");
properties.setProperty(prefix+"max_poly_diff", this.max_poly_diff+"");
properties.setProperty(prefix+"poly_pwr", this.poly_pwr+"");
properties.setProperty(prefix+"mix_corr_poly", this.mix_corr_poly+"");
properties.setProperty(prefix+"corr_mode_debug", this.corr_mode_debug+"");
properties.setProperty(prefix+"mix_corr_poly", this.mix_corr_poly+"");
properties.setProperty(prefix+"min_poly_strength", this.min_poly_strength+"");
properties.setProperty(prefix+"max_poly_hwidth", this.max_poly_hwidth+"");
properties.setProperty(prefix+"poly_corr_scale", this.poly_corr_scale+"");
properties.setProperty(prefix+"poly_pwr", this.poly_pwr+"");
properties.setProperty(prefix+"poly_value_to_weight", this.poly_vasw_pwr+"");
properties.setProperty(prefix+"corr_magic_scale_cm", this.corr_magic_scale_cm+"");
properties.setProperty(prefix+"corr_magic_scale_poly",this.corr_magic_scale_poly+"");
properties.setProperty(prefix+"ortho_height", this.ortho_height+"");
properties.setProperty(prefix+"ortho_eff_height", this.ortho_eff_height+"");
properties.setProperty(prefix+"ortho_nsamples", this.ortho_nsamples+"");
properties.setProperty(prefix+"ortho_vasw", this.ortho_vasw_pwr+"");
properties.setProperty(prefix+"enhortho_width", this.enhortho_width +"");
properties.setProperty(prefix+"enhortho_scale", this.enhortho_scale +"");
properties.setProperty(prefix+"far_object_correct", this.far_object_correct +"");
properties.setProperty(prefix+"fo_min_strength", this.fo_min_strength +"");
properties.setProperty(prefix+"fo_max_hwidth", this.fo_max_hwidth +"");
properties.setProperty(prefix+"fo_overcorrection", this.fo_overcorrection +"");
properties.setProperty(prefix+"fo_lim_overcorr", this.fo_lim_overcorr +"");
}
public void getProperties(String prefix,Properties properties){
if (properties.getProperty(prefix+"corr_mode_debug")!=null) this.corr_mode_debug=Boolean.parseBoolean(properties.getProperty(prefix+"corr_mode_debug"));
if (properties.getProperty(prefix+"mix_corr_poly")!=null) this.mix_corr_poly=Boolean.parseBoolean(properties.getProperty(prefix+"mix_corr_poly"));
if (properties.getProperty(prefix+"min_poly_strength")!=null) this.min_poly_strength=Double.parseDouble(properties.getProperty(prefix+"min_poly_strength"));
if (properties.getProperty(prefix+"max_poly_diff")!=null) this.max_poly_diff=Double.parseDouble(properties.getProperty(prefix+"max_poly_diff"));
if (properties.getProperty(prefix+"poly_pwr")!=null) this.poly_pwr=Double.parseDouble(properties.getProperty(prefix+"poly_pwr"));
if (properties.getProperty(prefix+"poly_value_to_weight")!=null) this.poly_value_to_weight=Boolean.parseBoolean(properties.getProperty(prefix+"poly_value_to_weight"));
if (properties.getProperty(prefix+"corr_mode_debug")!=null) this.corr_mode_debug=Boolean.parseBoolean(properties.getProperty(prefix+"corr_mode_debug"));
if (properties.getProperty(prefix+"mix_corr_poly")!=null) this.mix_corr_poly=Boolean.parseBoolean(properties.getProperty(prefix+"mix_corr_poly"));
if (properties.getProperty(prefix+"min_poly_strength")!=null) this.min_poly_strength=Double.parseDouble(properties.getProperty(prefix+"min_poly_strength"));
if (properties.getProperty(prefix+"max_poly_hwidth")!=null) this.max_poly_hwidth=Double.parseDouble(properties.getProperty(prefix+"max_poly_hwidth"));
if (properties.getProperty(prefix+"poly_corr_scale")!=null) this.poly_corr_scale=Double.parseDouble(properties.getProperty(prefix+"poly_corr_scale"));
if (properties.getProperty(prefix+"poly_pwr")!=null) this.poly_pwr=Double.parseDouble(properties.getProperty(prefix+"poly_pwr"));
if (properties.getProperty(prefix+"poly_vasw_pwr")!=null) this.poly_vasw_pwr=Double.parseDouble(properties.getProperty(prefix+"poly_vasw_pwr"));
if (properties.getProperty(prefix+"corr_magic_scale_cm")!=null) this.corr_magic_scale_cm=Double.parseDouble(properties.getProperty(prefix+"corr_magic_scale_cm"));
if (properties.getProperty(prefix+"corr_magic_scale_poly")!=null) this.corr_magic_scale_poly=Double.parseDouble(properties.getProperty(prefix+"corr_magic_scale_poly"));
if (properties.getProperty(prefix+"ortho_height")!=null) this.ortho_height=Integer.parseInt(properties.getProperty(prefix+"ortho_height"));
if (properties.getProperty(prefix+"ortho_eff_height")!=null) this.ortho_eff_height=Double.parseDouble(properties.getProperty(prefix+"ortho_eff_height"));
if (properties.getProperty(prefix+"ortho_nsamples")!=null) this.ortho_nsamples=Integer.parseInt(properties.getProperty(prefix+"ortho_nsamples"));
if (properties.getProperty(prefix+"ortho_vasw_pwr")!=null) this.ortho_vasw_pwr=Double.parseDouble(properties.getProperty(prefix+"ortho_vasw_pwr"));
if (properties.getProperty(prefix+"enhortho_width")!=null) this.enhortho_width=Integer.parseInt(properties.getProperty(prefix+"enhortho_width"));
if (properties.getProperty(prefix+"enhortho_scale")!=null) this.enhortho_scale=Double.parseDouble(properties.getProperty(prefix+"enhortho_scale"));
if (properties.getProperty(prefix+"far_object_correct")!=null) this.far_object_correct=Boolean.parseBoolean(properties.getProperty(prefix+"far_object_correct"));
if (properties.getProperty(prefix+"fo_min_strength")!=null) this.fo_min_strength=Double.parseDouble(properties.getProperty(prefix+"fo_min_strength"));
if (properties.getProperty(prefix+"fo_max_hwidth")!=null) this.fo_max_hwidth=Double.parseDouble(properties.getProperty(prefix+"fo_max_hwidth"));
if (properties.getProperty(prefix+"fo_overcorrection")!=null) this.fo_overcorrection=Double.parseDouble(properties.getProperty(prefix+"fo_overcorrection"));
if (properties.getProperty(prefix+"fo_lim_overcorr")!=null) this.fo_lim_overcorr=Double.parseDouble(properties.getProperty(prefix+"fo_lim_overcorr"));
}
@Override
public ImageDttParameters clone() {
ImageDttParameters idp = new ImageDttParameters();
public ImageDttParameters clone() throws CloneNotSupportedException {
ImageDttParameters idp = new ImageDttParameters();
idp.corr_mode_debug = corr_mode_debug;
idp.mix_corr_poly = mix_corr_poly;
idp.min_poly_strength = min_poly_strength;
idp.max_poly_diff = max_poly_diff;
idp.max_poly_hwidth = max_poly_hwidth;
idp.poly_corr_scale = poly_corr_scale;
idp.poly_pwr = poly_pwr;
idp.poly_value_to_weight = poly_value_to_weight;
idp.poly_vasw_pwr = poly_vasw_pwr;
idp.corr_magic_scale_cm = corr_magic_scale_cm;
idp.corr_magic_scale_poly = corr_magic_scale_poly;
idp.ortho_height = ortho_height;
idp.ortho_eff_height = ortho_eff_height;
idp.ortho_nsamples = ortho_nsamples;
idp.ortho_vasw_pwr = ortho_vasw_pwr;
idp.enhortho_width = enhortho_width;
idp.enhortho_scale = enhortho_scale;
idp.far_object_correct = far_object_correct;
idp.fo_min_strength = fo_min_strength;
idp.fo_max_hwidth = fo_max_hwidth;
idp.fo_overcorrection = fo_overcorrection;
idp.fo_lim_overcorr = fo_lim_overcorr;
return idp;
}
// TODO move 2 dialog methods here
}
......@@ -246,8 +246,8 @@ public class MacroCorrelation {
min_corr_selected, // 0.0001; // minimal correlation value to consider valid
clt_parameters.max_corr_sigma,// 1.5; // weights of points around global max to find fractional
clt_parameters.max_corr_radius,
clt_parameters.enhortho_width, // 2; // reduce weight of center correlation pixels from center (0 - none, 1 - center, 2 +/-1 from center)
clt_parameters.enhortho_scale, // 0.2; // multiply center correlation pixels (inside enhortho_width)
// clt_parameters.enhortho_width, // 2; // reduce weight of center correlation pixels from center (0 - none, 1 - center, 2 +/-1 from center)
// clt_parameters.enhortho_scale, // 0.2; // multiply center correlation pixels (inside enhortho_width)
clt_parameters.max_corr_double, // Double pass when masking center of mass to reduce preference for integer values
clt_parameters.corr_mode, // Correlation mode: 0 - integer max, 1 - center of mass, 2 - polynomial
clt_parameters.min_shot, // 10.0; // Do not adjust for shot noise if lower than
......
......@@ -571,6 +571,23 @@ public class MeasuredLayers {
return sw;
}
public double[][] getDisparityStrengthML (
int num_layer,
int stX,
int stY,
boolean [] sel_in,
MeasuredLayersFilterParameters mlfp,
boolean null_if_none){
return getDisparityStrengthML(
num_layer,
stX,
stY,
sel_in,
mlfp.strength_floor,
mlfp.strength_pow,
null_if_none);
}
/**
* Get disparity and correlation strength for the specific measurement layer and
* supertile X,Y coordinates in the image. Combined with input selection
......@@ -629,6 +646,17 @@ public class MeasuredLayers {
return ds;
}
public double[][] getDisparityStrengthML (
int num_layer,
MeasuredLayersFilterParameters mlfp){
return getDisparityStrengthML(
num_layer,
mlfp.strength_floor,
mlfp.strength_pow);
}
/**
* Get disparity and correlation strength for the specific measurement layer.
* Combined with input selection
......@@ -688,12 +716,13 @@ public class MeasuredLayers {
int stX,
int stY,
boolean [] sel_in,
double strength_floor,
double strength_pow,
int smplSide, // = 2; // Sample size (side of a square)
int smplNum, // = 3; // Number after removing worst (should be >1)
double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
boolean smplWnd, //
MeasuredLayersFilterParameters mlfp,
// double strength_floor,
// double strength_pow,
// int smplSide, // = 2; // Sample size (side of a square)
// int smplNum, // = 3; // Number after removing worst (should be >1)
// double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// boolean smplWnd, //
boolean null_if_none,
int debugLevel)
{
......@@ -706,15 +735,15 @@ public class MeasuredLayers {
final int dbg_tile = ((stX == 22) && (stY == 19)) ? (5 + 7*16) : -1;// 50397;
int num_selected = 0;
int smpl_center = smplSide /2;
int st2e = st2 + smplSide;
int smplLen = smplSide*smplSide;
final double [] smpl_weights = getSampleWindow(smplSide, !smplWnd);
int smpl_center = mlfp.smplSide /2;
int st2e = st2 + mlfp.smplSide;
int smplLen = mlfp.smplSide*mlfp.smplSide;
final double [] smpl_weights = getSampleWindow(mlfp.smplSide, !mlfp.smplWnd);
double [] disp = new double [st2e * st2e];
double [] weight = new double [st2e * st2e];
int st_halfe = st_half + smpl_center;
double smplVar = smplRms * smplRms; // maximal variance (weighted average of the squared difference from the mean)
double smplVar = mlfp.smplRms * mlfp.smplRms; // maximal variance (weighted average of the squared difference from the mean)
if (layers[num_layer] != null) {
......@@ -729,9 +758,9 @@ public class MeasuredLayers {
if (layers[num_layer][indx] != null){ // apply sel_in later
disp[indx_ste] = layers[num_layer][indx].getDisparity();
double w = layers[num_layer][indx].getStrength() - strength_floor;
double w = layers[num_layer][indx].getStrength() - mlfp.strength_floor;
if (w > 0) {
if (strength_pow != 1.0) w = Math.pow(w, strength_pow);
if (mlfp.strength_pow != 1.0) w = Math.pow(w, mlfp.strength_pow);
// w *= lapWeight[dy][dx];
disp[indx_ste] = layers[num_layer][indx].getDisparity();
weight[indx_ste] = w;
......@@ -758,13 +787,13 @@ public class MeasuredLayers {
boolean [] smpl_sel = new boolean [smplLen];
double [] smpl_d = new double [smplLen];
double [] smpl_w = new double [smplLen];
for (int sy = 0; sy < smplSide; sy++){
for (int sy = 0; sy < mlfp.smplSide; sy++){
int y = dy + sy; // - smpl_center;
for (int sx = 0; sx < smplSide; sx++){
for (int sx = 0; sx < mlfp.smplSide; sx++){
int x = dx + sx; // - smpl_center;
int indxe = y * st2e + x;
if (weight[indxe] > 0.0){
int indxs = sy * smplSide + sx;
int indxs = sy * mlfp.smplSide + sx;
smpl_sel[indxs] = true;
smpl_d[indxs] = disp[indxe];
smpl_w[indxs] = weight[indxe] * smpl_weights[indxs];
......@@ -773,7 +802,7 @@ public class MeasuredLayers {
}
}
}
if (num_in_sample >= smplNum){ // try, remove worst
if (num_in_sample >= mlfp.smplNum){ // try, remove worst
// calculate
double sd=0.0, sd2 = 0.0, sw = 0.0;
for (int i = 0; i < smplLen; i++) if (smpl_sel[i]) {
......@@ -783,7 +812,7 @@ public class MeasuredLayers {
sw += smpl_w[i];
}
// remove worst, update sd2, sd and sw
while ((num_in_sample > smplNum) && (sw > 0)){ // try, remove worst
while ((num_in_sample > mlfp.smplNum) && (sw > 0)){ // try, remove worst
double d_mean = sd/sw;
int iworst = -1;
double dworst2 = 0.0;
......@@ -889,20 +918,21 @@ public class MeasuredLayers {
int stX,
int stY,
boolean [] sel_in,
double strength_floor,
double strength_pow,
int smplSide, // = 2; // Sample size (side of a square)
int smplNum, // = 3; // Number after removing worst (should be >1)
double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
boolean smplWnd, //
double max_abs_tilt, // 2.0; // pix per tile
double max_rel_tilt, // 0.2; // (pix / disparity) per tile
double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
MeasuredLayersFilterParameters mlfp, // filter parameters
// double strength_floor,
// double strength_pow,
// int smplSide, // = 2; // Sample size (side of a square)
// int smplNum, // = 3; // Number after removing worst (should be >1)
// double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// boolean smplWnd, //
// double max_abs_tilt, // 2.0; // pix per tile
// double max_rel_tilt, // 0.2; // (pix / disparity) per tile
// double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
boolean null_if_none,
int debugLevel)
......@@ -916,19 +946,20 @@ public class MeasuredLayers {
stY, // int stY,
sel_in, // boolean [] sel_in,
null, // double [] tiltXY, // null - free with limit on both absolute (2.0?) and relative (0.2) values
strength_floor, // double strength_floor,
strength_pow, // double strength_pow,
smplSide, // int smplSide, // = 2; // Sample size (side of a square)
smplNum, // int smplNum, // = 3; // Number after removing worst (should be >1)
smplRms, // double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
smplWnd, // boolean smplWnd, //
max_abs_tilt, // double max_abs_tilt, // = 2.0; // pix per tile
max_rel_tilt, // double max_rel_tilt, // = 0.2; // (pix / disparity) per tile
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
mlfp, // MeasuredLayersFilterParameters mlfp, // filter parameters
// strength_floor, // double strength_floor,
// strength_pow, // double strength_pow,
// smplSide, // int smplSide, // = 2; // Sample size (side of a square)
// smplNum, // int smplNum, // = 3; // Number after removing worst (should be >1)
// smplRms, // double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // boolean smplWnd, //
// max_abs_tilt, // double max_abs_tilt, // = 2.0; // pix per tile
// max_rel_tilt, // double max_rel_tilt, // = 0.2; // (pix / disparity) per tile
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
null_if_none, // boolean null_if_none,
debugLevel); // int debugLevel)
} else {
......@@ -938,12 +969,13 @@ public class MeasuredLayers {
stY, // int stY,
sel_in, // boolean [] sel_in,
// null, // double [] tiltXY, // null - free with limit on both absolute (2.0?) and relative (0.2) values
strength_floor, // double strength_floor,
strength_pow, // double strength_pow,
smplSide, // int smplSide, // = 2; // Sample size (side of a square)
smplNum, // int smplNum, // = 3; // Number after removing worst (should be >1)
smplRms, // double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
smplWnd, // boolean smplWnd, //
mlfp, // MeasuredLayersFilterParameters mlfp, // filter parameters
// strength_floor, // double strength_floor,
// strength_pow, // double strength_pow,
// smplSide, // int smplSide, // = 2; // Sample size (side of a square)
// smplNum, // int smplNum, // = 3; // Number after removing worst (should be >1)
// smplRms, // double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // boolean smplWnd, //
// 2.0, // double max_abs_tilt, // = 2.0; // pix per tile
// 0.2, // double max_rel_tilt, // = 0.2; // (pix / disparity) per tile
null_if_none, // boolean null_if_none,
......@@ -965,19 +997,20 @@ public class MeasuredLayers {
double [][] atiltXY, // null - free with limit on both absolute (2.0?) and relative (0.2) values
// if it has just one element - apply to all tiles, otherwise it is supposed
// to be per-tile of a supertile array
double strength_floor,
double strength_pow,
int smplSide, // = 3; // Sample size (side of a square)
int smplNum, // = 5; // Number after removing worst (should be >1)
double smplRms, // = 0.3; // Maximal RMS of the remaining tiles in a sample
boolean smplWnd, //
double max_abs_tilt, // 2.0; // pix per tile
double max_rel_tilt, // 0.2; // (pix / disparity) per tile
double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
MeasuredLayersFilterParameters mlfp,
// double strength_floor,
// double strength_pow,
// int smplSide, // = 3; // Sample size (side of a square)
// int smplNum, // = 5; // Number after removing worst (should be >1)
// double smplRms, // = 0.3; // Maximal RMS of the remaining tiles in a sample
// boolean smplWnd, //
// double max_abs_tilt, // 2.0; // pix per tile
// double max_rel_tilt, // 0.2; // (pix / disparity) per tile
// double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
boolean null_if_none,
int debugLevel)
{
......@@ -985,7 +1018,7 @@ public class MeasuredLayers {
if ((layers[num_layer] == null) && null_if_none){
return null;
}
final double [] damping = {damp_tilt, damp_tilt, 0.0}; // 0.0 will be applied to average value, tilt_cost - to both tilts
final double [] damping = {mlfp.damp_tilt, mlfp.damp_tilt, 0.0}; // 0.0 will be applied to average value, tilt_cost - to both tilts
int st2 = 2 * superTileSize;
int st_half = superTileSize/2;
......@@ -993,26 +1026,26 @@ public class MeasuredLayers {
final int dbg_tile = ((stX == 22) && (stY == 19)) ? (5 + 7*16) : -1;// 50397;
int num_selected = 0;
int smpl_center = smplSide /2;
double smpl_dcenter = (smplSide -1.0) /2;
int st2e = st2 + smplSide;
int smplLen = smplSide*smplSide;
final double [] smpl_weights = getSampleWindow(smplSide, !smplWnd);
int smpl_center = mlfp.smplSide /2;
double smpl_dcenter = (mlfp.smplSide -1.0) /2;
int st2e = st2 + mlfp.smplSide;
int smplLen = mlfp.smplSide*mlfp.smplSide;
final double [] smpl_weights = getSampleWindow(mlfp.smplSide, !mlfp.smplWnd);
double [] disp = new double [st2e * st2e];
double [] weight = new double [st2e * st2e];
int st_halfe = st_half + smpl_center;
double smplVar = smplRms * smplRms; // maximal variance (weighted average of the squared difference from the mean)
double smplVar = mlfp.smplRms * mlfp.smplRms; // maximal variance (weighted average of the squared difference from the mean)
PolynomialApproximation pa = new PolynomialApproximation();
double thresholdLin = 1.0E-20; // threshold ratio of matrix determinant to norm for linear approximation (det too low - fail)
double thresholdQuad = 1.0E-30; // threshold ratio of matrix determinant to norm for quadratic approximation (det too low - fail)
double disp_pwr_far = min_tilt_disp - transition/2.0;
double disp_pwr_near = min_tilt_disp + transition/2.0;
double disp_pwr_near2 = disp_pwr_near + smplRms;
double disp_pwr_far = mlfp.min_tilt_disp - mlfp.transition/2.0;
double disp_pwr_near = mlfp.min_tilt_disp + mlfp.transition/2.0;
double disp_pwr_near2 = disp_pwr_near + mlfp.smplRms;
double [] disp_pwr = null;
boolean far_mode_en = (far_mode == 1) || (far_mode == 2);
boolean remove_far_only = (far_mode == 2);
boolean far_mode_en = (mlfp.far_mode == 1) || (mlfp.far_mode == 2);
boolean remove_far_only = (mlfp.far_mode == 2);
if (far_mode_en) {
disp_pwr = new double [st2e * st2e];
}
......@@ -1035,15 +1068,15 @@ public class MeasuredLayers {
if (layers[num_layer][indx] != null){ // apply sel_in later
disp[indx_ste] = layers[num_layer][indx].getDisparity();
double w = layers[num_layer][indx].getStrength() - strength_floor;
double w = layers[num_layer][indx].getStrength() - mlfp.strength_floor;
if (w > 0) {
if (strength_pow != 1.0) w = Math.pow(w, strength_pow);
if (mlfp.strength_pow != 1.0) w = Math.pow(w, mlfp.strength_pow);
// w *= lapWeight[dy][dx];
disp[indx_ste] = layers[num_layer][indx].getDisparity(); // same?
weight[indx_ste] = w;
num_selected ++;
if (far_mode_en && (disp[indx_ste] < disp_pwr_near2) && (disp[indx_ste] > 0)) {
disp_pwr[indx_ste] = Math.pow(disp[indx_ste], far_power);
disp_pwr[indx_ste] = Math.pow(disp[indx_ste], mlfp.far_power);
num_far++;
}
}
......@@ -1063,340 +1096,348 @@ public class MeasuredLayers {
System.out.println("getDisparityStrengthML(): stX="+stX+" stY="+stY+" dx="+dx+" dy="+dy);
}
if (((sel_in == null) || sel_in[indx])){
int num_in_sample = 0;
double sum_wnd = 0.0;
boolean [] smpl_sel = new boolean [smplLen];
double [] smpl_d = new double [smplLen];
double [] smpl_p = new double [smplLen];
double [] smpl_w = new double [smplLen];
if (far_mode_en ) {
smpl_far_sel = new boolean [smplLen];
smpl_pwr_d = new double [smplLen];
smpl_far_w = new double [smplLen];
num_in_sample_far = 0;
}
for (int sy = 0; sy < smplSide; sy++){
int y = dy + sy; // - smpl_center;
for (int sx = 0; sx < smplSide; sx++){
int x = dx + sx; // - smpl_center;
int indxe = y * st2e + x;
if (weight[indxe] > 0.0){
int indxs = sy * smplSide + sx;
smpl_sel[indxs] = true;
smpl_d[indxs] = disp[indxe];
smpl_w[indxs] = weight[indxe] * smpl_weights[indxs];
sum_wnd += smpl_weights[indxs];
num_in_sample ++;
if (far_mode_en && (disp_pwr[indxe]>0.0)) {
smpl_far_sel[indxs] = true;
smpl_pwr_d[indxs] = disp_pwr[indxe];
smpl_far_w[indxs] = smpl_w[indxs];
num_in_sample_far++;
// check if it need filtering
int indxe_center = (dy + smpl_center)*st2e + (dx + smpl_center);
if (weight[indxe_center] >= mlfp.strength_sure) { // tile does not need filtering
ds[0][indx] = disp[indxe_center];
ds[1][indx] = weight[indxe_center];
} else {
int num_in_sample = 0;
double sum_wnd = 0.0;
boolean [] smpl_sel = new boolean [smplLen];
double [] smpl_d = new double [smplLen];
double [] smpl_p = new double [smplLen];
double [] smpl_w = new double [smplLen];
if (far_mode_en ) {
smpl_far_sel = new boolean [smplLen];
smpl_pwr_d = new double [smplLen];
smpl_far_w = new double [smplLen];
num_in_sample_far = 0;
}
for (int sy = 0; sy < mlfp.smplSide; sy++){
int y = dy + sy; // - smpl_center;
for (int sx = 0; sx < mlfp.smplSide; sx++){
int x = dx + sx; // - smpl_center;
int indxe = y * st2e + x;
if (weight[indxe] > 0.0){
int indxs = sy * mlfp.smplSide + sx;
smpl_sel[indxs] = true;
smpl_d[indxs] = disp[indxe];
smpl_w[indxs] = weight[indxe] * smpl_weights[indxs];
sum_wnd += smpl_weights[indxs];
num_in_sample ++;
if (far_mode_en && (disp_pwr[indxe]>0.0)) {
smpl_far_sel[indxs] = true;
smpl_pwr_d[indxs] = disp_pwr[indxe];
smpl_far_w[indxs] = smpl_w[indxs];
num_in_sample_far++;
}
}
}
}
}
if (far_mode_en ) {
smpl_far_d = smpl_d.clone();
}
if (num_in_sample >= smplNum){ // try, remove worst
sample_loop:
{
boolean en_tilt = (atiltXY == null);
if (en_tilt) { // make sure there are enough samples and not all of them are on the same line
if ((damp_tilt == 0.0) && !notColinear(smpl_sel,smplSide)){
en_tilt = false;
}
if (far_mode_en ) {
smpl_far_d = smpl_d.clone();
}
if (en_tilt) { // enable floating tilt
double sd2 = 0.0, d_center = 0.0, sw = 0.0;
// TODO: making simple - recalculate after removing. Can be done more efficient.
while (num_in_sample >= smplNum) { // try, remove worst
sd2 = 0.0;
d_center = 0.0;
sw = 0.0;
double [][][] mdata = new double [num_in_sample][3][];
int mindx = 0;
for (int sy = 0; sy < smplSide; sy++){
for (int sx = 0; sx < smplSide; sx++){
int indxs = sy * smplSide + sx;
if (smpl_sel[indxs]) {
mdata[mindx][0] = new double [2];
mdata[mindx][0][0] = sx - smpl_dcenter;
mdata[mindx][0][1] = sy - smpl_dcenter;
mdata[mindx][1] = new double [1];
mdata[mindx][1][0] = smpl_d[indxs];
mdata[mindx][2] = new double [1];
mdata[mindx][2][0] = smpl_w[indxs];
mindx ++;
if (num_in_sample >= mlfp.smplNum){ // try, remove worst
sample_loop:
{
boolean en_tilt = (atiltXY == null);
if (en_tilt) { // make sure there are enough samples and not all of them are on the same line
if ((mlfp.damp_tilt == 0.0) && !notColinear(smpl_sel, mlfp.smplSide)){
en_tilt = false;
}
}
if (en_tilt) { // enable floating tilt
double sd2 = 0.0, d_center = 0.0, sw = 0.0;
// TODO: making simple - recalculate after removing. Can be done more efficient.
while (num_in_sample >= mlfp.smplNum) { // try, remove worst
sd2 = 0.0;
d_center = 0.0;
sw = 0.0;
double [][][] mdata = new double [num_in_sample][3][];
int mindx = 0;
for (int sy = 0; sy < mlfp.smplSide; sy++){
for (int sx = 0; sx < mlfp.smplSide; sx++){
int indxs = sy * mlfp.smplSide + sx;
if (smpl_sel[indxs]) {
mdata[mindx][0] = new double [2];
mdata[mindx][0][0] = sx - smpl_dcenter;
mdata[mindx][0][1] = sy - smpl_dcenter;
mdata[mindx][1] = new double [1];
mdata[mindx][1][0] = smpl_d[indxs];
mdata[mindx][2] = new double [1];
mdata[mindx][2][0] = smpl_w[indxs];
mindx ++;
}
}
}
}
double[][] approx2d = pa.quadraticApproximation(
mdata,
true, // boolean forceLinear, // use linear approximation
damping, // double [] damping,
thresholdLin, // threshold ratio of matrix determinant to norm for linear approximation (det too low - fail)
thresholdQuad, // threshold ratio of matrix determinant to norm for quadratic approximation (det too low - fail)
debugLevel);
if (approx2d == null){
if (debugLevel > -1){
System.out.println("getDisparityStrengthML(): can not find linear approximation");
double[][] approx2d = pa.quadraticApproximation(
mdata,
true, // boolean forceLinear, // use linear approximation
damping, // double [] damping,
thresholdLin, // threshold ratio of matrix determinant to norm for linear approximation (det too low - fail)
thresholdQuad, // threshold ratio of matrix determinant to norm for quadratic approximation (det too low - fail)
debugLevel);
if (approx2d == null){
if (debugLevel > -1){
System.out.println("getDisparityStrengthML(): can not find linear approximation");
}
break sample_loop;
}
break sample_loop;
}
// limit tilt to be within range
// double max_abs_tilt, // = 2.0; // pix per tile
// double max_rel_tilt, // = 0.2; // (pix / disparity) per tile
double max_tilt = Math.min(max_abs_tilt, max_rel_tilt * approx2d[0][2]);
boolean overlimit = (Math.abs(approx2d[0][0]) > max_tilt) || (Math.abs(approx2d[0][1]) > max_tilt);
if (overlimit) {
approx2d[0][0] = Math.min(approx2d[0][0], max_tilt);
approx2d[0][1] = Math.min(approx2d[0][1], max_tilt);
approx2d[0][0] = Math.max(approx2d[0][0], -max_tilt);
approx2d[0][1] = Math.max(approx2d[0][1], -max_tilt);
}
// subtract tilt from disparity
for (int sy = 0; sy < smplSide; sy++){
for (int sx = 0; sx < smplSide; sx++){
int indxs = sy * smplSide + sx;
if (smpl_sel[indxs]) {
smpl_p[indxs] = approx2d[0][0] * (sx - smpl_dcenter) + approx2d[0][1] * (sy - smpl_dcenter) + approx2d[0][2];
// limit tilt to be within range
// double max_abs_tilt, // = 2.0; // pix per tile
// double max_rel_tilt, // = 0.2; // (pix / disparity) per tile
double max_tilt = Math.min(mlfp.max_abs_tilt, mlfp.max_rel_tilt * approx2d[0][2]);
boolean overlimit = (Math.abs(approx2d[0][0]) > max_tilt) || (Math.abs(approx2d[0][1]) > max_tilt);
if (overlimit) {
approx2d[0][0] = Math.min(approx2d[0][0], max_tilt);
approx2d[0][1] = Math.min(approx2d[0][1], max_tilt);
approx2d[0][0] = Math.max(approx2d[0][0], -max_tilt);
approx2d[0][1] = Math.max(approx2d[0][1], -max_tilt);
}
// subtract tilt from disparity
for (int sy = 0; sy < mlfp.smplSide; sy++){
for (int sx = 0; sx < mlfp.smplSide; sx++){
int indxs = sy * mlfp.smplSide + sx;
if (smpl_sel[indxs]) {
smpl_p[indxs] = approx2d[0][0] * (sx - smpl_dcenter) + approx2d[0][1] * (sy - smpl_dcenter) + approx2d[0][2];
}
}
}
}
if (overlimit){ // re-calculate disparity average (in the center)
double sd=0.0;
if (overlimit){ // re-calculate disparity average (in the center)
double sd=0.0;
for (int indxs = 0; indxs < smplLen;indxs++) if (smpl_sel[indxs]) {
double d = smpl_d[indxs] - smpl_p[indxs];
double dw = d * smpl_w[indxs];
sd += dw;
sw += smpl_w[indxs];
}
sd /= sw;
for (int indxs = 0; indxs < smplLen;indxs++) if (smpl_sel[indxs]) {
smpl_p[indxs] += sd;
}
approx2d[0][2] += sd;
}
d_center = approx2d[0][2];
sw = 0.0;
for (int indxs = 0; indxs < smplLen;indxs++) if (smpl_sel[indxs]) {
double d = smpl_d[indxs] - smpl_p[indxs];
double dw = d * smpl_w[indxs];
sd += dw;
sw += smpl_w[indxs];
// sd += dw;
sd2 += dw * smpl_d[indxs];
sw += smpl_w[indxs];
}
sd /= sw;
for (int indxs = 0; indxs < smplLen;indxs++) if (smpl_sel[indxs]) {
smpl_p[indxs] += sd;
// remove worst - it should not make remaining set
if (num_in_sample > mlfp.smplNum) { // remove worst if it is not the last run where only calculations are needed
// double d_mean = sd/sw;
int iworst = -1;
double dworst2 = 0.0;
for (int indxs = 0; indxs < smplLen; indxs++) if (smpl_sel[indxs]) {
// double d2 = (smpl_d[i] - d_mean);
double d2 = smpl_d[indxs] - smpl_p[indxs];
d2 *=d2;
if (d2 > dworst2) {
if ((mlfp.damp_tilt !=0.0) || notColinearWithout (
indxs, // int indx,
smpl_sel, // boolean [] sel,
mlfp.smplSide)) { // int side))
iworst = indxs;
dworst2 = d2;
}
}
}
if (iworst < 0){
if (debugLevel > 0) {
System.out.println("**** this may be BUG in getDisparityStrengthML() can not find the worst sample - all tiles fit perfectly ****");
}
// this can happen if some samples are the same and all the pixels fit exactly - use all of them
break;
}
// remove worst sample
smpl_sel[iworst] = false;
// double dw = smpl_d[iworst] * smpl_w[iworst];
// sd -= dw;
// sd2 -= dw * smpl_d[iworst];
// sw -= smpl_w[iworst];
sum_wnd -= smpl_weights[iworst];
num_in_sample --;
} else {
break;
}
} // removing worst tiles, all done,
// calculate variance of the remaining set
if (sw > 0.0) {
// sd /= sw;
// sd2 /= sw;
double var = sd2/sw; // - sd * sd;
if (var < smplVar) { // good, save in the result array
ds[0][indx] = d_center;
// ds[1][indx] = sw * lapWeight[dy][dx] /num_in_sample; // average weights, multiply by window //** TODO: change
ds[1][indx] = sw * lapWeight[dy][dx] /sum_wnd; // average weights, multiply by window //** TODO: change
}
approx2d[0][2] += sd;
}
d_center = approx2d[0][2];
sw = 0.0;
for (int indxs = 0; indxs < smplLen;indxs++) if (smpl_sel[indxs]) {
double d = smpl_d[indxs] - smpl_p[indxs];
double dw = d * smpl_w[indxs];
// sd += dw;
sd2 += dw * smpl_d[indxs];
sw += smpl_w[indxs];
} else { // fixed tilt
// tilt around center
double [] tiltXY= {0.0,0.0};
if (atiltXY != null){ // if null ( free but failed co-linear test - keep both tilts == 0.0
if (atiltXY.length == 1){
tiltXY = atiltXY[0]; // common for all tiles (such as constant disparity)
} else if (atiltXY[indx] != null){
tiltXY = atiltXY[indx];
}
}
if ((tiltXY != null) && (tiltXY[0] != 0.0) && (tiltXY[1] != 0.0)){
for (int sy = 0; sy < mlfp.smplSide; sy++){
for (int sx = 0; sx < mlfp.smplSide; sx++){
int indxs = sy * mlfp.smplSide + sx;
if (smpl_w[indxs] > 0.0) {
smpl_d[indxs] -= tiltXY[0]* (sx - smpl_dcenter) + tiltXY[1]* (sy - smpl_dcenter);
}
}
}
}
// remove worst - it should not make remaining set
if (num_in_sample > smplNum) { // remove worst if it is not the last run where only calculations are needed
// double d_mean = sd/sw;
// calculate
double sd=0.0, sd2 = 0.0, sw = 0.0;
for (int i = 0; i < smplLen; i++) if (smpl_sel[i]) {
double dw = smpl_d[i] * smpl_w[i];
sd += dw;
sd2 += dw * smpl_d[i];
sw += smpl_w[i];
}
// remove worst, update sd2, sd and sw
while ((num_in_sample > mlfp.smplNum) && (sw > 0)){ // try, remove worst
double d_mean = sd/sw;
int iworst = -1;
double dworst2 = 0.0;
for (int indxs = 0; indxs < smplLen; indxs++) if (smpl_sel[indxs]) {
// double d2 = (smpl_d[i] - d_mean);
double d2 = smpl_d[indxs] - smpl_p[indxs];
for (int i = 0; i < smplLen; i++) if (smpl_sel[i]) {
double d2 = (smpl_d[i] - d_mean);
d2 *=d2;
if (d2 > dworst2) {
if ((damp_tilt !=0.0) || notColinearWithout (
indxs, // int indx,
smpl_sel, // boolean [] sel,
smplSide)) { // int side))
iworst = indxs;
dworst2 = d2;
}
iworst = i;
dworst2 = d2;
}
//remove_far_only
}
if (iworst < 0){
if (debugLevel > 0) {
System.out.println("**** this may be BUG in getDisparityStrengthML() can not find the worst sample - all tiles fit perfectly ****");
}
// this can happen if some samples are the same and all the pixels fit exactly - use all of them
System.out.println("**** this is a BUG2 in getDisparityStrengthML() ****");
break;
}
// remove worst sample
smpl_sel[iworst] = false;
// double dw = smpl_d[iworst] * smpl_w[iworst];
// sd -= dw;
// sd2 -= dw * smpl_d[iworst];
// sw -= smpl_w[iworst];
double dw = smpl_d[iworst] * smpl_w[iworst];
sd -= dw;
sd2 -= dw * smpl_d[iworst];
sw -= smpl_w[iworst];
sum_wnd -= smpl_weights[iworst];
num_in_sample --;
} else {
break;
}
} // removing worst tiles, all done,
// calculate variance of the remaining set
if (sw > 0.0) {
// sd /= sw;
// sd2 /= sw;
double var = sd2/sw; // - sd * sd;
if (var < smplVar) { // good, save in the result array
ds[0][indx] = d_center;
// ds[1][indx] = sw * lapWeight[dy][dx] /num_in_sample; // average weights, multiply by window //** TODO: change
ds[1][indx] = sw * lapWeight[dy][dx] /sum_wnd; // average weights, multiply by window //** TODO: change
// calculate variance of the remaining set
if (sw > 0.0) {
sd /= sw;
sd2 /= sw;
double var = sd2 - sd * sd;
if (var < smplVar) { // good, save in the result array
ds[0][indx] = sd;
// ds[1][indx] = sw * lapWeight[dy][dx] /num_in_sample; // average weights, multiply by window //** TODO: change
ds[1][indx] = sw * lapWeight[dy][dx] /sum_wnd; // average weights, multiply by window //** TODO: change
}
} else {
num_in_sample = 0;
System.out.println("**** this is a BUG in getDisparityStrengthML(), shoud not happen ? ****");
}
}
} else { // fixed tilt
// tilt around center
double [] tiltXY= {0.0,0.0};
if (atiltXY != null){ // if null ( free but failed co-linear test - keep both tilts == 0.0
if (atiltXY.length == 1){
tiltXY = atiltXY[0]; // common for all tiles (such as constant disparity)
} else if (atiltXY[indx] != null){
tiltXY = atiltXY[indx];
}
}
if ((tiltXY != null) && (tiltXY[0] != 0.0) && (tiltXY[1] != 0.0)){
for (int sy = 0; sy < smplSide; sy++){
for (int sx = 0; sx < smplSide; sx++){
int indxs = sy * smplSide + sx;
if (smpl_w[indxs] > 0.0) {
smpl_d[indxs] -= tiltXY[0]* (sx - smpl_dcenter) + tiltXY[1]* (sy - smpl_dcenter);
}
}
}
// now apply far if needed
if (num_in_sample_far > 0) { // calculate small far disparity, then merge with normal one
// remove extra
// smpl_pwr_d - disparity to power
// smpl_far_d - just disparity
if (num_in_sample_far >= mlfp.smplNum){ // try, remove worst
double sd=0.0, sd2 = 0.0, sw = 0.0;
double sdp =0.0; // , sdp2 = 0.0;
for (int i = 0; i < smplLen; i++) if (smpl_far_sel[i]) {
double dw = smpl_far_d[i] * smpl_far_w[i];
sd += dw;
sd2 += dw * smpl_far_d[i];
sw += smpl_far_w[i];
double dpw = smpl_pwr_d[i] * smpl_far_w[i];
sdp += dpw;
// sdp2 += dpw * smpl_pwr_d[i];
}
}
// calculate
double sd=0.0, sd2 = 0.0, sw = 0.0;
for (int i = 0; i < smplLen; i++) if (smpl_sel[i]) {
double dw = smpl_d[i] * smpl_w[i];
sd += dw;
sd2 += dw * smpl_d[i];
sw += smpl_w[i];
}
// remove worst, update sd2, sd and sw
while ((num_in_sample > smplNum) && (sw > 0)){ // try, remove worst
double d_mean = sd/sw;
int iworst = -1;
double dworst2 = 0.0;
for (int i = 0; i < smplLen; i++) if (smpl_sel[i]) {
double d2 = (smpl_d[i] - d_mean);
d2 *=d2;
if (d2 > dworst2) {
iworst = i;
dworst2 = d2;
// remove worst (before power), update sd2, sd and sw
while ((num_in_sample_far > mlfp.smplNum) && (sw > 0)){ // try, remove worst
double d_mean = sd/sw;
int iworst = -1;
double dworst2 = 0.0;
for (int i = 0; i < smplLen; i++) if (smpl_far_sel[i]) {
double d2 = (smpl_far_d[i] - d_mean);
d2 *=d2;
if ((d2 > dworst2) && (!remove_far_only ||(smpl_far_d[i] < d_mean))) {
iworst = i;
dworst2 = d2;
}
}
//remove_far_only
}
if (iworst < 0){
System.out.println("**** this is a BUG2 in getDisparityStrengthML() ****");
break;
}
// remove worst sample
smpl_sel[iworst] = false;
double dw = smpl_d[iworst] * smpl_w[iworst];
sd -= dw;
sd2 -= dw * smpl_d[iworst];
sw -= smpl_w[iworst];
sum_wnd -= smpl_weights[iworst];
num_in_sample --;
}
// calculate variance of the remaining set
if (sw > 0.0) {
sd /= sw;
sd2 /= sw;
double var = sd2 - sd * sd;
if (var < smplVar) { // good, save in the result array
ds[0][indx] = sd;
// ds[1][indx] = sw * lapWeight[dy][dx] /num_in_sample; // average weights, multiply by window //** TODO: change
ds[1][indx] = sw * lapWeight[dy][dx] /sum_wnd; // average weights, multiply by window //** TODO: change
}
} else {
num_in_sample = 0;
System.out.println("**** this is a BUG in getDisparityStrengthML(), shoud not happen ? ****");
}
}
}
}
// now apply far if needed
if (num_in_sample_far > 0) { // calculate small far disparity, then merge with normal one
// remove extra
// smpl_pwr_d - disparity to power
// smpl_far_d - just disparity
if (num_in_sample_far >= smplNum){ // try, remove worst
double sd=0.0, sd2 = 0.0, sw = 0.0;
double sdp =0.0; // , sdp2 = 0.0;
for (int i = 0; i < smplLen; i++) if (smpl_far_sel[i]) {
double dw = smpl_far_d[i] * smpl_far_w[i];
sd += dw;
sd2 += dw * smpl_far_d[i];
sw += smpl_far_w[i];
double dpw = smpl_pwr_d[i] * smpl_far_w[i];
sdp += dpw;
// sdp2 += dpw * smpl_pwr_d[i];
}
if (iworst < 0){
System.out.println("**** this is a BUG3 in getDisparityStrengthML() ****");
break;
}
// remove worst sample
smpl_far_sel[iworst] = false;
double dw = smpl_far_d[iworst] * smpl_far_w[iworst];
sd -= dw;
sd2 -= dw * smpl_far_d[iworst];
sw -= smpl_far_w[iworst];
sum_wnd -= smpl_weights[iworst];
num_in_sample_far --;
// Remove from the power average too
// remove worst (before power), update sd2, sd and sw
while ((num_in_sample_far > smplNum) && (sw > 0)){ // try, remove worst
double d_mean = sd/sw;
int iworst = -1;
double dworst2 = 0.0;
for (int i = 0; i < smplLen; i++) if (smpl_far_sel[i]) {
double d2 = (smpl_far_d[i] - d_mean);
d2 *=d2;
if ((d2 > dworst2) && (!remove_far_only ||(smpl_far_d[i] < d_mean))) {
iworst = i;
dworst2 = d2;
}
}
if (iworst < 0){
System.out.println("**** this is a BUG3 in getDisparityStrengthML() ****");
break;
sdp -= smpl_pwr_d[iworst] * smpl_far_w[iworst];
}
// remove worst sample
smpl_far_sel[iworst] = false;
double dw = smpl_far_d[iworst] * smpl_far_w[iworst];
sd -= dw;
sd2 -= dw * smpl_far_d[iworst];
sw -= smpl_far_w[iworst];
sum_wnd -= smpl_weights[iworst];
num_in_sample_far --;
// Remove from the power average too
sdp -= smpl_pwr_d[iworst] * smpl_far_w[iworst];
}
// calculate variance of the remaining set
if (sw > 0.0) {
sd /= sw;
sd2 /= sw;
double var = sd2 - sd * sd;
if (var < smplVar) { // good, save in the result array (here use linear disparity
// here need to combine two filtering modes - "tilted" and "far"
sdp = Math.pow(sdp/sw, 1.0/far_power);
if (sdp < disp_pwr_near) { // otherwise keep tilted mode result
double far_w = sw * lapWeight[dy][dx] /sum_wnd; // average weights, multiply by window //** TODO: change
if (sdp < disp_pwr_far) {
ds[0][indx] = sdp;
ds[1][indx] = far_w;
} else { // interpolate
double k = (sdp - disp_pwr_far) / transition;
ds[0][indx] = (1.0 - k) * sdp + k * ds[0][indx];
ds[1][indx] = (1.0 - k) * far_w + k * ds[1][indx];
// calculate variance of the remaining set
if (sw > 0.0) {
sd /= sw;
sd2 /= sw;
double var = sd2 - sd * sd;
if (var < smplVar) { // good, save in the result array (here use linear disparity
// here need to combine two filtering modes - "tilted" and "far"
sdp = Math.pow(sdp/sw, 1.0/mlfp.far_power);
if (sdp < disp_pwr_near) { // otherwise keep tilted mode result
double far_w = sw * lapWeight[dy][dx] /sum_wnd; // average weights, multiply by window //** TODO: change
if (sdp < disp_pwr_far) {
ds[0][indx] = sdp;
ds[1][indx] = far_w;
} else { // interpolate
double k = (sdp - disp_pwr_far) / mlfp.transition;
ds[0][indx] = (1.0 - k) * sdp + k * ds[0][indx];
ds[1][indx] = (1.0 - k) * far_w + k * ds[1][indx];
}
}
ds[0][indx] = sd;
ds[1][indx] = sw * lapWeight[dy][dx] /sum_wnd; // average weights, multiply by window //** TODO: change
}
ds[0][indx] = sd;
ds[1][indx] = sw * lapWeight[dy][dx] /sum_wnd; // average weights, multiply by window //** TODO: change
} else {
num_in_sample = 0;
System.out.println("**** this is a BUG4 in getDisparityStrengthML(), shoud not happen ? ****");
}
} else {
num_in_sample = 0;
System.out.println("**** this is a BUG4 in getDisparityStrengthML(), shoud not happen ? ****");
}
}
}
}
} // end of tile
}
}
return ds;
......
import java.util.Properties;
/**
**
** MeasuredLayersFilterParameters - parameters defining tile filters
**
** Copyright (C) 2018 Elphel, Inc.
**
** -----------------------------------------------------------------------------**
**
** ImageDtt.java is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
** -----------------------------------------------------------------------------**
**
*/
public class MeasuredLayersFilterParameters {
public double strength_sure = 0.25; // Do not filter disparity above this strength
public double strength_floor = 0.1; // Subtract from strength, discard negative
public double strength_pow = 1.0; // raise strength to this power
public int smplSide = 3; // Sample size (side of a square)
public int smplNum = 5; // Number after removing worst
public double smplRms = 0.3; // Maximal RMS of the remaining tiles in a sample
public boolean smplWnd = false; // Use window function for the samples (TODO: change default to true after testing)
public double max_abs_tilt = 2.0; // Maximal absolute tilt in pixels/tile
public double max_rel_tilt = 0.2; // Maximal relative tilt in pixels/tile/disparity
public double damp_tilt = 0.001; // Tilt cost for damping insufficient plane data
public double min_tilt_disp = 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
public double transition = 1.0; // Mode transition range (between tilted and maximal disparity)
public int far_mode = 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
public double far_power = 3.0; // Raise disparity to this power before averaging for far objects
public void setProperties(String prefix,Properties properties){
properties.setProperty(prefix+"strength_sure", this.strength_sure +"");
properties.setProperty(prefix+"strength_floor", this.strength_floor +"");
properties.setProperty(prefix+"strength_pow", this.strength_pow +"");
properties.setProperty(prefix+"smplSide", this.smplSide+"");
properties.setProperty(prefix+"smplNum", this.smplNum+"");
properties.setProperty(prefix+"smplRms", this.smplRms +"");
properties.setProperty(prefix+"smplWnd", this.smplWnd+"");
properties.setProperty(prefix+"max_abs_tilt", this.max_abs_tilt+"");
properties.setProperty(prefix+"max_rel_tilt", this.max_rel_tilt+"");
properties.setProperty(prefix+"damp_tilt", this.damp_tilt+"");
properties.setProperty(prefix+"min_tilt_disp", this.min_tilt_disp+"");
properties.setProperty(prefix+"transition", this.transition+"");
properties.setProperty(prefix+"far_mode", this.far_mode+"");
properties.setProperty(prefix+"far_power", this.far_power+"");
}
public void getProperties(String prefix,Properties properties){
if (properties.getProperty(prefix+"strength_sure")!=null) this.strength_sure=Double.parseDouble(properties.getProperty(prefix+"strength_sure"));
if (properties.getProperty(prefix+"strength_floor")!=null) this.strength_floor=Double.parseDouble(properties.getProperty(prefix+"strength_floor"));
if (properties.getProperty(prefix+"strength_pow")!=null) this.strength_pow=Double.parseDouble(properties.getProperty(prefix+"strength_pow"));
if (properties.getProperty(prefix+"smplSide")!=null) this.smplSide=Integer.parseInt(properties.getProperty(prefix+"smplSide"));
if (properties.getProperty(prefix+"smplNum")!=null) this.smplNum=Integer.parseInt(properties.getProperty(prefix+"smplNum"));
if (properties.getProperty(prefix+"smplRms")!=null) this.smplRms=Double.parseDouble(properties.getProperty(prefix+"smplRms"));
if (properties.getProperty(prefix+"smplWnd")!=null) this.smplWnd=Boolean.parseBoolean(properties.getProperty(prefix+"smplWnd"));
if (properties.getProperty(prefix+"max_abs_tilt")!=null) this.max_abs_tilt=Double.parseDouble(properties.getProperty(prefix+"max_abs_tilt"));
if (properties.getProperty(prefix+"max_rel_tilt")!=null) this.max_rel_tilt=Double.parseDouble(properties.getProperty(prefix+"max_rel_tilt"));
if (properties.getProperty(prefix+"damp_tilt")!=null) this.damp_tilt=Double.parseDouble(properties.getProperty(prefix+"damp_tilt"));
if (properties.getProperty(prefix+"min_tilt_disp")!=null) this.min_tilt_disp=Double.parseDouble(properties.getProperty(prefix+"min_tilt_disp"));
if (properties.getProperty(prefix+"transition")!=null) this.transition=Double.parseDouble(properties.getProperty(prefix+"transition"));
if (properties.getProperty(prefix+"far_mode")!=null) this.far_mode=Integer.parseInt(properties.getProperty(prefix+"far_mode"));
if (properties.getProperty(prefix+"far_power")!=null) this.far_power=Double.parseDouble(properties.getProperty(prefix+"far_power"));
}
@Override
public MeasuredLayersFilterParameters clone() {
MeasuredLayersFilterParameters mlfp = new MeasuredLayersFilterParameters();
mlfp.strength_sure = this.strength_sure;
mlfp.strength_floor = this.strength_floor;
mlfp.strength_pow = this.strength_pow;
mlfp.smplSide = this.smplSide;
mlfp.smplNum = this.smplNum;
mlfp.smplRms = this.smplRms;
mlfp.smplWnd = this.smplWnd;
mlfp.max_abs_tilt = this.max_abs_tilt;
mlfp.max_rel_tilt = this.max_rel_tilt;
mlfp.damp_tilt = this.damp_tilt;
mlfp.min_tilt_disp = this.min_tilt_disp;
mlfp.transition = this.transition;
mlfp.far_mode = this.far_mode;
mlfp.far_power = this.far_power;
return mlfp;
}
public boolean equals(MeasuredLayersFilterParameters mlfp) {
return
(mlfp.strength_sure == this.strength_sure ) &&
(mlfp.strength_floor == this.strength_floor ) &&
(mlfp.strength_pow == this.strength_pow ) &&
(mlfp.smplSide == this.smplSide ) &&
(mlfp.smplNum == this.smplNum ) &&
(mlfp.smplRms == this.smplRms ) &&
(mlfp.smplWnd == this.smplWnd ) &&
(mlfp.max_abs_tilt == this.max_abs_tilt ) &&
(mlfp.max_rel_tilt == this.max_rel_tilt ) &&
(mlfp.damp_tilt == this.damp_tilt ) &&
(mlfp.min_tilt_disp == this.min_tilt_disp ) &&
(mlfp.transition == this.transition ) &&
(mlfp.far_mode == this.far_mode ) &&
(mlfp.far_power == this.far_power);
}
}
......@@ -76,12 +76,12 @@ public class PolynomialApproximation {
M.solve(B).print(10, 12);
}
double []result=new double [N+1];
for (int i=0;i<=N;i++) result[i]=(i<=N1)?aR[i][0]:0.0;
return result;
}
/**
* Linear approximates each of 3 functions of 3 variables and finds where they are all zero
* Linear approximates each of 3 functions of 3 variables and finds where they are all zero
* @param data: for each sample (1-st index):
* 0 - {x,y,z}
* 1 - {f1, f2, f3},
......@@ -91,7 +91,7 @@ public class PolynomialApproximation {
public double [] linear3d(double [][][] data){
/*
* Approximating each of the 3 measured parameters (Far/near, tilt x and tilt y) with linear approximation in the vicinity of the last position
* For each parameter F(x,y,z)=A*x + B*y +C*z + D, using Gaussian weight function with sigma= motorsSigma
* For each parameter F(x,y,z)=A*x + B*y +C*z + D, using Gaussian weight function with sigma= motorsSigma
*/
double [][] aM3=new double [3][3];
double [][] aB3=new double [3][1];
......@@ -164,7 +164,7 @@ public class PolynomialApproximation {
}
return result;
}
public double[] quadraticMax2d (double [][][] data){
......@@ -196,6 +196,31 @@ public class PolynomialApproximation {
return xy;
}
// returns maximum's coordinates, value, and coefficients for x2, y2 and xy
public double[] quadraticMaxV2dX2Y2XY (double [][][] data,double thresholdQuad, int debugLevel){
double [][] coeff=quadraticApproximation(data, false, 1.0E-20, thresholdQuad,debugLevel);
if (coeff==null) return null;
if (coeff[0].length<6) return null;
double [][] aM={
{2*coeff[0][0], coeff[0][2]}, // | 2A, C |
{ coeff[0][2],2*coeff[0][1]}}; // | C, 2B |
Matrix M=(new Matrix(aM));
double nmQ=normMatix(aM);
if (debugLevel>3) System.out.println("M.det()="+M.det()+" normMatix(aM)="+nmQ+" data.length="+data.length);
if ((nmQ==0.0) || (Math.abs(M.det())/normMatix(aM)<thresholdQuad)) {
if (debugLevel>3) System.out.println("quadraticMax2d() failed: M.det()="+M.det()+" normMatix(aM)="+normMatix(aM));
return null;
}
double [][] aB={
{-coeff[0][3]}, // | - D |
{-coeff[0][4]}}; // | - E |
double [] xy=M.solve(new Matrix(aB)).getColumnPackedCopy();
double vmax = coeff[0][0]*xy[0]*xy[0]+coeff[0][1]*xy[1]*xy[1]+coeff[0][2]*xy[0]*xy[1]+coeff[0][3]*xy[0]+coeff[0][4]*xy[1]+coeff[0][5];
double [] xyx2y2 = {xy[0],xy[1], vmax, coeff[0][0], coeff[0][1], coeff[0][2]};
return xyx2y2;
}
/* ======================================================================== */
/**
* See below, this version is for backward compatibility with no damping
......@@ -210,13 +235,13 @@ public class PolynomialApproximation {
return quadraticApproximation(
data,
forceLinear,
null);
null);
}
/**
* Approximate function z(x,y) as a second degree polynomial (or just linear)
* f(x,y)=A*x^2+B*y^2+C*x*y+D*x+E*y+F or f(x,y)=D*x+E*y+F
* f(x,y)=A*x^2+B*y^2+C*x*y+D*x+E*y+F or f(x,y)=D*x+E*y+F
* @param data array consists of lines of either 2 or 3 vectors:
* 2-element vector x,y
* variable length vector z (should be the same for all samples)
......@@ -225,7 +250,7 @@ public class PolynomialApproximation {
* @param damping optional (may be null) array of 3 (for linear) or 6 (quadratic) values that adds cost
* for corresponding coefficient be non-zero. This can be used to find reasonable solutions when
* data is insufficient. Just one data point would result in a plane of constant z, co-linear
* points will produce a plane with a gradient along this line
* points will produce a plane with a gradient along this line
* @return array of vectors or null
* each vector (one per each z component) is either 6-element- (A,B,C,D,E,F) if quadratic is possible and enabled
* or 3-element - (D,E,F) if linear is possible and quadratic is not possible or disabled
......@@ -242,7 +267,7 @@ public class PolynomialApproximation {
damping,
this.debugLevel);
}
public double [][] quadraticApproximation(
double [][][] data,
boolean forceLinear, // use linear approximation
......@@ -254,8 +279,8 @@ public class PolynomialApproximation {
null,
debugLevel);
}
public double [][] quadraticApproximation(
double [][][] data,
boolean forceLinear, // use linear approximation
......@@ -271,7 +296,7 @@ public class PolynomialApproximation {
debugLevel);
}
public double [][] quadraticApproximation(
double [][][] data,
boolean forceLinear, // use linear approximation
......@@ -302,7 +327,7 @@ public class PolynomialApproximation {
1.0E-15, // threshold ratio of matrix determinant to norm for quadratic approximation (det too low - fail)
this.debugLevel);
}
public double [][] quadraticApproximation(
double [][][] data,
boolean forceLinear, // use linear approximation
......@@ -317,10 +342,10 @@ public class PolynomialApproximation {
thresholdLin, // threshold ratio of matrix determinant to norm for linear approximation (det too low - fail) 11.0E-10 failed where it shouldn't?
thresholdQuad, // threshold ratio of matrix determinant to norm for quadratic approximation (det too low - fail)
debugLevel);
}
public double [][] quadraticApproximation(
double [][][] data,
boolean forceLinear, // use linear approximation
......@@ -333,9 +358,9 @@ public class PolynomialApproximation {
/* ix, iy - the location of the point with maximal value. We'll approximate the vicinity of that maximum using a
* second degree polynomial:
Z(x,y)~=A*x^2+B*y^2+C*x*y+D*x+E*y+F
by minimizing sum of squared differenceS00between the actual (Z(x,uy)) and approximated values.
by minimizing sum of squared differenceS00between the actual (Z(x,uy)) and approximated values.
and then find the maximum on the approximated surface. Here iS00the math:
Z(x,y)~=A*x^2+B*y^2+C*x*y+D*x+E*y+F
minimizing squared error, using W(x,y) aS00weight function
......@@ -402,18 +427,18 @@ public class PolynomialApproximation {
mDampingLin = new Matrix(3,3);
for (int i = 0; i < 3; i++){
int j = damping.length + i - 3;
if (j >= 0) mDampingLin.set(i,i,damping[j]);
if (j >= 0) mDampingLin.set(i,i,damping[j]);
}
if (!forceLinear) {
mDampingQuad = new Matrix(6,6);
for (int i = 0; i < 6; i++){
int j = damping.length + i - 6;
if (j >= 0) mDampingQuad.set(i,i,damping[j]);
if (j >= 0) mDampingQuad.set(i,i,damping[j]);
}
}
}
int zDim=data[0][1].length;
int zDim=data[0][1].length;
double w,z,x,x2,x3,x4,y,y2,y3,y4,wz;
int i,j,n=0;
......@@ -477,7 +502,7 @@ public class PolynomialApproximation {
SZ02[j]+=wz*y2;
}
}
}
}
//need to decide if there is enough data for linear and quadratic
......@@ -486,7 +511,7 @@ public class PolynomialApproximation {
{S11,S02,S01},
{S10,S01,S00}};
Matrix mLin=new Matrix (mAarrayL);
if (mDampingLin != null){
mLin.plusEquals(mDampingLin);
}
......@@ -516,7 +541,7 @@ public class PolynomialApproximation {
ABCDEF[i]= mLin.solve(Z).getRowPackedCopy();
}
if (forceLinear) return ABCDEF;
// quote try quadratic approximation
// quote try quadratic approximation
double [][] mAarrayQ= {
{S40,S22,S31,S30,S21,S20},
{S22,S04,S13,S12,S03,S02},
......@@ -528,7 +553,7 @@ public class PolynomialApproximation {
if (mDampingQuad != null){
mQuad.plusEquals(mDampingQuad);
}
if (debugLevel>3) {
System.out.println(" n="+n+" det_quad="+mQuad.det()+" norm_quad="+normMatix(mAarrayQ)+" data.length="+data.length);
mQuad.print(10,5);
......@@ -557,7 +582,7 @@ public class PolynomialApproximation {
return ABCDEF;
}
// calcualte "volume" made of the matrix row-vectors, placed orthogonally
// to be compared to determinant
// to be compared to determinant
public double normMatix(double [][] a) {
double d,norm=1.0;
for (int i=0;i<a.length;i++) {
......
......@@ -3690,8 +3690,8 @@ public class QuadCLT {
min_corr_selected, // 0.0001; // minimal correlation value to consider valid
clt_parameters.max_corr_sigma,// 1.5; // weights of points around global max to find fractional
clt_parameters.max_corr_radius,
clt_parameters.enhortho_width, // 2; // reduce weight of center correlation pixels from center (0 - none, 1 - center, 2 +/-1 from center)
clt_parameters.enhortho_scale, // 0.2; // multiply center correlation pixels (inside enhortho_width)
// clt_parameters.enhortho_width, // 2; // reduce weight of center correlation pixels from center (0 - none, 1 - center, 2 +/-1 from center)
// clt_parameters.enhortho_scale, // 0.2; // multiply center correlation pixels (inside enhortho_width)
clt_parameters.max_corr_double, // Double pass when masking center of mass to reduce preference for integer values
clt_parameters.corr_mode, // Correlation mode: 0 - integer max, 1 - center of mass, 2 - polynomial
clt_parameters.min_shot, // 10.0; // Do not adjust for shot noise if lower than
......@@ -4766,8 +4766,8 @@ public class QuadCLT {
min_corr_selected, // 0.0001; // minimal correlation value to consider valid
clt_parameters.max_corr_sigma,// 1.5; // weights of points around global max to find fractional
clt_parameters.max_corr_radius,
clt_parameters.enhortho_width, // 2; // reduce weight of center correlation pixels from center (0 - none, 1 - center, 2 +/-1 from center)
clt_parameters.enhortho_scale, // 0.2; // multiply center correlation pixels (inside enhortho_width)
// clt_parameters.enhortho_width, // 2; // reduce weight of center correlation pixels from center (0 - none, 1 - center, 2 +/-1 from center)
// clt_parameters.enhortho_scale, // 0.2; // multiply center correlation pixels (inside enhortho_width)
clt_parameters.max_corr_double, // Double pass when masking center of mass to reduce preference for integer values
clt_parameters.corr_mode, // Correlation mode: 0 - integer max, 1 - center of mass, 2 - polynomial
clt_parameters.min_shot, // 10.0; // Do not adjust for shot noise if lower than
......@@ -7869,8 +7869,8 @@ public class QuadCLT {
min_corr_selected, // 0.0001; // minimal correlation value to consider valid
clt_parameters.max_corr_sigma,// 1.5; // weights of points around global max to find fractional
clt_parameters.max_corr_radius,
clt_parameters.enhortho_width, // 2; // reduce weight of center correlation pixels from center (0 - none, 1 - center, 2 +/-1 from center)
clt_parameters.enhortho_scale, // 0.2; // multiply center correlation pixels (inside enhortho_width)
// clt_parameters.enhortho_width, // 2; // reduce weight of center correlation pixels from center (0 - none, 1 - center, 2 +/-1 from center)
// clt_parameters.enhortho_scale, // 0.2; // multiply center correlation pixels (inside enhortho_width)
clt_parameters.max_corr_double, // Double pass when masking center of mass to reduce preference for integer values
clt_parameters.corr_mode, // Correlation mode: 0 - integer max, 1 - center of mass, 2 - polynomial
clt_parameters.min_shot, // 10.0; // Do not adjust for shot noise if lower than
......@@ -8083,8 +8083,8 @@ public class QuadCLT {
min_corr_selected, // 0.0001; // minimal correlation value to consider valid
clt_parameters.max_corr_sigma,// 1.5; // weights of points around global max to find fractional
clt_parameters.max_corr_radius,
clt_parameters.enhortho_width, // 2; // reduce weight of center correlation pixels from center (0 - none, 1 - center, 2 +/-1 from center)
clt_parameters.enhortho_scale, // 0.2; // multiply center correlation pixels (inside enhortho_width)
// clt_parameters.enhortho_width, // 2; // reduce weight of center correlation pixels from center (0 - none, 1 - center, 2 +/-1 from center)
// clt_parameters.enhortho_scale, // 0.2; // multiply center correlation pixels (inside enhortho_width)
clt_parameters.max_corr_double, // Double pass when masking center of mass to reduce preference for integer values
clt_parameters.corr_mode, // Correlation mode: 0 - integer max, 1 - center of mass, 2 - polynomial
clt_parameters.min_shot, // 10.0; // Do not adjust for shot noise if lower than
......
......@@ -38,8 +38,6 @@ public class SuperTiles{
double bin_near; // bin value (before rounding) matching (min_disparity + step_threshold_near)
double min_disparity;
double max_disparity;
double strength_floor;
double strength_pow;
double stBlurSigma;
int numBins;
double [] bin_centers;
......@@ -51,11 +49,14 @@ public class SuperTiles{
int measSel = 1; // bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
boolean smplMode = true; // Use sample mode (false - regular tile mode)
/*
double strength_floor;
double strength_pow;
int smplSide = 2; // Sample size (side of a square)
int smplNum = 3; // Number after removing worst
double smplRms = 0.1; // Maximal RMS of the remaining tiles in a sample
boolean smplWnd = false; // final boolean smplWnd, // use window functions for the samples
double max_abs_tilt = 2.0; // Maximal absolute tilt in pixels/tile
double max_rel_tilt = 0.2; // Maximal relative tilt in pixels/tile/disparity
double damp_tilt = 0.001; // Damp tilt to handle insufficient (co-linear)data
......@@ -63,8 +64,8 @@ public class SuperTiles{
double transition = 1.0; // Mode transition range (between tilted and maximal disparity)
int far_mode = 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
double far_power = 1.0; // Raise disparity to this power before averaging for far objects
*/
MeasuredLayersFilterParameters mlfp = new MeasuredLayersFilterParameters(); // filter parameters
MeasuredLayers measuredLayers = null;
CLTPass3d cltPass3d;
......@@ -95,22 +96,26 @@ public class SuperTiles{
double step_threshold,
double min_disparity,
double max_disparity,
double strength_floor,
double strength_pow,
double stBlurSigma,
boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
int smplSide, // = 2; // Sample size (side of a square)
int smplNum, // = 3; // Number after removing worst
double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
boolean smplWnd, // use window functions for the samples
double max_abs_tilt, // 2.0; // pix per tile
double max_rel_tilt, // 0.2; // (pix / disparity) per tile
double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
MeasuredLayersFilterParameters mlfp,
// double strength_floor,
// double strength_pow,
// boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
// int smplSide, // = 2; // Sample size (side of a square)
// int smplNum, // = 3; // Number after removing worst
// double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// boolean smplWnd, // use window functions for the samples
// double max_abs_tilt, // 2.0; // pix per tile
// double max_rel_tilt, // 0.2; // (pix / disparity) per tile
// double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
// boolean null_if_none,
int measSel)
......@@ -122,26 +127,23 @@ public class SuperTiles{
this.step_threshold_far = step_threshold;
this.min_disparity = min_disparity;
this.max_disparity = max_disparity;
this.strength_floor = strength_floor;
this.strength_pow = strength_pow;
this.stBlurSigma = stBlurSigma;
this.smplMode = smplMode; // Use sample mode (false - regular tile mode)
this.smplSide = smplSide; // Sample size (side of a square)
this.smplNum = smplNum; // Number after removing worst
this.smplRms = smplRms; // Maximal RMS of the remaining tiles in a sample
this.max_abs_tilt = max_abs_tilt;
this.max_rel_tilt = max_rel_tilt;
this.damp_tilt = damp_tilt;
this.min_tilt_disp = min_tilt_disp;
this.transition = transition;
this.far_mode = far_mode;
this.far_power = far_power;
this.smplWnd = smplWnd; // Use window functions for the samples
this.mlfp = mlfp.clone();
// this.strength_floor = strength_floor;
// this.strength_pow = strength_pow;
// this.smplSide = smplSide; // Sample size (side of a square)
// this.smplNum = smplNum; // Number after removing worst
// this.smplRms = smplRms; // Maximal RMS of the remaining tiles in a sample
// this.max_abs_tilt = max_abs_tilt;
// this.max_rel_tilt = max_rel_tilt;
// this.damp_tilt = damp_tilt;
// this.min_tilt_disp = min_tilt_disp;
// this.transition = transition;
// this.far_mode = far_mode;
// this.far_power = far_power;
// this.smplWnd = smplWnd; // Use window functions for the samples
this.measSel = measSel;
......@@ -190,18 +192,19 @@ public class SuperTiles{
null, // double [] world_plane, // tilt equi-disparity planes to match real world planes (usually horizontal (or null)
null, // boolean [][] tile_sel, // null or per-measurement layer, per-tile selection. For each layer null - do not use, {} - use all
smplMode, // final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
smplSide, // final int smplSide, // = 2; // Sample size (side of a square)
smplNum, // final int smplNum, // = 3; // Number after removing worst
smplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
smplWnd, // final boolean smplWnd, // use window functions for the samples
max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
mlfp,
// smplSide, // final int smplSide, // = 2; // Sample size (side of a square)
// smplNum, // final int smplNum, // = 3; // Number after removing worst
// smplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // final boolean smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
measSel); // calculate and blur supertiles (for all, not just selected?)
if (tileProcessor.globalDebugLevel > 0){
......@@ -431,18 +434,20 @@ public class SuperTiles{
final double [][][][] disparity_strength, // pre-calculated disparity/strength [per super-tile][per-measurement layer][2][tiles] or null
final boolean [][] tile_sel, // null or per-measurement layer, per-tile selection. For each layer null - do not use, {} - use all
final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
final int smplSide, // = 2; // Sample size (side of a square)
final int smplNum, // = 3; // Number after removing worst
final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
final boolean smplWnd, //
final double max_abs_tilt, // 2.0; // pix per tile
final double max_rel_tilt, // 0.2; // (pix / disparity) per tile
final double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
final double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
final double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
final int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
final double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
final MeasuredLayersFilterParameters mlfp,
// final int smplSide, // = 2; // Sample size (side of a square)
// final int smplNum, // = 3; // Number after removing worst
// final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// final boolean smplWnd, //
// final double max_abs_tilt, // 2.0; // pix per tile
// final double max_rel_tilt, // 0.2; // (pix / disparity) per tile
// final double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// final double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// final double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// final int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// final double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
final int measSel) //
{
......@@ -451,33 +456,34 @@ public class SuperTiles{
}
if ((this.disparityHistograms != null) &&
(smplMode == this.smplMode) &&
(smplSide == this.smplSide) &&
(smplNum == this.smplNum) &&
(smplRms == this.smplRms) &&
(max_abs_tilt == this.max_abs_tilt) &&
(max_rel_tilt == this.max_rel_tilt) &&
(damp_tilt == this.damp_tilt) &&
(min_tilt_disp == this.min_tilt_disp) &&
(transition == this.transition) &&
(far_mode == this.far_mode) &&
(far_power == this.far_power) &&
(mlfp.equals(this.mlfp)) &&
// (smplSide == this.smplSide) &&
// (smplNum == this.smplNum) &&
// (smplRms == this.smplRms) &&
// (max_abs_tilt == this.max_abs_tilt) &&
// (max_rel_tilt == this.max_rel_tilt) &&
// (damp_tilt == this.damp_tilt) &&
// (min_tilt_disp == this.min_tilt_disp) &&
// (transition == this.transition) &&
// (far_mode == this.far_mode) &&
// (far_power == this.far_power) &&
(measSel == this.measSel)){
return this.disparityHistograms;
}
this.smplMode = smplMode; // Use sample mode (false - regular tile mode)
this.smplSide = smplSide; // Sample size (side of a square)
this.smplNum = smplNum; // Number after removing worst
this.smplRms = smplRms; // Maximal RMS of the remaining tiles in a sample
this.max_abs_tilt = max_abs_tilt;
this.max_rel_tilt = max_rel_tilt;
this.damp_tilt = damp_tilt;
this.min_tilt_disp = min_tilt_disp;
this.transition = transition;
this.far_mode = far_mode;
this.far_power = far_power;
this.mlfp = mlfp.clone();
// this.smplSide = smplSide; // Sample size (side of a square)
// this.smplNum = smplNum; // Number after removing worst
// this.smplRms = smplRms; // Maximal RMS of the remaining tiles in a sample
// this.max_abs_tilt = max_abs_tilt;
// this.max_rel_tilt = max_rel_tilt;
// this.damp_tilt = damp_tilt;
// this.min_tilt_disp = min_tilt_disp;
// this.transition = transition;
// this.far_mode = far_mode;
// this.far_power = far_power;
this.measSel = measSel;
......@@ -515,21 +521,22 @@ public class SuperTiles{
stileY, // int stY,
(((tile_sel == null) || (tile_sel[nl].length == 0))? null:tile_sel[nl]), // boolean [] sel_in,
// null, // boolean [] sel_in,
strength_floor, // double strength_floor,
strength_pow, // double strength_pow,
smplSide, // int smplSide, // = 2; // Sample size (side of a square)
smplNum, //int smplNum, // = 3; // Number after removing worst (should be >1)
smplRms, //double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
smplWnd,
max_abs_tilt, // = 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // = 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // = 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // = 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // = 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // = 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // = 1.0; // Raise disparity to this power before averaging for far objects
mlfp,
// strength_floor, // double strength_floor,
// strength_pow, // double strength_pow,
// smplSide, // int smplSide, // = 2; // Sample size (side of a square)
// smplNum, //int smplNum, // = 3; // Number after removing worst (should be >1)
// smplRms, //double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd,
// max_abs_tilt, // = 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // = 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // = 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // = 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // = 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // = 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // = 1.0; // Raise disparity to this power before averaging for far objects
true, // boolean null_if_none);
-1); // int debugLevel
......@@ -540,8 +547,8 @@ public class SuperTiles{
stileY, // int stY,
(((tile_sel == null) || (tile_sel[nl].length == 0))? null:tile_sel[nl]), // boolean [] sel_in,
// null, // boolean [] sel_in,
strength_floor, // double strength_floor,
strength_pow, // double strength_pow,
mlfp.strength_floor, // double strength_floor,
mlfp.strength_pow, // double strength_pow,
true); // boolean null_if_none);
}
} else {
......@@ -625,18 +632,19 @@ public class SuperTiles{
disparity_strength, // pre-calculated disparity/strength [per super-tile][per-measurement layer][2][tiles] or null
tile_sel, // boolean [][] tile_sel, // null or per-measurement layer, per-tile selection. For each layer null - do not use, {} - use all
this.smplMode, // final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
this.smplSide, // final int smplSide, // = 2; // Sample size (side of a square)
this.smplNum, // final int smplNum, // = 3; // Number after removing worst
this.smplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
this.smplWnd, // final boolean smplWnd, // use window functions for the samples
this.max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
this.max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
this.damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
this.min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
this.transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
this.far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
this.far_power, // 1.0; // Raise disparity to this power before averaging for far objects
this.mlfp,
// this.smplSide, // final int smplSide, // = 2; // Sample size (side of a square)
// this.smplNum, // final int smplNum, // = 3; // Number after removing worst
// this.smplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// this.smplWnd, // final boolean smplWnd, // use window functions for the samples
// this.max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// this.max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// this.damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// this.min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// this.transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// this.far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// this.far_power, // 1.0; // Raise disparity to this power before averaging for far objects
this.measSel);
final int globalDebugLevel = tileProcessor.globalDebugLevel;
......@@ -647,7 +655,7 @@ public class SuperTiles{
threads[ithread] = new Thread() {
@Override
public void run() {
DoubleGaussianBlur gb=new DoubleGaussianBlur();
// DoubleGaussianBlur gb=new DoubleGaussianBlur();
for (int nsTile = ai.getAndIncrement(); nsTile < maxMinMax.length; nsTile = ai.getAndIncrement()) {
if (disparityHistograms[nsTile] != null) {
double [] dh = disparityHistograms[nsTile];
......@@ -773,18 +781,20 @@ public class SuperTiles{
null, // double [] world_plane, // tilt equi-disparity planes to match real world planes (usually horizontal (or null)
null, // boolean [][] tile_sel, // null or per-measurement layer, per-tile selection. For each layer null - do not use, {} - use all
this.smplMode, // final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
this.smplSide, // final int smplSide, // = 2; // Sample size (side of a square)
this.smplNum, // final int smplNum, // = 3; // Number after removing worst
this.smplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
this.smplWnd, // final boolean smplWnd, //
this.max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
this.max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
this.damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
this.min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
this.transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
this.far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
this.far_power, // 1.0; // Raise disparity to this power before averaging for far objects
this.mlfp,
// this.smplSide, // final int smplSide, // = 2; // Sample size (side of a square)
// this.smplNum, // final int smplNum, // = 3; // Number after removing worst
// this.smplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// this.smplWnd, // final boolean smplWnd, //
// this.max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// this.max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// this.damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// this.min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// this.transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// this.far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// this.far_power, // 1.0; // Raise disparity to this power before averaging for far objects
this.measSel); // calculate and blur with the current settings, specified at instantiation
}
......@@ -797,18 +807,19 @@ public class SuperTiles{
final double [][][][] disparity_strength, // pre-calculated disparity/strength [per super-tile][per-measurement layer][2][tiles] or null
boolean [][] tile_sel, // null or per-measurement layer, per-tile selection. For each layer null - do not use, {} - use all
boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
int smplSide, // = 2; // Sample size (side of a square)
int smplNum, // = 3; // Number after removing worst
double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
boolean smplWnd, //
double max_abs_tilt, // 2.0; // pix per tile
double max_rel_tilt, // 0.2; // (pix / disparity) per tile
double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
MeasuredLayersFilterParameters mlfp, // parameters
// int smplSide, // = 2; // Sample size (side of a square)
// int smplNum, // = 3; // Number after removing worst
// double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// boolean smplWnd, //
// double max_abs_tilt, // 2.0; // pix per tile
// double max_rel_tilt, // 0.2; // (pix / disparity) per tile
// double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
int measSel) // bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
{
......@@ -817,18 +828,19 @@ public class SuperTiles{
disparity_strength, // pre-calculated disparity/strength [per super-tile][per-measurement layer][2][tiles] or nullntal (or null)
tile_sel, // boolean [][] tile_sel, // null or per-measurement layer, per-tile selection. For each layer null - do not use, {} - use all
smplMode, // final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
smplSide, // final int smplSide, // = 2; // Sample size (side of a square)
smplNum, // final int smplNum, // = 3; // Number after removing worst
smplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
smplWnd, // final boolean smplWnd, //
max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
mlfp,
// smplSide, // final int smplSide, // = 2; // Sample size (side of a square)
// smplNum, // final int smplNum, // = 3; // Number after removing worst
// smplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // final boolean smplWnd, //
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
measSel); // calculate and blur with the current settings, specified at instantiation
return showDisparityHistogram(disparityHistograms);
......@@ -994,7 +1006,7 @@ public class SuperTiles{
final double minBgDisparity,
final double minBgFract)
{
final double step_disparity = step_near; // TODO: implement
//// final double step_disparity = step_near; // TODO: implement
if (maxMinMax == null) return null;
......@@ -1410,7 +1422,7 @@ public class SuperTiles{
boolean [][][] selections,
TilePlanes.PlaneData [] planes)
{
int num_p = selections.length;
// int num_p = selections.length;
int num_pd = (planes != null) ? (planes.length - LOWEST_PLANE(planes.length)) : 0;
String [] titles = new String [9 * num_pd];
for (int npd = 0; npd < num_pd; npd++){
......@@ -1529,18 +1541,20 @@ public class SuperTiles{
final boolean correct_distortions,
final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
final int smplSide, // = 2; // Sample size (side of a square)
final int smplNum, // = 3; // Number after removing worst
final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
final boolean smplWnd, //
final double max_abs_tilt, // 2.0; // pix per tile
final double max_rel_tilt, // 0.2; // (pix / disparity) per tile
final double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
final double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
final double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
final int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
final double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
final MeasuredLayersFilterParameters mlfp,
// final int smplSide, // = 2; // Sample size (side of a square)
// final int smplNum, // = 3; // Number after removing worst
// final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// final boolean smplWnd, //
// final double max_abs_tilt, // 2.0; // pix per tile
// final double max_rel_tilt, // 0.2; // (pix / disparity) per tile
// final double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// final double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// final double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// final int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// final double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
final int debugLevel,
final int dbg_X,
......@@ -1601,8 +1615,8 @@ public class SuperTiles{
stileX, // int stX,
stileY, // int stY,
null, // boolean [] sel_in,
strength_floor, // double strength_floor,
strength_pow, // double strength_pow,
mlfp.strength_floor, // double strength_floor,
mlfp.strength_pow, // double strength_pow,
true); // boolean null_if_none);
// if failed - keep constant disparity (plane_tilts[ml] = zero_tilts)
......@@ -1649,20 +1663,20 @@ public class SuperTiles{
null, // boolean [] sel_in,
// ((world_plane_norm == null)? zero_tilts: plane_tilts[ml]), // double [] tiltXY, // null - free with limit on both absolute (2.0?) and relative (0.2) values
(floating? null: plane_tilts[ml]), // double [] tiltXY, // null - free with limit on both absolute (2.0?) and relative (0.2) values
strength_floor, // double strength_floor,
strength_pow, // double strength_pow,
smplSide, // int smplSide, // = 2; // Sample size (side of a square)
smplNum, //int smplNum, // = 3; // Number after removing worst (should be >1)
smplRms, //double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// true, // boolean null_if_none);
smplWnd, // boolean smplWnd, //
max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
mlfp,
// strength_floor, // double strength_floor,
// strength_pow, // double strength_pow,
// smplSide, // int smplSide, // = 2; // Sample size (side of a square)
// smplNum, //int smplNum, // = 3; // Number after removing worst (should be >1)
// smplRms, //double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // boolean smplWnd, //
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
true, // boolean null_if_none);
dl);
} else {
......@@ -1671,8 +1685,8 @@ public class SuperTiles{
stileX, // int stX,
stileY, // int stY,
null, // boolean [] sel_in,
strength_floor, // double strength_floor,
strength_pow, // double strength_pow,
mlfp.strength_floor, // double strength_floor,
mlfp.strength_pow, // double strength_pow,
true); // boolean null_if_none);
}
}
......@@ -2058,18 +2072,20 @@ public class SuperTiles{
final boolean correct_distortions,
final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
final int smplSide, // = 2; // Sample size (side of a square)
final int smplNum, // = 3; // Number after removing worst
final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
final boolean smplWnd, // use window functions fro the samples
final double max_abs_tilt, // 2.0; // pix per tile
final double max_rel_tilt, // 0.2; // (pix / disparity) per tile
final double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
final double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
final double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
final int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
final double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
final MeasuredLayersFilterParameters mlfp,
// final int smplSide, // = 2; // Sample size (side of a square)
// final int smplNum, // = 3; // Number after removing worst
// final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// final boolean smplWnd, // use window functions fro the samples
// final double max_abs_tilt, // 2.0; // pix per tile
// final double max_rel_tilt, // 0.2; // (pix / disparity) per tile
// final double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// final double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// final double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// final int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// final double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
final double bin_blur_hor, // Blur disparity histograms for horizontal clusters by this sigma (in bins)
final double bin_blur_vert, // Blur disparity histograms for constant disparity clusters by this sigma (in bins)
......@@ -2148,18 +2164,19 @@ public class SuperTiles{
geometryCorrection, // final GeometryCorrection geometryCorrection,
correct_distortions, // final boolean correct_distortions,
smplMode, // final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
smplSide, // final int smplSide, // = 2; // Sample size (side of a square)
smplNum, // final int smplNum, // = 3; // Number after removing worst
smplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
smplWnd, // final boolean smplWnd, // use window functions for the samples
max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
mlfp,
// smplSide, // final int smplSide, // = 2; // Sample size (side of a square)
// smplNum, // final int smplNum, // = 3; // Number after removing worst
// smplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // final boolean smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
debugLevel,
dbg_X,
......@@ -2172,18 +2189,19 @@ public class SuperTiles{
geometryCorrection, // final GeometryCorrection geometryCorrection,
correct_distortions, // final boolean correct_distortions,
smplMode, // final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
smplSide, // final int smplSide, // = 2; // Sample size (side of a square)
smplNum, // final int smplNum, // = 3; // Number after removing worst
smplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
smplWnd, // final boolean smplWnd, // use window functions for the samples
max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
mlfp,
// smplSide, // final int smplSide, // = 2; // Sample size (side of a square)
// smplNum, // final int smplNum, // = 3; // Number after removing worst
// smplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // final boolean smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
debugLevel,
dbg_X,
......@@ -2421,18 +2439,20 @@ public class SuperTiles{
final boolean correct_distortions,
final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
final int smplSide, // = 2; // Sample size (side of a square)
final int smplNum, // = 3; // Number after removing worst
final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
final boolean smplWnd, // use window functions for the samples
final double max_abs_tilt, // 2.0; // pix per tile
final double max_rel_tilt, // 0.2; // (pix / disparity) per tile
final double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
final double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
final double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
final int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
final double far_power, // 1.0; // Raise disparity to this power before averaging for far objects
final MeasuredLayersFilterParameters mlfp,
// final int smplSide, // = 2; // Sample size (side of a square)
// final int smplNum, // = 3; // Number after removing worst
// final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// final boolean smplWnd, // use window functions for the samples
// final double max_abs_tilt, // 2.0; // pix per tile
// final double max_rel_tilt, // 0.2; // (pix / disparity) per tile
// final double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// final double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// final double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// final int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// final double far_power, // 1.0; // Raise disparity to this power before averaging for far objects
final double plDiscrTolerance, // = 0.4; // Maximal disparity difference from the plane to consider tile
final double plDiscrDispRange, // = 0.6; // Parallel move known planes around original know value for the best overall fit
......@@ -2505,18 +2525,19 @@ public class SuperTiles{
stMeasSel, // final int stMeasSel, // = 1; // Select measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
plDispNorm, // final double dispNorm, // Normalize disparities to the average if above
smplMode, // final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
smplSide, // final int smplSide, // = 2; // Sample size (side of a square)
smplNum, // final int smplNum, // = 3; // Number after removing worst
smplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
smplWnd, // final boolean smplWnd, // use window functions for the samples
max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
mlfp,
// smplSide, // final int smplSide, // = 2; // Sample size (side of a square)
// smplNum, // final int smplNum, // = 3; // Number after removing worst
// smplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // final boolean smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
plDiscrTolerance, // final double disp_tolerance, // maximal disparity difference from the plane to consider tile
plDiscrVarFloor, // final double disp_var_floor, // squared add to variance to calculate reverse flatness (used mostly for single-cell clusters)
......@@ -2622,20 +2643,21 @@ public class SuperTiles{
final boolean plPreferDisparity, // Always start with disparity-most axis (false - lowest eigenvalue)
final GeometryCorrection geometryCorrection,
final boolean correct_distortions,
final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
final int smplSide, // = 2; // Sample size (side of a square)
final int smplNum, // = 3; // Number after removing worst
final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
final boolean smplWnd, // use window functions for the samples
final double max_abs_tilt, // 2.0; // pix per tile
final double max_rel_tilt, // 0.2; // (pix / disparity) per tile
final double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
final double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
final double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
final int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
final double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
final MeasuredLayersFilterParameters mlfp,
// final int smplSide, // = 2; // Sample size (side of a square)
// final int smplNum, // = 3; // Number after removing worst
// final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// final boolean smplWnd, // use window functions for the samples
// final double max_abs_tilt, // 2.0; // pix per tile
// final double max_rel_tilt, // 0.2; // (pix / disparity) per tile
// final double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// final double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// final double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// final int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// final double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
final int debugLevel,
final int dbg_X,
......@@ -2697,22 +2719,25 @@ public class SuperTiles{
plTargetEigen, // double plTargetEigen, // = 0.1; // Remove outliers until main axis eigenvalue (possibly scaled by plDispNorm) gets below
plFractOutliers, // double plFractOutliers, // = 0.3; // Maximal fraction of outliers to remove
plMaxOutliers, // int plMaxOutliers, // = 20; // Maximal number of outliers to remove
strength_floor, // double strength_floor,
strength_pow, // double strength_pow,
// strength_floor, // double strength_floor,
// strength_pow, // double strength_pow,
correct_distortions, // boolean correct_distortions,
smplMode, // boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
smplSide, // int smplSide, // = 2; // Sample size (side of a square)
smplNum, // int smplNum, // = 3; // Number after removing worst
smplRms, // double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
smplWnd, // final boolean smplWnd, // use window functions for the samples
max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
mlfp,
// smplSide, // int smplSide, // = 2; // Sample size (side of a square)
// smplNum, // int smplNum, // = 3; // Number after removing worst
// smplRms, // double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // final boolean smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
dl); // int debugLevel);
......@@ -2749,22 +2774,23 @@ public class SuperTiles{
plTargetEigen, // double plTargetEigen, // = 0.1; // Remove outliers until main axis eigenvalue (possibly scaled by plDispNorm) gets below
0.0, // double plFractOutliers, // = 0.3; // Maximal fraction of outliers to remove
0, // plMaxOutliers, // int plMaxOutliers, // = 20; // Maximal number of outliers to remove
strength_floor, // double strength_floor,
strength_pow, // double strength_pow,
// strength_floor, // double strength_floor,
// strength_pow, // double strength_pow,
correct_distortions, // boolean correct_distortions,
smplMode, // boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
smplSide, // int smplSide, // = 2; // Sample size (side of a square)
smplNum, // int smplNum, // = 3; // Number after removing worst
smplRms, // double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
smplWnd, // final boolean smplWnd, // use window functions for the samples
max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
mlfp,
// smplSide, // int smplSide, // = 2; // Sample size (side of a square)
// smplNum, // int smplNum, // = 3; // Number after removing worst
// smplRms, // double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // final boolean smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
dl - 1); // int debugLevel);
}
......@@ -2842,18 +2868,20 @@ public class SuperTiles{
final boolean correct_distortions,
final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
final int smplSide, // = 2; // Sample size (side of a square)
final int smplNum, // = 3; // Number after removing worst
final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
final boolean smplWnd, // use window functions fro the samples
final double max_abs_tilt, // 2.0; // pix per tile
final double max_rel_tilt, // 0.2; // (pix / disparity) per tile
final double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
final double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
final double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
final int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
final double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
final MeasuredLayersFilterParameters mlfp,
// final int smplSide, // = 2; // Sample size (side of a square)
// final int smplNum, // = 3; // Number after removing worst
// final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// final boolean smplWnd, // use window functions fro the samples
// final double max_abs_tilt, // 2.0; // pix per tile
// final double max_rel_tilt, // 0.2; // (pix / disparity) per tile
// final double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// final double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// final double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// final int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// final double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
final double bin_blur_hor, // Blur disparity histograms for horizontal clusters by this sigma (in bins)
final double bin_blur_vert, // Blur disparity histograms for constant disparity clusters by this sigma (in bins)
......@@ -2890,18 +2918,19 @@ public class SuperTiles{
correct_distortions, // final boolean correct_distortions,
smplMode, // final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
smplSide, // final int smplSide, // = 2; // Sample size (side of a square)
smplNum, // final int smplNum, // = 3; // Number after removing worst
smplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
smplWnd, // final boolean smplWnd, // use window functions fro the samples
max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
mlfp,
// smplSide, // final int smplSide, // = 2; // Sample size (side of a square)
// smplNum, // final int smplNum, // = 3; // Number after removing worst
// smplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // final boolean smplWnd, // use window functions fro the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
bin_blur_hor, // final double bin_blur_hor, // Blur disparity histograms for horizontal clusters by this sigma (in bins)
bin_blur_vert, // final double bin_blur_vert, // Blur disparity histograms for constant disparity clusters by this sigma (in bins)
......@@ -2928,18 +2957,19 @@ public class SuperTiles{
correct_distortions, // final boolean correct_distortions,
smplMode, // final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
smplSide, // final int smplSide, // = 2; // Sample size (side of a square)
smplNum, // final int smplNum, // = 3; // Number after removing worst
smplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
smplWnd, // final boolean smplWnd, // use window functions fro the samples
max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
mlfp,
// smplSide, // final int smplSide, // = 2; // Sample size (side of a square)
// smplNum, // final int smplNum, // = 3; // Number after removing worst
// smplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // final boolean smplWnd, // use window functions fro the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
debugLevel, // final int debugLevel,
dbg_X, // final int dbg_X,
......@@ -2960,18 +2990,19 @@ public class SuperTiles{
correct_distortions, // final boolean correct_distortions,
smplMode, // final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
smplSide, // final int smplSide, // = 2; // Sample size (side of a square)
smplNum, // final int smplNum, // = 3; // Number after removing worst
smplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
smplWnd, // final boolean smplWnd, // use window functions for the samples
max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
mlfp,
// smplSide, // final int smplSide, // = 2; // Sample size (side of a square)
// smplNum, // final int smplNum, // = 3; // Number after removing worst
// smplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // final boolean smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
debugLevel + 0, // 1, // + 2, // 1, // final int debugLevel,
dbg_X, // final int dbg_X,
......@@ -3033,18 +3064,20 @@ public class SuperTiles{
final boolean correct_distortions,
final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
final int smplSide, // = 2; // Sample size (side of a square)
final int smplNum, // = 3; // Number after removing worst
final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
final boolean smplWnd, // use window functions for the samples
final double max_abs_tilt, // 2.0; // pix per tile
final double max_rel_tilt, // 0.2; // (pix / disparity) per tile
final double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
final double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
final double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
final int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
final double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
final MeasuredLayersFilterParameters mlfp,
// final int smplSide, // = 2; // Sample size (side of a square)
// final int smplNum, // = 3; // Number after removing worst
// final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// final boolean smplWnd, // use window functions for the samples
// final double max_abs_tilt, // 2.0; // pix per tile
// final double max_rel_tilt, // 0.2; // (pix / disparity) per tile
// final double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// final double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// final double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// final int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// final double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
final double plDiscrTolerance, // = 0.4; // Maximal disparity difference from the plane to consider tile
final double plDiscrDispRange, // = 0.6; // Parallel move known planes around original know value for the best overall fit
......@@ -3084,18 +3117,19 @@ public class SuperTiles{
correct_distortions, // final boolean correct_distortions,
smplMode, // final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
smplSide, // final int smplSide, // = 2; // Sample size (side of a square)
smplNum, // final int smplNum, // = 3; // Number after removing worst
smplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
smplWnd, // final boolean smplWnd, // use window functions for the samples
max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
mlfp,
// smplSide, // final int smplSide, // = 2; // Sample size (side of a square)
// smplNum, // final int smplNum, // = 3; // Number after removing worst
// smplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // final boolean smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
plDiscrTolerance, //final double plDiscrTolerance, // = 0.4; // Maximal disparity difference from the plane to consider tile
plDiscrDispRange, // final double plDiscrDispRange, // = 0.6; // Parallel move known planes around original know value for the best overall fit
......@@ -3131,18 +3165,19 @@ public class SuperTiles{
correct_distortions, // final boolean correct_distortions,
smplMode, // final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
smplSide, // final int smplSide, // = 2; // Sample size (side of a square)
smplNum, // final int smplNum, // = 3; // Number after removing worst
smplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
smplWnd, // final boolean smplWnd, // use window functions for the samples
max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
mlfp,
// smplSide, // final int smplSide, // = 2; // Sample size (side of a square)
// smplNum, // final int smplNum, // = 3; // Number after removing worst
// smplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // final boolean smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
debugLevel, // final int debugLevel,
dbg_X, // final int dbg_X,
......@@ -3163,18 +3198,19 @@ public class SuperTiles{
correct_distortions, // final boolean correct_distortions,
smplMode, // final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
smplSide, // final int smplSide, // = 2; // Sample size (side of a square)
smplNum, // final int smplNum, // = 3; // Number after removing worst
smplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
smplWnd, // final boolean smplWnd, // use window functions for the samples
max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
mlfp,
// smplSide, // final int smplSide, // = 2; // Sample size (side of a square)
// smplNum, // final int smplNum, // = 3; // Number after removing worst
// smplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // final boolean smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
debugLevel, // + 2, // 1, // final int debugLevel,
dbg_X, // final int dbg_X,
......@@ -6464,22 +6500,23 @@ public class SuperTiles{
dispNorm, // double dispNorm, // Normalize disparities to the average if above
min_weight, // double min_weight,
min_tiles, // int min_tiles,
strength_floor, // double strength_floor,
strength_pow, // double strength_pow,
// strength_floor, // double strength_floor,
// strength_pow, // double strength_pow,
//OK?
smplMode,
smplSide,
smplNum,
smplRms,
smplWnd,
max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
mlfp,
// smplSide,
// smplNum,
// smplRms,
// smplWnd,
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
dl - 2); // int debugLevel)
if (disp_strength == null) {
......@@ -6495,23 +6532,24 @@ public class SuperTiles{
dispNorm, // double dispNorm, // Normalize disparities to the average if above
min_weight, // double min_weight,
min_tiles, // int min_tiles,
strength_floor, // double strength_floor,
strength_pow, // double strength_pow,
// strength_floor, // double strength_floor,
// strength_pow, // double strength_pow,
//OK?
smplMode,
smplSide,
smplNum,
smplRms,
mlfp,
// smplSide,
// smplNum,
// smplRms,
smplWnd, // was not here
// smplWnd, // was not here
max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
dl - 2); // int debugLevel)
......@@ -6641,22 +6679,23 @@ public class SuperTiles{
final double targetEigen, // = 0.1; // Remove outliers until main axis eigenvalue (possibly scaled by plDispNorm) gets below
final double fractOutliers, // = 0.3; // Maximal fraction of outliers to remove
final int maxOutliers, // = 20; // Maximal number of outliers to remove
final double strength_floor,
final double strength_pow,
// final double strength_floor,
// final double strength_pow,
final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
final int smplSide, // = 2; // Sample size (side of a square)
final int smplNum, // = 3; // Number after removing worst
final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
final boolean smplWnd, // use window functions for the samples
final double max_abs_tilt, // 2.0; // pix per tile
final double max_rel_tilt, // 0.2; // (pix / disparity) per tile
final double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
final double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
final double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
final int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
final double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
final MeasuredLayersFilterParameters mlfp,
// final int smplSide, // = 2; // Sample size (side of a square)
// final int smplNum, // = 3; // Number after removing worst
// final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// final boolean smplWnd, // use window functions for the samples
// final double max_abs_tilt, // 2.0; // pix per tile
// final double max_rel_tilt, // 0.2; // (pix / disparity) per tile
// final double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// final double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// final double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// final int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// final double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
final int debugLevel,
final int dbg_X,
......@@ -6778,8 +6817,9 @@ public class SuperTiles{
stx, // int stX,
sty, // int stY,
null, // boolean [] sel_in,
strength_floor, // double strength_floor,
strength_pow, // double strength_pow,
mlfp,
// strength_floor, // double strength_floor,
// strength_pow, // double strength_pow,
true); // boolean null_if_none);
if (dbg_disp_str != null){
boolean [] dbg_msel = planes[nsTile][np].getMeasSelection(ml);
......@@ -6809,18 +6849,19 @@ public class SuperTiles{
non_exclusive, // boolean non_exclusive,
use_other_planes, // boolean use_other_planes,
smplMode,
smplSide,
smplNum,
smplRms,
smplWnd, // final boolean smplWnd, // use window functions for the samples
max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
mlfp,
// smplSide,
// smplNum,
// smplRms,
// smplWnd, // final boolean smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
measSel, // int measSel, // Select measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
allow_parallel, //boolean allow_parallel,
......@@ -6853,22 +6894,23 @@ public class SuperTiles{
dispNorm, // double dispNorm, // Normalize disparities to the average if above
min_weight, // double min_weight,
min_tiles, // int min_tiles,
strength_floor, // double strength_floor,
strength_pow, // double strength_pow,
// strength_floor, // double strength_floor,
// strength_pow, // double strength_pow,
// OK?
smplMode,
smplSide,
smplNum,
smplRms,
smplWnd, // final boolean smplWnd, // use window functions for the samples
max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
mlfp,
// smplSide,
// smplNum,
// smplRms,
// smplWnd, // final boolean smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
dl); // int debugLevel)
if (disp_strength == null) break;
......@@ -6898,22 +6940,23 @@ public class SuperTiles{
dispNorm, // double dispNorm, // Normalize disparities to the average if above
min_weight, // double min_weight,
min_tiles, // int min_tiles,
strength_floor, // double strength_floor,
strength_pow, // double strength_pow,
// strength_floor, // double strength_floor,
// strength_pow, // double strength_pow,
// OK?
smplMode,
smplSide,
smplNum,
smplRms,
smplWnd, // was not here: final boolean smplWnd, // use window functions for the samples
max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
mlfp,
// smplSide,
// smplNum,
// smplRms,
// smplWnd, // was not here: final boolean smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
dl); // int debugLevel)
}
......@@ -7982,8 +8025,9 @@ public class SuperTiles{
for (int ml = 0; ml < numMeasLayers; ml++) if ((stMeasSel & ( 1 << ml)) != 0) {
ds[ml] = measuredLayers.getDisparityStrengthML (
ml, // int num_layer,
this.strength_floor, // double strength_floor,
this.strength_pow); // double strength_pow)
this.mlfp);
// this.mlfp.strength_floor, // double strength_floor,
// this.mlfp.strength_pow); // double strength_pow)
}
return ds;
}
......
......@@ -83,25 +83,28 @@ public class TilePlanes {
MeasuredLayers measuredLayers = null;
boolean [][] measuredSelection = null; // [number of layers in measuredLayers][2*superTileSize * 2*superTileSize]
boolean [] sel_mask = null; // selection mask - may be used for splitting plane along a line - each half can have mask
double measured_strength_pow = 1.0;
double strength_floor = 0.0;
double min_weight = 0.0; // minimal weight of the ellipsoid
int min_tiles = 10;
double dispNorm = 5.0; // Normalize disparities to the average if above
boolean smplMode = true; // Use sample mode (false - regular tile mode)
boolean smplMode = true; // Use sample mode (false - regular tile mode)
int smplSide = 2; // Sample size (side of a square)
int smplNum = 3; // Number after removing worst
double smplRms = 0.1; // Maximal RMS of the remaining tiles in a sample
boolean smplWnd = false; // Use sample mode (false - regular tile mode)
MeasuredLayersFilterParameters mlfp = new MeasuredLayersFilterParameters(); // filter parameters
double max_abs_tilt = 2.0; // Maximal absolute tilt in pixels/tile
double max_rel_tilt = 0.2; // Maximal relative tilt in pixels/tile/disparity
double damp_tilt = 0.001; // Damp tilt to handle insufficient (co-linear)data
double min_tilt_disp = 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
double transition = 1.0; // Mode transition range (between tilted and maximal disparity)
int far_mode = 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
double far_power = 1.0; // Raise disparity to this power before averaging for far objects
// double measured_strength_pow = 1.0;
// double strength_floor = 0.0;
// int smplSide = 2; // Sample size (side of a square)
// int smplNum = 3; // Number after removing worst
// double smplRms = 0.1; // Maximal RMS of the remaining tiles in a sample
// boolean smplWnd = false; // Use sample mode (false - regular tile mode)
// double max_abs_tilt = 2.0; // Maximal absolute tilt in pixels/tile
// double max_rel_tilt = 0.2; // Maximal relative tilt in pixels/tile/disparity
// double damp_tilt = 0.001; // Damp tilt to handle insufficient (co-linear)data
// double min_tilt_disp = 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// double transition = 1.0; // Mode transition range (between tilted and maximal disparity)
// int far_mode = 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// double far_power = 1.0; // Raise disparity to this power before averaging for far objects
......@@ -157,25 +160,27 @@ public class TilePlanes {
if (this.sel_mask != null) pd.sel_mask = this.sel_mask.clone();
pd.measured_strength_pow = this.measured_strength_pow;
pd.strength_floor = this.strength_floor;
pd.min_weight = this.min_weight;
pd.min_tiles = this.min_tiles;
pd.dispNorm = this.dispNorm;
pd.smplMode = this.smplMode;
pd.smplSide = this.smplSide;
pd.smplNum = this.smplNum;
pd.smplRms = this.smplRms;
pd.max_abs_tilt = this.max_abs_tilt;
pd.max_rel_tilt = this.max_rel_tilt;
pd.damp_tilt = this.damp_tilt;
pd.min_tilt_disp = this.min_tilt_disp;
pd.transition = this.transition;
pd.far_mode = this.far_mode;
pd.far_power = this.far_power;
pd.mlfp = this.mlfp.clone();
// pd.measured_strength_pow = this.measured_strength_pow;
// pd.strength_floor = this.strength_floor;
// pd.smplSide = this.smplSide;
// pd.smplNum = this.smplNum;
// pd.smplRms = this.smplRms;
// pd.max_abs_tilt = this.max_abs_tilt;
// pd.max_rel_tilt = this.max_rel_tilt;
// pd.damp_tilt = this.damp_tilt;
// pd.min_tilt_disp = this.min_tilt_disp;
// pd.transition = this.transition;
// pd.far_mode = this.far_mode;
// pd.far_power = this.far_power;
pd.preferDisparity = this.preferDisparity;
......@@ -764,18 +769,20 @@ public class TilePlanes {
boolean non_exclusive,
boolean use_other_planes,
boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
int smplSide, // = 2; // Sample size (side of a square)
int smplNum, // = 3; // Number after removing worst
double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
boolean smplWnd, // use window functions for the samples
double max_abs_tilt, // 2.0; // pix per tile
double max_rel_tilt, // 0.2; // (pix / disparity) per tile
double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
MeasuredLayersFilterParameters mlfp,
// int smplSide, // = 2; // Sample size (side of a square)
// int smplNum, // = 3; // Number after removing worst
// double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// boolean smplWnd, // use window functions for the samples
// double max_abs_tilt, // 2.0; // pix per tile
// double max_rel_tilt, // 0.2; // (pix / disparity) per tile
// double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
int measSel, // Select measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
boolean allow_parallel,
......@@ -813,19 +820,20 @@ public class TilePlanes {
getSTileXY()[0], // int stX,
getSTileXY()[1], // int stY,
(single_plane ? null : measuredSelection[nl]), // boolean [] sel_in,
strength_floor,
measured_strength_pow, //
smplSide, // = 2; // Sample size (side of a square)
smplNum, // = 3; // Number after removing worst
smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
smplWnd, // use window functions for the samples
max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
mlfp,
// strength_floor,
// measured_strength_pow, //
// smplSide, // = 2; // Sample size (side of a square)
// smplNum, // = 3; // Number after removing worst
// smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
true, // boolean null_if_none)
debugLevel);
} else {
......@@ -834,8 +842,9 @@ public class TilePlanes {
getSTileXY()[0], // int stX,
getSTileXY()[1], // int stY,
(single_plane ? null : measuredSelection[nl]), // boolean [] sel_in,
strength_floor, // double strength_floor,
measured_strength_pow, // double strength_pow,
mlfp,
// strength_floor, // double strength_floor,
// measured_strength_pow, // double strength_pow,
true); // boolean null_if_none);
}
if (disp_strength[nl] != null) {
......@@ -946,19 +955,20 @@ public class TilePlanes {
getSTileXY()[0], // int stX,
getSTileXY()[1], // int stY,
null, // boolean [] sel_in,
strength_floor,
measured_strength_pow, //
smplSide, // = 2; // Sample size (side of a square)
smplNum, // = 3; // Number after removing worst
smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
smplWnd, // use window functions for the samples
max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
mlfp,
// strength_floor,
// measured_strength_pow, //
// smplSide, // = 2; // Sample size (side of a square)
// smplNum, // = 3; // Number after removing worst
// smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
true, // boolean null_if_none)
debugLevel);
} else {
......@@ -967,8 +977,9 @@ public class TilePlanes {
getSTileXY()[0], // int stX,
getSTileXY()[1], // int stY,
null, // boolean [] sel_in,
strength_floor, // double strength_floor,
measured_strength_pow, // double strength_pow,
mlfp,
// strength_floor, // double strength_floor,
// measured_strength_pow, // double strength_pow,
true); // boolean null_if_none);
}
//disp_strength[nl] = measuredLayers.getDisparityStrengthML(
......@@ -1204,20 +1215,21 @@ public class TilePlanes {
sTileXY[0], // int stX,
sTileXY[1], // int stY,
null, // measuredSelection[nl], // boolean [] sel_in,
strength_floor,
measured_strength_pow, //
smplSide, // = 2; // Sample size (side of a square)
smplNum, // = 3; // Number after removing worst
smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
smplWnd, // use window functions for the samples
max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
this.mlfp,
// strength_floor,
// measured_strength_pow, //
// smplSide, // = 2; // Sample size (side of a square)
// smplNum, // = 3; // Number after removing worst
// smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
true, // boolean null_if_none)
debugLevel);
......@@ -1228,8 +1240,9 @@ public class TilePlanes {
sTileXY[0], // int stX,
sTileXY[1], // int stY,
null, // measuredSelection[nl], // boolean [] sel_in,
strength_floor, //
measured_strength_pow, //
this.mlfp,
// strength_floor, //
// measured_strength_pow, //
true); // boolean null_if_none)
}
}
......@@ -1291,20 +1304,22 @@ public class TilePlanes {
this.dispNorm, // double dispNorm, // Normalize disparities to the average if above
this.min_weight, // double min_weight,
this.min_tiles, // int min_tiles,
strength_floor,
measured_strength_pow, // double strength_pow,
smplMode,
smplSide,
smplNum,
smplRms,
smplWnd, // use window functions for the samples
max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
// strength_floor,
// measured_strength_pow, // double strength_pow,
this.smplMode,
this.mlfp,
// smplSide,
// smplNum,
// smplRms,
// smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
debugLevel-1) != null);
if (!OK){ // restore last selection, re-run getPlaneFromMeas
......@@ -1317,20 +1332,21 @@ public class TilePlanes {
this.dispNorm, // double dispNorm, // Normalize disparities to the average if above
this.min_weight, // double min_weight,
this.min_tiles, // int min_tiles,
strength_floor,
measured_strength_pow, // double strength_pow,
smplMode,
smplSide,
smplNum,
smplRms,
smplWnd, // use window functions for the samples
max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
// strength_floor,
// measured_strength_pow, // double strength_pow,
this.smplMode,
this.mlfp,
// smplSide,
// smplNum,
// smplRms,
// smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
debugLevel-1) != null);
if (!OK) {
System.out.println("This is a BUG in removePlaneOutliers() - run with previous selection and failed");
......@@ -1377,21 +1393,23 @@ public class TilePlanes {
double dispNorm, // Normalize disparities to the average if above
double min_weight,
int min_tiles,
double strength_floor,
double strength_pow,
// double strength_floor,
// double strength_pow,
boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
int smplSide, // = 2; // Sample size (side of a square)
int smplNum, // = 3; // Number after removing worst
double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
boolean smplWnd, // use window functions for the samples
double max_abs_tilt, // 2.0; // pix per tile
double max_rel_tilt, // 0.2; // (pix / disparity) per tile
double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
MeasuredLayersFilterParameters mlfp,
// int smplSide, // = 2; // Sample size (side of a square)
// int smplNum, // = 3; // Number after removing worst
// double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// boolean smplWnd, // use window functions for the samples
// double max_abs_tilt, // 2.0; // pix per tile
// double max_rel_tilt, // 0.2; // (pix / disparity) per tile
// double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
int debugLevel)
{
......@@ -1405,24 +1423,26 @@ public class TilePlanes {
tile_sel = this.measuredSelection;
}
this.strength_floor = strength_floor;
this.measured_strength_pow = strength_pow;
// this.strength_floor = strength_floor;
// this.measured_strength_pow = strength_pow;
this.min_weight = min_weight;
this.min_tiles = min_tiles;
this.dispNorm = dispNorm;
this.smplWnd = smplWnd; // use window functions for the samples
// this.smplWnd = smplWnd; // use window functions for the samples
this.smplMode = smplMode; // = true; // Use sample mode (false - regular tile mode)
this.smplSide = smplSide; // = 2; // Sample size (side of a square)
this.smplNum = smplNum; // = 3; // Number after removing worst
this.smplRms = smplRms; // = 0.1; // Maximal RMS of the remaining tiles in a sample
// this.smplSide = smplSide; // = 2; // Sample size (side of a square)
// this.smplNum = smplNum; // = 3; // Number after removing worst
// this.smplRms = smplRms; // = 0.1; // Maximal RMS of the remaining tiles in a sample
// this.max_abs_tilt = max_abs_tilt;
// this.max_rel_tilt = max_rel_tilt;
// this.damp_tilt = damp_tilt;
// this.min_tilt_disp = min_tilt_disp;
// this.transition = transition;
// this.far_mode = far_mode;
// this.far_power = far_power;
this.max_abs_tilt = max_abs_tilt;
this.max_rel_tilt = max_rel_tilt;
this.damp_tilt = damp_tilt;
this.min_tilt_disp = min_tilt_disp;
this.transition = transition;
this.far_mode = far_mode;
this.far_power = far_power;
this.mlfp = mlfp.clone();
if (debugLevel > 2){
......@@ -1443,19 +1463,20 @@ public class TilePlanes {
sTileXY[1], // int stY,
((tile_sel[nl].length == 0)? null:tile_sel[nl]), // boolean [] sel_in,
//tile_sel[nl], // boolean [] sel_in,
strength_floor,
strength_pow, //
smplSide, // = 2; // Sample size (side of a square)
smplNum, // = 3; // Number after removing worst
smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
smplWnd, // final boolean smplWnd, // use window functions fro the samples
max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
mlfp,
// strength_floor,
// strength_pow, //
// smplSide, // = 2; // Sample size (side of a square)
// smplNum, // = 3; // Number after removing worst
// smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // final boolean smplWnd, // use window functions fro the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
true, // boolean null_if_none)
debugLevel);
}
......@@ -1483,7 +1504,7 @@ public class TilePlanes {
sTileXY[0], // int stX,
sTileXY[1], // int stY,
((tile_sel[nl].length == 0)? null:tile_sel[nl]), // boolean [] sel_in,
strength_floor,
mlfp.strength_floor,
true); // boolean null_if_none)
} else {
tile_sel[nl] = measuredLayers.getSupertileSelection(
......@@ -1493,7 +1514,7 @@ public class TilePlanes {
((tile_sel[nl].length == 0)? null:tile_sel[nl]), // boolean [] sel_in,
disp_far, // double disp_far,
disp_near, // double disp_near,
strength_floor,
mlfp.strength_floor,
true); // boolean null_if_none)
}
......@@ -1504,8 +1525,9 @@ public class TilePlanes {
sTileXY[0], // int stX,
sTileXY[1], // int stY,
tile_sel[nl], // boolean [] sel_in,
strength_floor,
strength_pow, //
mlfp,
// strength_floor,
// strength_pow, //
true); // boolean null_if_none)
sw += MeasuredLayers.getSumStrength(disp_str[nl]);
}
......@@ -1711,23 +1733,26 @@ public class TilePlanes {
double dispNorm, // Normalize disparities to the average if above
double min_weight,
int min_tiles,
double strength_floor,
double strength_pow,
// double strength_floor,
// double strength_pow,
boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
int smplSide, // = 2; // Sample size (side of a square)
int smplNum, // = 3; // Number after removing worst
double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
MeasuredLayersFilterParameters mlfp,
/* was not here */boolean smplWnd, // use window functions for the samples
// int smplSide, // = 2; // Sample size (side of a square)
// int smplNum, // = 3; // Number after removing worst
// double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
double max_abs_tilt, // 2.0; // pix per tile
double max_rel_tilt, // 0.2; // (pix / disparity) per tile
double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
///* was not here */boolean smplWnd, // use window functions for the samples
// double max_abs_tilt, // 2.0; // pix per tile
// double max_rel_tilt, // 0.2; // (pix / disparity) per tile
// double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
int debugLevel)
{
......@@ -1741,25 +1766,26 @@ public class TilePlanes {
tile_sel = this.measuredSelection;
}
this.strength_floor = strength_floor;
this.measured_strength_pow = strength_pow;
// this.strength_floor = strength_floor;
// this.measured_strength_pow = strength_pow;
this.min_weight = min_weight;
this.min_tiles = min_tiles;
this.dispNorm = dispNorm;
this.smplMode = smplMode; // = true; // Use sample mode (false - regular tile mode)
this.smplSide = smplSide; // = 2; // Sample size (side of a square)
this.smplNum = smplNum; // = 3; // Number after removing worst
this.smplRms = smplRms; // = 0.1; // Maximal RMS of the remaining tiles in a sample
// this.smplSide = smplSide; // = 2; // Sample size (side of a square)
// this.smplNum = smplNum; // = 3; // Number after removing worst
// this.smplRms = smplRms; // = 0.1; // Maximal RMS of the remaining tiles in a sample
this.smplWnd = smplWnd; // was not here !
// this.smplWnd = smplWnd; // was not here !
this.max_abs_tilt = max_abs_tilt;
this.max_rel_tilt = max_rel_tilt;
this.damp_tilt = damp_tilt;
this.min_tilt_disp = min_tilt_disp;
this.transition = transition;
this.far_mode = far_mode;
this.far_power = far_power;
// this.max_abs_tilt = max_abs_tilt;
// this.max_rel_tilt = max_rel_tilt;
// this.damp_tilt = damp_tilt;
// this.min_tilt_disp = min_tilt_disp;
// this.transition = transition;
// this.far_mode = far_mode;
// this.far_power = far_power;
this.mlfp = mlfp.clone();
if (debugLevel > 2){
System.out.println("getWorldPlaneFromMeas()");
......@@ -1780,19 +1806,20 @@ public class TilePlanes {
sTileXY[1], // int stY,
((tile_sel[nl].length == 0)? null:tile_sel[nl]), // boolean [] sel_in,
//tile_sel[nl], // boolean [] sel_in,
strength_floor,
strength_pow, //
smplSide, // = 2; // Sample size (side of a square)
smplNum, // = 3; // Number after removing worst
smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
/*was using this. */ smplWnd, // use window functions for the samples
max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
mlfp,
// strength_floor,
// strength_pow, //
// smplSide, // = 2; // Sample size (side of a square)
// smplNum, // = 3; // Number after removing worst
// smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
///*was using this. */ smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
true, // boolean null_if_none)
debugLevel);
}
......@@ -1820,7 +1847,7 @@ public class TilePlanes {
sTileXY[0], // int stX,
sTileXY[1], // int stY,
((tile_sel[nl].length == 0)? null:tile_sel[nl]), // boolean [] sel_in,
strength_floor,
mlfp.strength_floor,
true); // boolean null_if_none)
} else {
tile_sel[nl] = measuredLayers.getSupertileSelection(
......@@ -1830,7 +1857,7 @@ public class TilePlanes {
((tile_sel[nl].length == 0)? null:tile_sel[nl]), // boolean [] sel_in,
disp_far, // double disp_far,
disp_near, // double disp_near,
strength_floor,
mlfp.strength_floor,
true); // boolean null_if_none)
}
......@@ -1841,8 +1868,9 @@ public class TilePlanes {
sTileXY[0], // int stX,
sTileXY[1], // int stY,
tile_sel[nl], // boolean [] sel_in,
strength_floor,
strength_pow, //
mlfp,
// strength_floor,
// strength_pow, //
true); // boolean null_if_none)
sw += MeasuredLayers.getSumStrength(disp_str[nl]);
}
......@@ -3983,22 +4011,25 @@ public class TilePlanes {
double plTargetEigen, // = 0.1; // Remove outliers until main axis eigenvalue (possibly scaled by plDispNorm) gets below
double plFractOutliers, // = 0.3; // Maximal fraction of outliers to remove
int plMaxOutliers, // = 20; // Maximal number of outliers to remove
double strength_floor,
double strength_pow,
// double strength_floor,
// double strength_pow,
boolean correct_distortions,
boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
int smplSide, // = 2; // Sample size (side of a square)
int smplNum, // = 3; // Number after removing worst
double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
boolean smplWnd, // use window functions for the samples
double max_abs_tilt, // 2.0; // pix per tile
double max_rel_tilt, // 0.2; // (pix / disparity) per tile
double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
MeasuredLayersFilterParameters mlfp,
// int smplSide, // = 2; // Sample size (side of a square)
// int smplNum, // = 3; // Number after removing worst
// double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// boolean smplWnd, // use window functions for the samples
// double max_abs_tilt, // 2.0; // pix per tile
// double max_rel_tilt, // 0.2; // (pix / disparity) per tile
// double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
int debugLevel)
{
......@@ -4021,23 +4052,24 @@ public class TilePlanes {
0.0, // double min_weight,
min_tiles, // int min_tiles,
strength_floor, //
strength_pow, // double strength_pow,
// strength_floor, //
// strength_pow, // double strength_pow,
// update !
smplMode,
smplSide,
smplNum,
smplRms,
smplWnd, // use window functions for the samples
max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
mlfp,
// smplSide,
// smplNum,
// smplRms,
// smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
debugLevel) != null); // int debugLevel)
if (OK) {
......@@ -4102,23 +4134,25 @@ public class TilePlanes {
dispNorm, // 0.0, // plDispNorm, // double dispNorm, // Normalize disparities to the average if above
0.0, // double min_weight,
min_tiles, // int min_tiles,
strength_floor, //
strength_pow, // double strength_pow,
// strength_floor, //
// strength_pow, // double strength_pow,
// update !
smplMode,
smplSide,
smplNum,
smplRms,
mlfp,
// smplSide,
// smplNum,
// smplRms,
smplWnd, // use window functions for the samples
// smplWnd, // use window functions for the samples
max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
debugLevel);
......@@ -4144,18 +4178,20 @@ public class TilePlanes {
final int stMeasSel, // = 1; // Select measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
final int smplSide, // = 2; // Sample size (side of a square)
final int smplNum, // = 3; // Number after removing worst
final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
final boolean smplWnd, // use window functions for the samples
final double max_abs_tilt, // 2.0; // pix per tile
final double max_rel_tilt, // 0.2; // (pix / disparity) per tile
final double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
final double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
final double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
final int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
final double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
final MeasuredLayersFilterParameters mlfp,
// final int smplSide, // = 2; // Sample size (side of a square)
// final int smplNum, // = 3; // Number after removing worst
// final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// final boolean smplWnd, // use window functions for the samples
// final double max_abs_tilt, // 2.0; // pix per tile
// final double max_rel_tilt, // 0.2; // (pix / disparity) per tile
// final double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// final double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// final double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// final int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// final double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
final double max_disp_diff, // maximal disparity difference from the plane to consider tile
final double disp_range, // parallel move known planes around original know value for the best overall fit
......@@ -4267,20 +4303,21 @@ public class TilePlanes {
getSTileXY()[0], // int stX,
getSTileXY()[1], // int stY,
null, // boolean [] sel_in, - use all
strength_floor,
measured_strength_pow, //
smplSide, // = 2; // Sample size (side of a square)
smplNum, // = 3; // Number after removing worst
smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
smplWnd, // use window functions for the samples
max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
mlfp,
// strength_floor,
// measured_strength_pow, //
// smplSide, // = 2; // Sample size (side of a square)
// smplNum, // = 3; // Number after removing worst
// smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
true, // boolean null_if_none)
debugLevel);
......@@ -4290,8 +4327,9 @@ public class TilePlanes {
getSTileXY()[0], // int stX,
getSTileXY()[1], // int stY,
null, // boolean [] sel_in, - use all
strength_floor, // double strength_floor,
measured_strength_pow, // double strength_pow,
mlfp,
// strength_floor, // double strength_floor,
// measured_strength_pow, // double strength_pow,
true); // boolean null_if_none);
}
}
......@@ -4584,18 +4622,19 @@ public class TilePlanes {
final double dispNorm, // Normalize disparities to the average if above
final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
final int smplSide, // = 2; // Sample size (side of a square)
final int smplNum, // = 3; // Number after removing worst
final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
final boolean smplWnd, // use window functions for the samples
final double max_abs_tilt, // 2.0; // pix per tile
final double max_rel_tilt, // 0.2; // (pix / disparity) per tile
final double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
final double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
final double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
final int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
final double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
final MeasuredLayersFilterParameters mlfp,
// final int smplSide, // = 2; // Sample size (side of a square)
// final int smplNum, // = 3; // Number after removing worst
// final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// final boolean smplWnd, // use window functions for the samples
// final double max_abs_tilt, // 2.0; // pix per tile
// final double max_rel_tilt, // 0.2; // (pix / disparity) per tile
// final double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// final double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// final double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// final int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// final double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
final double disp_tolerance, // maximal disparity difference from the plane to consider tile
final double disp_var_floor, // squared add to variance to calculate reverse flatness (used mostly for single-cell clusters)
......@@ -4722,19 +4761,20 @@ public class TilePlanes {
getSTileXY()[0], // int stX,
getSTileXY()[1], // int stY,
null, // boolean [] sel_in, - use all
strength_floor,
measured_strength_pow, //
smplSide, // = 2; // Sample size (side of a square)
smplNum, // = 3; // Number after removing worst
smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
smplWnd, // use window functions for the samples
max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
mlfp,
// strength_floor,
// measured_strength_pow, //
// smplSide, // = 2; // Sample size (side of a square)
// smplNum, // = 3; // Number after removing worst
// smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
true, // boolean null_if_none)
debugLevel);
} else {
......@@ -4743,8 +4783,9 @@ public class TilePlanes {
getSTileXY()[0], // int stX,
getSTileXY()[1], // int stY,
null, // boolean [] sel_in, - use all
strength_floor, // double strength_floor,
measured_strength_pow, // double strength_pow,
mlfp,
// strength_floor, // double strength_floor,
// measured_strength_pow, // double strength_pow,
true); // boolean null_if_none);
}
}
......@@ -5511,25 +5552,26 @@ public class TilePlanes {
double [] lap_weights = measuredLayers.getLapWeights1d();
double [][][] disp_strength = new double[measuredLayers.getNumLayers()][][];
for (int ml = 0; ml < disp_strength.length; ml++) if (fg_sel[ml] != null){ // if ((stMeasSel & ( 1 << ml)) != 0) {
if (smplMode) {
if (this.smplMode) {
disp_strength[ml] = measuredLayers.getDisparityStrengthMLTilted( // expensive to calculate (improve removing outlayers
ml, // int num_layer,
getSTileXY()[0], // int stX,
getSTileXY()[1], // int stY,
null, // boolean [] sel_in, - use all
strength_floor,
measured_strength_pow, //
smplSide, // = 2; // Sample size (side of a square)
smplNum, // = 3; // Number after removing worst
smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
smplWnd, // use window functions for the samples
max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
far_power, // 1.0; // Raise disparity to this power before averaging for far objects
this.mlfp,
// strength_floor,
// measured_strength_pow, //
// smplSide, // = 2; // Sample size (side of a square)
// smplNum, // = 3; // Number after removing worst
// smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
true, // boolean null_if_none)
debugLevel);
} else {
......@@ -5538,8 +5580,9 @@ public class TilePlanes {
getSTileXY()[0], // int stX,
getSTileXY()[1], // int stY,
null, // boolean [] sel_in, - use all
strength_floor, // double strength_floor,
measured_strength_pow, // double strength_pow,
this.mlfp,
// strength_floor, // double strength_floor,
// measured_strength_pow, // double strength_pow,
true); // boolean null_if_none);
}
}
......
......@@ -3490,8 +3490,8 @@ public class TileProcessor {
final int [] horVertMod, // +1 - modified by hor correlation, +2 - modified by vert correlation (or null)
final double disparity_far, //
final double disparity_near, //
final double ex_strength, // minimal 4-corr strength to trust tile
final double ex_nstrength, // minimal 4-corr strength divided by channel diff for new (border) tiles
final double ex_strength, // minimal 4-corr strength to trust tile
final double ex_nstrength, // minimal 4-corr strength divided by channel diff for new (border) tiles
final double this_maybe, // maximal strength to ignore as non-background
final double sure_smth, // if 2-nd worst image difference (noise-normalized) exceeds this - do not propagate bgnd
final double super_trust, // If strength exceeds ex_strength * super_trust, do not apply ex_nstrength and plate_ds
......@@ -3514,7 +3514,7 @@ public class TileProcessor {
{
// final double super_trust = 1.6; // If strength exceeds ex_strength * super_trust, do not apply ex_nstrength
final int dbg_tile = 49468; // x = 220, y = 152 (pavement line)
final int dbg_tile = 41030; // x = 206, y = 126 (324*126+206)
final boolean show_scan = show_filter_scan || (debugLevel > 1);
showDoubleFloatArrays sdfa_instance = null;
if ((debugLevel > -2) && ((debugLevel > -1) || show_scan)) sdfa_instance = new showDoubleFloatArrays(); // just for debugging?
......@@ -3539,7 +3539,8 @@ public class TileProcessor {
}
for (int i = 0; i <tlen; i++) if (!Double.isNaN(this_disparity[i])){
if ((debugLevel > 0) && (i==dbg_tile)){
// if ((debugLevel > 0) && (i==dbg_tile)){
if ((debugLevel > -2) && (i==dbg_tile)){
System.out.println("FilterScan(): this_disparity["+i+"] = "+this_disparity[i]+"this_strength["+i+"] = "+this_strength[i]);
}
......@@ -4351,21 +4352,22 @@ public class TileProcessor {
clt_parameters.stStepThreshold, // double step_threshold,
clt_parameters.stMinDisparity, // double min_disparity,
clt_parameters.grow_disp_max, // double max_disparity,
clt_parameters.stFloor, // double strength_floor,
clt_parameters.stPow, // double strength_pow,
// clt_parameters.stFloor, // double strength_floor,
// clt_parameters.stPow, // double strength_pow,
0.0,// NO BLUR double stBlurSigma)
false, //clt_parameters.stSmplMode, // Use sample mode (false - regular tile mode)
clt_parameters.stSmplSide, // Sample size (side of a square)
clt_parameters.stSmplNum, // Number after removing worst
clt_parameters.stSmplRms, // Maximal RMS of the remaining tiles in a sample
clt_parameters.stSmplWnd, // boolean smplWnd, // use window functions for the samples
clt_parameters.fs_max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
clt_parameters.fs_max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
clt_parameters.fs_damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
clt_parameters.fs_min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
clt_parameters.fs_transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
clt_parameters.fs_far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
clt_parameters.fs_far_power, // 1.0; // Raise disparity to this power before averaging for far objects
clt_parameters.mlfp, // filter parameters
// clt_parameters.stSmplSide, // Sample size (side of a square)
// clt_parameters.stSmplNum, // Number after removing worst
// clt_parameters.stSmplRms, // Maximal RMS of the remaining tiles in a sample
// clt_parameters.stSmplWnd, // boolean smplWnd, // use window functions for the samples
// clt_parameters.fs_max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// clt_parameters.fs_max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// clt_parameters.fs_damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// clt_parameters.fs_min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// clt_parameters.fs_transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// clt_parameters.fs_far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// clt_parameters.fs_far_power, // 1.0; // Raise disparity to this power before averaging for far objects
clt_parameters.stMeasSel); // bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
dbg_hist[0] = scan_prev.getSuperTiles().showDisparityHistogram();
......@@ -4375,21 +4377,22 @@ public class TileProcessor {
clt_parameters.stStepThreshold, // double step_threshold,
clt_parameters.stMinDisparity, // double min_disparity,
clt_parameters.grow_disp_max, // double max_disparity,
clt_parameters.stFloor, // double strength_floor,
clt_parameters.stPow, // double strength_pow,
// clt_parameters.stFloor, // double strength_floor,
// clt_parameters.stPow, // double strength_pow,
clt_parameters.stSigma, // with blur double stBlurSigma)
false, //clt_parameters.stSmplMode, // Use sample mode (false - regular tile mode)
clt_parameters.stSmplSide, // Sample size (side of a square)
clt_parameters.stSmplNum, // Number after removing worst
clt_parameters.stSmplRms, // Maximal RMS of the remaining tiles in a sample
clt_parameters.stSmplWnd, // boolean smplWnd, // use window functions for the samples
clt_parameters.fs_max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
clt_parameters.fs_max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
clt_parameters.fs_damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
clt_parameters.fs_min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
clt_parameters.fs_transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
clt_parameters.fs_far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
clt_parameters.fs_far_power, // 1.0; // Raise disparity to this power before averaging for far objects
clt_parameters.mlfp, // filter parameters
// clt_parameters.stSmplSide, // Sample size (side of a square)
// clt_parameters.stSmplNum, // Number after removing worst
// clt_parameters.stSmplRms, // Maximal RMS of the remaining tiles in a sample
// clt_parameters.stSmplWnd, // boolean smplWnd, // use window functions for the samples
// clt_parameters.fs_max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// clt_parameters.fs_max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// clt_parameters.fs_damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// clt_parameters.fs_min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// clt_parameters.fs_transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// clt_parameters.fs_far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// clt_parameters.fs_far_power, // 1.0; // Raise disparity to this power before averaging for far objects
clt_parameters.stMeasSel); // bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
dbg_hist[1] = scan_prev.getSuperTiles().showDisparityHistogram();
......@@ -5152,21 +5155,22 @@ public class TileProcessor {
clt_parameters.stStepThreshold, // double step_threshold,
clt_parameters.stMinDisparity, // double min_disparity,
clt_parameters.grow_disp_max, // double max_disparity,
clt_parameters.stFloor, // double strength_floor,
clt_parameters.stPow, // double strength_pow,
// clt_parameters.stFloor, // double strength_floor,
// clt_parameters.stPow, // double strength_pow,
0.0, // NO BLUR double stBlurSigma)
false, //clt_parameters.stSmplMode, // Use sample mode (false - regular tile mode)
clt_parameters.stSmplSide, // Sample size (side of a square)
clt_parameters.stSmplNum, // Number after removing worst
clt_parameters.stSmplRms, // Maximal RMS of the remaining tiles in a sample
clt_parameters.stSmplWnd, // boolean smplWnd, // use window functions for the samples
clt_parameters.fs_max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
clt_parameters.fs_max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
clt_parameters.fs_damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
clt_parameters.fs_min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
clt_parameters.fs_transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
clt_parameters.fs_far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
clt_parameters.fs_far_power, // 1.0; // Raise disparity to this power before averaging for far objects
clt_parameters.mlfp, // Filter parameters
// clt_parameters.stSmplSide, // Sample size (side of a square)
// clt_parameters.stSmplNum, // Number after removing worst
// clt_parameters.stSmplRms, // Maximal RMS of the remaining tiles in a sample
// clt_parameters.stSmplWnd, // boolean smplWnd, // use window functions for the samples
// clt_parameters.fs_max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// clt_parameters.fs_max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// clt_parameters.fs_damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// clt_parameters.fs_min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// clt_parameters.fs_transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// clt_parameters.fs_far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// clt_parameters.fs_far_power, // 1.0; // Raise disparity to this power before averaging for far objects
clt_parameters.stMeasSel); // bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
dbg_hist[0] = scan_prev.getSuperTiles().showDisparityHistogram();
scan_prev.setSuperTiles(
......@@ -5175,21 +5179,22 @@ public class TileProcessor {
clt_parameters.stStepThreshold, // double step_threshold,
clt_parameters.stMinDisparity, // double min_disparity,
clt_parameters.grow_disp_max, // double max_disparity,
clt_parameters.stFloor, // double strength_floor,
clt_parameters.stPow, // double strength_pow,
// clt_parameters.stFloor, // double strength_floor,
// clt_parameters.stPow, // double strength_pow,
0.0, // NO BLUR double stBlurSigma)
clt_parameters.stSmplMode, // Use sample mode (false - regular tile mode)
clt_parameters.stSmplSide, // Sample size (side of a square)
clt_parameters.stSmplNum, // Number after removing worst
clt_parameters.stSmplRms, // Maximal RMS of the remaining tiles in a sample
clt_parameters.stSmplWnd, // boolean smplWnd, // use window functions for the samples
clt_parameters.fs_max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
clt_parameters.fs_max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
clt_parameters.fs_damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
clt_parameters.fs_min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
clt_parameters.fs_transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
clt_parameters.fs_far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
clt_parameters.fs_far_power, // 1.0; // Raise disparity to this power before averaging for far objects
clt_parameters.mlfp, // Filter parameters
// clt_parameters.stSmplSide, // Sample size (side of a square)
// clt_parameters.stSmplNum, // Number after removing worst
// clt_parameters.stSmplRms, // Maximal RMS of the remaining tiles in a sample
// clt_parameters.stSmplWnd, // boolean smplWnd, // use window functions for the samples
// clt_parameters.fs_max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// clt_parameters.fs_max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// clt_parameters.fs_damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// clt_parameters.fs_min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// clt_parameters.fs_transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// clt_parameters.fs_far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// clt_parameters.fs_far_power, // 1.0; // Raise disparity to this power before averaging for far objects
clt_parameters.stMeasSel); // bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
dbg_hist[1] = scan_prev.getSuperTiles().showDisparityHistogram();
}
......@@ -5201,21 +5206,22 @@ public class TileProcessor {
clt_parameters.stStepThreshold, // double step_threshold,
clt_parameters.stMinDisparity, // double min_disparity,
clt_parameters.grow_disp_max, // double max_disparity,
clt_parameters.stFloor, // double strength_floor,
clt_parameters.stPow, // double strength_pow,
// clt_parameters.stFloor, // double strength_floor,
// clt_parameters.stPow, // double strength_pow,
clt_parameters.stSigma, // with blur double stBlurSigma)
false, //clt_parameters.stSmplMode, // Use sample mode (false - regular tile mode)
clt_parameters.stSmplSide, // Sample size (side of a square)
clt_parameters.stSmplNum, // Number after removing worst
clt_parameters.stSmplRms, // Maximal RMS of the remaining tiles in a sample
clt_parameters.stSmplWnd, // boolean smplWnd, // use window functions for the samples
clt_parameters.fs_max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
clt_parameters.fs_max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
clt_parameters.fs_damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
clt_parameters.fs_min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
clt_parameters.fs_transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
clt_parameters.fs_far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
clt_parameters.fs_far_power, // 1.0; // Raise disparity to this power before averaging for far objects
clt_parameters.mlfp, // Filter parameters
// clt_parameters.stSmplSide, // Sample size (side of a square)
// clt_parameters.stSmplNum, // Number after removing worst
// clt_parameters.stSmplRms, // Maximal RMS of the remaining tiles in a sample
// clt_parameters.stSmplWnd, // boolean smplWnd, // use window functions for the samples
// clt_parameters.fs_max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// clt_parameters.fs_max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// clt_parameters.fs_damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// clt_parameters.fs_min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// clt_parameters.fs_transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// clt_parameters.fs_far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// clt_parameters.fs_far_power, // 1.0; // Raise disparity to this power before averaging for far objects
clt_parameters.stMeasSel); // bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
if (show_st) { // otherwise only blured version is needed
dbg_hist[2] = scan_prev.getSuperTiles().showDisparityHistogram();
......@@ -5237,21 +5243,22 @@ public class TileProcessor {
clt_parameters.stStepThreshold, // double step_threshold,
clt_parameters.stMinDisparity, // double min_disparity,
clt_parameters.grow_disp_max, // double max_disparity,
clt_parameters.stFloor, // double strength_floor,
clt_parameters.stPow, // double strength_pow,
// clt_parameters.stFloor, // double strength_floor,
// clt_parameters.stPow, // double strength_pow,
0.0, // NO BLUR double stBlurSigma)
clt_parameters.stSmplMode, // Use sample mode (false - regular tile mode)
clt_parameters.stSmplSide, // Sample size (side of a square)
clt_parameters.stSmplNum, // Number after removing worst
clt_parameters.stSmplRms, // Maximal RMS of the remaining tiles in a sample
clt_parameters.stSmplWnd, // boolean smplWnd, // use window functions for the samples
clt_parameters.fs_max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
clt_parameters.fs_max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
clt_parameters.fs_damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
clt_parameters.fs_min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
clt_parameters.fs_transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
clt_parameters.fs_far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
clt_parameters.fs_far_power, // 1.0; // Raise disparity to this power before averaging for far objects
clt_parameters.mlfp, // Filter parameters
// clt_parameters.stSmplSide, // Sample size (side of a square)
// clt_parameters.stSmplNum, // Number after removing worst
// clt_parameters.stSmplRms, // Maximal RMS of the remaining tiles in a sample
// clt_parameters.stSmplWnd, // boolean smplWnd, // use window functions for the samples
// clt_parameters.fs_max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// clt_parameters.fs_max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// clt_parameters.fs_damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// clt_parameters.fs_min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// clt_parameters.fs_transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// clt_parameters.fs_far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// clt_parameters.fs_far_power, // 1.0; // Raise disparity to this power before averaging for far objects
clt_parameters.stMeasSel); // bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
}
......@@ -5272,18 +5279,19 @@ public class TileProcessor {
clt_parameters.correct_distortions,
clt_parameters.stSmplMode , // final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
clt_parameters.stSmplSide , // final int smplSide, // = 2; // Sample size (side of a square)
clt_parameters.stSmplNum , // final int smplNum, // = 3; // Number after removing worst
clt_parameters.stSmplRms , // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
clt_parameters.stSmplWnd, // boolean smplWnd, // use window functions for the samples
clt_parameters.fs_max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
clt_parameters.fs_max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
clt_parameters.fs_damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
clt_parameters.fs_min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
clt_parameters.fs_transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
clt_parameters.fs_far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
clt_parameters.fs_far_power, // 1.0; // Raise disparity to this power before averaging for far objects
clt_parameters.mlfp, // Filter parameters
// clt_parameters.stSmplSide , // final int smplSide, // = 2; // Sample size (side of a square)
// clt_parameters.stSmplNum , // final int smplNum, // = 3; // Number after removing worst
// clt_parameters.stSmplRms , // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// clt_parameters.stSmplWnd, // boolean smplWnd, // use window functions for the samples
// clt_parameters.fs_max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// clt_parameters.fs_max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// clt_parameters.fs_damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// clt_parameters.fs_min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// clt_parameters.fs_transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// clt_parameters.fs_far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// clt_parameters.fs_far_power, // 1.0; // Raise disparity to this power before averaging for far objects
clt_parameters.plBlurBinHor, // final double bin_blur_hor, // Blur disparity histograms for horizontal clusters by this sigma (in bins)
clt_parameters.plBlurBinVert, // final double bin_blur_vert, // Blur disparity histograms for constant disparity clusters by this sigma (in bins)
......@@ -5354,18 +5362,19 @@ public class TileProcessor {
clt_parameters.correct_distortions,
clt_parameters.stSmplMode, // final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
clt_parameters.stSmplSide, // final int smplSide, // = 2; // Sample size (side of a square)
clt_parameters.stSmplNum, // final int smplNum, // = 3; // Number after removing worst
clt_parameters.stSmplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
clt_parameters.stSmplWnd, // final boolean smplWnd, // use window functions for the samples
clt_parameters.fs_max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
clt_parameters.fs_max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
clt_parameters.fs_damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
clt_parameters.fs_min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
clt_parameters.fs_transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
clt_parameters.fs_far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
clt_parameters.fs_far_power, // 1.0; // Raise disparity to this power before averaging for far objects
clt_parameters.mlfp, // Filter parameters
// clt_parameters.stSmplSide, // final int smplSide, // = 2; // Sample size (side of a square)
// clt_parameters.stSmplNum, // final int smplNum, // = 3; // Number after removing worst
// clt_parameters.stSmplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// clt_parameters.stSmplWnd, // final boolean smplWnd, // use window functions for the samples
// clt_parameters.fs_max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// clt_parameters.fs_max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// clt_parameters.fs_damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// clt_parameters.fs_min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// clt_parameters.fs_transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// clt_parameters.fs_far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// clt_parameters.fs_far_power, // 1.0; // Raise disparity to this power before averaging for far objects
clt_parameters.plDiscrTolerance, // final double plDiscrTolerance, // = 0.4; // Maximal disparity difference from the plane to consider tile
clt_parameters.plDiscrDispRange, // final double plDiscrDispRange, // = 0.6; // Parallel move known planes around original know value for the best overall fit
......@@ -5473,22 +5482,23 @@ public class TileProcessor {
clt_parameters.plTargetEigen, // final double targetEigen, // = 0.1; // Remove outliers until main axis eigenvalue (possibly scaled by plDispNorm) gets below
clt_parameters.plFractOutliers, // final double fractOutliers, // = 0.3; // Maximal fraction of outliers to remove
clt_parameters.plMaxOutliers, // final int maxOutliers, // = 20; // Maximal number of outliers to remove
clt_parameters.stFloor, // final double strength_floor,
clt_parameters.stPow, // final double strength_pow,
// clt_parameters.stFloor, // final double strength_floor,
// clt_parameters.stPow, // final double strength_pow,
// clt_parameters.dbg_migrate && clt_parameters.stSmplMode , // final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
clt_parameters.stSmplMode , // final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
clt_parameters.stSmplSide , // final int smplSide, // = 2; // Sample size (side of a square)
clt_parameters.stSmplNum , // final int smplNum, // = 3; // Number after removing worst
clt_parameters.stSmplRms , // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
clt_parameters.stSmplWnd, // boolean smplWnd, // use window functions for the samples
clt_parameters.fs_max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
clt_parameters.fs_max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
clt_parameters.fs_damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
clt_parameters.fs_min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
clt_parameters.fs_transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
clt_parameters.fs_far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
clt_parameters.fs_far_power, // 1.0; // Raise disparity to this power before averaging for far objects
clt_parameters.mlfp, // Filter parameters
// clt_parameters.stSmplSide , // final int smplSide, // = 2; // Sample size (side of a square)
// clt_parameters.stSmplNum , // final int smplNum, // = 3; // Number after removing worst
// clt_parameters.stSmplRms , // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// clt_parameters.stSmplWnd, // boolean smplWnd, // use window functions for the samples
// clt_parameters.fs_max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// clt_parameters.fs_max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// clt_parameters.fs_damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// clt_parameters.fs_min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// clt_parameters.fs_transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// clt_parameters.fs_far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// clt_parameters.fs_far_power, // 1.0; // Raise disparity to this power before averaging for far objects
debugLevel, // 1, // final int debugLevel)
clt_parameters.tileX,
......@@ -6201,22 +6211,24 @@ public class TileProcessor {
clt_parameters.stStepThreshold, // double step_threshold,
clt_parameters.stMinDisparity, // double min_disparity,
clt_parameters.grow_disp_max, // double max_disparity,
clt_parameters.stFloor, // double strength_floor,
clt_parameters.stPow, // double strength_pow,
// clt_parameters.stFloor, // double strength_floor,
// clt_parameters.stPow, // double strength_pow,
0.0, // NO BLUR double stBlurSigma)
false, //clt_parameters.stSmplMode, // Use sample mode (false - regular tile mode)
clt_parameters.stSmplSide, // Sample size (side of a square)
clt_parameters.stSmplNum, // Number after removing worst
clt_parameters.stSmplRms, // Maximal RMS of the remaining tiles in a sample
clt_parameters.stSmplWnd, // Use window functions for the samples
clt_parameters.fs_max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
clt_parameters.fs_max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
clt_parameters.fs_damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
clt_parameters.fs_min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
clt_parameters.fs_transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
clt_parameters.fs_far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
clt_parameters.fs_far_power, // 1.0; // Raise disparity to this power before averaging for far objects
clt_parameters.mlfp, // Filter parameters
// clt_parameters.stSmplSide, // Sample size (side of a square)
// clt_parameters.stSmplNum, // Number after removing worst
// clt_parameters.stSmplRms, // Maximal RMS of the remaining tiles in a sample
// clt_parameters.stSmplWnd, // Use window functions for the samples
// clt_parameters.fs_max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// clt_parameters.fs_max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// clt_parameters.fs_damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// clt_parameters.fs_min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// clt_parameters.fs_transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// clt_parameters.fs_far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// clt_parameters.fs_far_power, // 1.0; // Raise disparity to this power before averaging for far objects
clt_parameters.stMeasSel); // bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
dbg_hist[0] = scan_prev.getSuperTiles().showDisparityHistogram();
......@@ -6227,22 +6239,23 @@ public class TileProcessor {
clt_parameters.stStepThreshold, // double step_threshold,
clt_parameters.stMinDisparity, // double min_disparity,
clt_parameters.grow_disp_max, // double max_disparity,
clt_parameters.stFloor, // double strength_floor,
clt_parameters.stPow, // double strength_pow,
// clt_parameters.stFloor, // double strength_floor,
// clt_parameters.stPow, // double strength_pow,
clt_parameters.stSigma, // with blur double stBlurSigma)
false, //clt_parameters.stSmplMode, // Use sample mode (false - regular tile mode)
clt_parameters.stSmplSide, // Sample size (side of a square)
clt_parameters.stSmplNum, // Number after removing worst
clt_parameters.stSmplRms, // Maximal RMS of the remaining tiles in a sample
clt_parameters.stSmplWnd, // boolean smplWnd, // use window functions for the samples
clt_parameters.fs_max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
clt_parameters.fs_max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
clt_parameters.fs_damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
clt_parameters.fs_min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
clt_parameters.fs_transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
clt_parameters.fs_far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
clt_parameters.fs_far_power, // 1.0; // Raise disparity to this power before averaging for far objects
clt_parameters.mlfp, // Filter parameters
// clt_parameters.stSmplSide, // Sample size (side of a square)
// clt_parameters.stSmplNum, // Number after removing worst
// clt_parameters.stSmplRms, // Maximal RMS of the remaining tiles in a sample
// clt_parameters.stSmplWnd, // boolean smplWnd, // use window functions for the samples
// clt_parameters.fs_max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// clt_parameters.fs_max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// clt_parameters.fs_damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// clt_parameters.fs_min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// clt_parameters.fs_transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// clt_parameters.fs_far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// clt_parameters.fs_far_power, // 1.0; // Raise disparity to this power before averaging for far objects
clt_parameters.stMeasSel); // bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
dbg_hist[1] = scan_prev.getSuperTiles().showDisparityHistogram();
......
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