@@ -398,7 +398,7 @@ public class AlignmentCorrection {
...
@@ -398,7 +398,7 @@ public class AlignmentCorrection {
use_poly,// final boolean use_poly,
use_poly,// final boolean use_poly,
clt_parameters.fcorr_inf_quad,// final boolean use_quadratic,
clt_parameters.fcorr_inf_quad,// final boolean use_quadratic,
clt_parameters.fcorr_inf_vert,// final boolean use_vertical,
clt_parameters.fcorr_inf_vert,// final boolean use_vertical,
// now disaprity is already restored
// now disparity is already restored
false,//clt_parameters.ly_inf_en, // final boolean use_disparity, // for infinity - if true, restores differences in the direction of disparity that was subtracted during measurement)
false,//clt_parameters.ly_inf_en, // final boolean use_disparity, // for infinity - if true, restores differences in the direction of disparity that was subtracted during measurement)
// For ly_inf_en need to make sure that programmed disparity was 0.0, so
// For ly_inf_en need to make sure that programmed disparity was 0.0, so
** BiQuadParameters - parameters defining Operation of a two quad camera rig
** BiQuadParameters - parameters defining Operation of a two quad camera rig
...
@@ -24,6 +22,8 @@ import java.util.Properties;
...
@@ -24,6 +22,8 @@ import java.util.Properties;
**
**
*/
*/
importjava.util.Properties;
publicclassBiQuadParameters{
publicclassBiQuadParameters{
publicbooleanrig_mode_debug=true;
publicbooleanrig_mode_debug=true;
publicbooleanno_int_x0=true;// do not offset window to integer maximum for the rig - used when averaging low textures to avoid "jumps" for very wide maximums
publicbooleanno_int_x0=true;// do not offset window to integer maximum for the rig - used when averaging low textures to avoid "jumps" for very wide maximums
...
@@ -447,7 +447,7 @@ public class BiQuadParameters {
...
@@ -447,7 +447,7 @@ public class BiQuadParameters {
"Try trimming hanging FG (need improvement)");
"Try trimming hanging FG (need improvement)");
gd.addNumericField("Absolute tolerane to determine that a tile is a background one for the selected plane",this.pf_atolerance,4,6,"pix",
gd.addNumericField("Absolute tolerane to determine that a tile is a background one for the selected plane",this.pf_atolerance,4,6,"pix",
"When a tile has disparity smaller than a plane by more than this value it is considered to be farther (in backgeround)");
"When a tile has disparity smaller than a plane by more than this value it is considered to be farther (in backgeround)");
gd.addNumericField("Relative (to center tile disaprity) disaprity tolerance to distinguish between FG and BG",this.pf_rtolerance,4,6,"pix/pix",
gd.addNumericField("Relative (to center tile disparity) disparity tolerance to distinguish between FG and BG",this.pf_rtolerance,4,6,"pix/pix",
"Product of this value by the center disparity is added to the absolute tolerance (above)?");
"Product of this value by the center disparity is added to the absolute tolerance (above)?");
gd.addNumericField("How many directions to look into (evenly of all 360) when trimming weak FG",this.pf_num_dirs,0,3,"",
gd.addNumericField("How many directions to look into (evenly of all 360) when trimming weak FG",this.pf_num_dirs,0,3,"",
"Weak FG trimming (after more permissive bridging over gaps) assumes that the FG adge should be strong, it looks in specified number of directions");
"Weak FG trimming (after more permissive bridging over gaps) assumes that the FG adge should be strong, it looks in specified number of directions");
POST_PROCESSING.disparityCorrelationParameters.filter2UpdateMax?POST_PROCESSING.disparityCorrelationParameters.filter2MinAbsolute:Double.NaN,//double minAbsolute, // or NaN - will use enabled/disabled state of the tile
POST_PROCESSING.disparityCorrelationParameters.filter2UpdateMax?POST_PROCESSING.disparityCorrelationParameters.filter2MinAbsolute:Double.NaN,//double minAbsolute, // or NaN - will use enabled/disabled state of the tile
(POST_PROCESSING.disparityCorrelationParameters.filter2UpdateMax?POST_PROCESSING.disparityCorrelationParameters.filter2MinAbsolute:Double.NaN),//double minAbsolute, // or NaN - will use enabled/disabled state of the tile
(POST_PROCESSING.disparityCorrelationParameters.filter2UpdateMax?POST_PROCESSING.disparityCorrelationParameters.filter2MinAbsolute:Double.NaN),//double minAbsolute, // or NaN - will use enabled/disabled state of the tile
// Creating initial pole seeds (tops need to be detected and available in the available DSI
publicdoubleseed_rsrength=0.8;// pole top seed relative strength (fraction of the strong trusted value that may change with correlation fat zero or other parameters
publicintseed_down=5;// seed disparity should be greater than average of this number of tiles below
publicdoubleseed_aover=0.2;// how much seed disparity should exceed that of the tiles below
publicdoubleseed_rover=0.05;// increase the previous by each 1 pixel of disparity
publicdoublemax_disparity=5.0;// maximal disparity to consider (near objects can be handled well without these tricks
// Seed (pole heads) tiles initial clustering
publicdoublemax_dd=0.1;// Maximal difference among seed tiles (compares to average of the already included)
publicdoublemax_dx=5;// Maximal horizontal difference between tiles to be included in the same initial cluster
publicdoublemax_dy=-1.0;// Maximal horizontal difference between tiles to be included in the same initial cluster
publicintext_up=2;// Extend initial cluster bounding box up
publicintext_down=30;// Extend initial cluster bounding box down
publicdoublepedestal_strength=0.15;// Pole pedestal minimal normalized strength
publicdoublepedestal_disp_over=0.3;// Pole pedestal disparity over the head
// cluster merge and split parameters
publicbooleanmerge_extended=false;// merge if only original clusters intersect
publicdoublemerge_rtolerance=1.5;// max_dd;
publicintsplit_min_dist=3;// minimal distance between local maximums to split
publicbooleansplit_must_zero=false;// true; // false; // there should be complete zero-strength on the profile to enable split
// Creating pole centerline and selection mask
publicdoublemax_diff=2.0;// maximal horizontal distance between the pole centerline and contributing tiles
publicdoublemax_tilt=0.1;// maximal pole center line tilt (dx/dy) from the vertical
publicdoublemax_rms=1.0;// Maximal horizontal weighted RMS between the contributing tiles and the centerline
publicintmin_tiles=3;// Minimal number of the remaining tiles to calculate centerline
publicdoubledamp_tilt=0.1;// "Force" to make centerline vertical
publicbooleanuse_seed=true;// use the original seed (pole head) in the selection mask
publicdoublehwidth=0.75;// maximal horizontal distance between the centerline and pole tiles in the selection
publicdoubledisp_aover=0.2;// interrupt mask if there is some FG object in front of it, with disparity exceeding by this margin
publicdoubledisp_rover=0.05;// increment above value per each pixel of disparity
publicintmin_neibs=3;// minimal number of neighbors to keep tile in the pole mask
// More tile filtering: trim unoccupied bottoms and check that the cluster head is separated on both right and left sides
publicbooleantrim_bottoms=true;// Trim bounding box bottom that does not contain any measured tiles
publicintextra_margin=2;// check for the pole head separation from the same/closer objects on both (right and left) sides, up to this far from the extended bounding box
publicdoublesep_min_strength=0.07;// require that the pole head is separated from right and left with the weaker tiles or farther ones
publicdoublesep_disp_adiff=0.15;// separation should have objects with disparity by this lower than the head
publicdoublesep_disp_rdiff=0.05;// increase required disparity separation margin proportionally to the absolute disparity
// measurements/re-measurements parameters with notch filtering to emphasize vertical lines
publicintremeasure_hheight=4;// half maximum number of tiles vertical column to combine correlations
publicdoublehigh_disp_tolerance=0.3;// count only tiles that had measured residual disparity not exceeding this value
publicdoublelow_disp_tolerance=0.3;// count only tiles that had measured residual disparity not less than minus this value
publicdoublemin_strength=0.15;// minimal measured strength to consider
publicbooleanuse_fittest=true;// when selecting measurement among ones with different vertical integration, use the one closest to 0, false - use strongest result
// Updating disparity using the measurement results
publicintmax_refines=20;// maximal number of re-measure/update disparity cycles
publicdoublemin_refine_diff=0.001;// minimal disparity difference to keep refining
publicintfilter_min_height=10;// minimal extended bounding box height (good - min 12)
publicdoublefilter_min_fraction=0.5;// minimal fraction of the pole mask that has measured valid tiles (worst 0.3478 , next - 0.57)
publicdoublefilter_min_frac_height=0.5;// vertical profile: minimal fraction of the pole selection mask that has valid measurements worst 0.25 , next - 0.556
publicdoublefilter_min_frac_box=0.7;// same as above, but denominator includes full mask height including gaps if any worst 0.75 , next - 0.556
publicdoublefilter_min_disparity=0.3;// minimal pole absolutre disparity
gd.addCheckbox("Enable poles detection and usage",this.poles_en,"Enable poles detection and usege to improve DSI");
gd.addMessage("Creating initial pole seeds (tops need to be detected and available in the available DSI");
gd.addNumericField("Pole relative (to trusted tiles strength) to qualify for the pole seed",this.seed_rsrength,3,6,"",
"Pole top seed relative strength (fraction of the strong trusted value that may change with correlation fat zero or other parameters");
gd.addNumericField("Seed disparity should be greater than average of this number of tiles below it",this.seed_down,0,3,"tiles",
"Seed (pole head) tiles should appear closer (higher disparity) than the (presumably BG) tiles resolved below it. This is how many tiles below the seed should be averaged to compare");
gd.addNumericField("Seed disparity should exceed BG below by this margin",this.seed_aover,3,6,"pix",
"How much seed disparity should exceed that of the tiles below");
gd.addNumericField("Relative seed disparity margin (per each disparity pixel)",this.seed_rover,3,6,"pix/pix",
"Add to the previous parameter after multiplying by the absolute disparity");
gd.addNumericField("Maximal disparity to consider as a seed",this.max_disparity,3,6,"pix",
"Near objects are handled nicely without such tricks, and they usually have larger horizontal dimension (more than a tile wide)");
"Minimal normalized strength (after subtracting strength floor and optionally raising to specified power of teh pole base");
gd.addNumericField("Pole pedestal disparity over the head",this.pedestal_disp_over,3,6,"pix",
"Pole base should have tiles closer (and so have higher disparity) than the pole seed by this margin");
gd.addMessage("Cluster merge and split parameters");
gd.addCheckbox("Merge if even extended bounding boxes intersect",this.merge_extended,
"Unchecked - merge only if the seed bounding boxes intersect");
gd.addNumericField("Merge relative (to maximum cluster disparity difference) disparity tolerance",this.merge_rtolerance,3,6,"",
"Merge if the disparity differs by less than this times scaled seed disparity allowed difference");
gd.addNumericField("Minimal distance between local maximums to split",this.split_min_dist,0,3,"tiles",
"Calculate horizontal profile for the cluster seed and split if the distance between local maximums does not exceed this value");
gd.addCheckbox("There should be a complete zero (empty) point on the horizontal profile to allow split",this.split_must_zero,
"Local maximums for the cluster split should be separated by at least one complete empty point");
gd.addMessage("Creating pole centerline and selection mask");
gd.addNumericField("Distance from the centerline",this.max_diff,3,6,"tiles",
"Maximal horizontal distance between the pole centerline and contributing tiles");
gd.addNumericField("Maximal pole tilt",this.max_tilt,3,6,"",
"Maximal pole center line tilt (dx/dy) from the vertical");
gd.addNumericField("Maximal horizontal RMS from the centerline",this.max_rms,3,6,"tiles",
"Maximal horizontal weighted RMS between the contributing tiles and the centerline");
gd.addNumericField("Minimal number of tiles for the centerline calculation",this.min_tiles,0,3,"tiles",
"Minimal number of the remaining tiles to calculate centerline");
gd.addNumericField("\"Force\" to make centerline vertical",this.damp_tilt,3,6,"",
"Relative penalty for tilted pole centerline");
gd.addCheckbox("Include cluster seed tiles in the cluster tile selection",this.use_seed,
"Include cluster seed tiles in addition to the centerline in the cluster tile selection");
gd.addNumericField("Half-width of the pole selection",this.hwidth,3,6,"tiles",
"Maximal horizontal distance between the centerline and pole tiles in the selection");
gd.addNumericField("Disapritry difference to occlude the pole by the FG objects",this.disp_aover,3,6,"pix",
"Interrupt pole mask if there is some FG object in front of it, with disparity exceeding by this margin");
gd.addNumericField("Relative disparity difference required for occlusion",this.disp_rover,3,6,"pix/pix",
"Increase the required disparity difference proportionally to the absolute disparity");
gd.addNumericField("Minimal number of neighbors to keep tile in the pole mask",this.min_neibs,0,3,"tiles",
"Filtering out lone or poorly connected tiles in the pole selection mask");
gd.addMessage("More tile filtering: trim unoccupied bottoms and check that the cluster head is separated on both right and left sides");
gd.addCheckbox("Trim bounding box bottom that does not contain any measured tiles",this.trim_bottoms,
"Remove unused bottom portion of the extended bounding box of each cluster");
gd.addNumericField("Extra horizontal margins to look for cluster separation",this.extra_margin,0,3,"tiles",
"Cluster head should be an \"island\" not the overhanging part of some larger objet. This value specifies how far to look for connections to other objects");
gd.addNumericField("Minimal normalized strength of the right/left head connection to be considered",this.sep_min_strength,3,6,"",
"When looking for the suspected pole head connection to right/left objects consider only tiles stronger thatn that");
"Increase the previous value proportionally to the absolute disparity");
gd.addMessage("Measurements/re-measurements parameters with notch filtering to emphasize vertical lines and suppress random texture of the background");
gd.addNumericField("Half maximum number of tiles vertical column to combine correlations",this.remeasure_hheight,0,3,"tiles",
"Try to acquire poles using different number of vertically combined tiles, staring from 0 (center only). 1 - up to 3 tiles, 2 - up to 5 tiles, and so on");
"Count only tiles that had measured residual disparity not exceeding this value");
gd.addNumericField("Absolute value of the minimal measured (residual) disparity",this.low_disp_tolerance,3,6,"pix/pix",
"Count only tiles that had measured residual disparity not less than negative of this value");
gd.addNumericField("Minimal measured strength to consider",this.min_strength,3,6,"pix/pix",
"Increase the previous value proportionally to the absolute disparity");
gd.addCheckbox("Use fittest of the measurements for each tile (unchecked - use strongest)",this.use_fittest,
"when selecting measurement among ones with different vertical integration, use the one closest to 0, false - use strongest result");
gd.addMessage("Updating disparity using the measurement results");
gd.addNumericField("Maximal number of re-measure/update disparity cycles",this.max_refines,0,3,"",
"Number of update pole disparity - re-measure cycles to perform (if not reached maximal diff limit below");
gd.addNumericField("Minimal disparity difference to keep refining",this.min_refine_diff,3,6,"",
"Stop updating disparity for a pole if the last difference is less than this value");
gd.addNumericField("Target disparity to differential disparity scale (baseline ratio)",this.disparity_scale,3,6,"",
"Ideally it should be the ratio of the master camera baseline to inter-camera baseline, but because the interaction"+
"of the correlation window and correlation maximum width reduces reported disparity, it should be increased");
gd.addNumericField("Increase weight of the higher disparity measurements (>=1.0), 0.0 - use normal weighted average ",this.diff_power,3,6,"",
"Bias towards higher disparities - (disparity+offset) is raised to this power and applied to weight if 0.0 - do not apply value to weight");
gd.addNumericField("Add to disparity before raising to the power specified above",this.diff_offset,3,6,"",
"Disregard samples below negative of this value, multiply weight by the sum of the residual disparity (around 0.0) and this value raised to certain power");
gd.addNumericField("Do not use this many bottom tiles as their disparity may be influenced by the pedestal",this.cut_bottom,0,3,"tiles",
"These cut-off tiles are still used in the pole mask. The amount of cut tiles may be reduced for the short objects by the next parameter");
gd.addNumericField("Do not cut pole bottoms by more than this fraction of its height",this.keep_bottom,3,6,"",
"This parameter allows to reduce the number specified in the previous one for the short poles");
gd.addMessage("Filtering clusters (removing those that fail)");