double[][][]input_data=CLTMacroSetData(// perform single pass according to prepared tiles operations and disparity
src_scan,// final CLTPass3d src_scan, // results of the normal correlations (now expecting infinity)
null);// final double [][][] other_channels, // other channels to correlate, such as average RGB (first index - subcamera, 2-nd - channel, 3-rd - pixel)
8,// final int macro_scale, // to correlate tile data instead of the pixel data: 1 - pixels, 8 - tiles
macro_scan.tile_op,// per-tile operation bit codes
macro_scan.disparity,// clt_parameters.disparity, // final double disparity,
input_data,// final double [][][] imade_data, // first index - number of image in a quad
// correlation results - final and partial
clt_corr_combo,// [tp.tilesY][tp.tilesX][(2*transform_size-1)*(2*transform_size-1)] // if null - will not calculate
clt_corr_partial,// clt_corr_partial, // [tp.tilesY][tp.tilesX][quad]color][(2*transform_size-1)*(2*transform_size-1)] // if null - will not calculate
null,// [tp.tilesY][tp.tilesX][pair]{dx,dy,weight}[(2*transform_size-1)*(2*transform_size-1)] // transpose unapplied. null - do not calculate
// Use it with disparity_maps[scan_step]? clt_mismatch, // [tp.tilesY][tp.tilesX][pair]{dx,dy,weight}[(2*transform_size-1)*(2*transform_size-1)] // transpose unapplied. null - do not calculate
double[][][]input_data=mc.CLTMacroSetData(// perform single pass according to prepared tiles operations and disparity
bgnd_data,// final CLTPass3d src_scan, // results of the normal correlations (now expecting infinity)
null);// final double [][][] other_channels, // other channels to correlate, such as average RGB (first index - subcamera, 2-nd - channel, 3-rd - pixel)
TileProcessormtp=mc.CLTMacroScan(// perform single pass according to prepared tiles operations and disparity
bgnd_data,// final CLTPass3d src_scan, // results of the normal correlations (now expecting infinity)
tp.clt_3d_passes.size()-1,// final int measured_scan_index, // will not look at higher scans
num_extended=zMapExpansionStep(
0,// final int start_scan_index,
tp.clt_3d_passes,// final ArrayList <CLTPass3d> passes,// List, first, last - to search for the already tried disparity
tp.clt_3d_passes.get(bg_pass).getSelected(),// selected , // final boolean [] bg_tiles, // get from selected in clt_3d_passes.get(0);
clt_parameters,//final EyesisCorrectionParameters.CLTParameters clt_parameters, // for refinePassSetup()
clt_parameters.ex_min_over,// final double ex_min_over, // when expanding over previously detected (by error) background, disregard far tiles
0,// final int firstPass,
disp_index,// final int disp_index,
tp.clt_3d_passes.size(),// final int lastPassPlus1,
str_index,// final int str_index,
bg_pass,// final int bg_index,
null,// final double [] tiltXY, // null - free with limit on both absolute (2.0?) and relative (0.2) values
trustedCorrelation,// final double trustedCorrelation,
true,// final boolean refine, // now always should be true ?
strength_floor,// final double strength_floor,
clt_parameters.gr_new_expand,// final boolean expand_neibs, // expand from neighbors
strength_pow,// final double strength_pow,
!clt_parameters.gr_new_expand,// final boolean expand_legacy, // old mode of growing tiles (using max scanned). If both true, will try only if expand_neibs fails
smplSide,// final int smplSide, // = 2; // Sample size (side of a square)
smplNum,// final int smplNum, // = 3; // Number after removing worst (should be >1)
// Filtering by background data:
smplRms,// final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
filtered_bgnd_disp_strength,// final double [][] filtered_bgnd_ds, // if not null, will filter results not to have low disparity new tiles over supposed bgnd
smplRelRms,// final double smplRelRms, // = 0.005; // Maximal RMS/disparity in addition to smplRms
// for legacy expansion it is not used, but just checked for null, so double [0][] should work too
smplWnd,// final boolean smplWnd, //
clt_parameters.ex_min_over,// final double ex_min_over, // when expanding over previously detected (by error) background, disregard far tiles
max_abs_tilt,// final double max_abs_tilt, // = 2.0; // pix per tile
clt_parameters.gr_ovrbg_filtered,// final double str_over_bg, // Minimal filtered strength when replacing background data
max_rel_tilt,// final double max_rel_tilt, // = 0.2; // (pix / disparity) per tile
clt_parameters.gr_ovrbg_cmb,// final double str_over_bg_combo, // Minimal combined strength when replacing background data
dbg_x,
clt_parameters.gr_ovrbg_cmb_hor,// final double str_over_bg_combo_hor, // Minimal combined strength when replacing background data
dbg_y,// final int dbg_y,
clt_parameters.gr_ovrbg_cmb_vert,// final double str_over_bg_combo_vert, // Minimal combined strength when replacing background data
debugLevel+1);// final int debugLevel)
if(over_infinity){
// Refine parameters use directly some clt_parameters, others below
tp.filterOverBackground(
clt_parameters.stUseRefine,// final boolean stUseRefine, // use supertiles (now false)
filtered_bgnd_disp_strength[1],// final double [] bg_strength,
clt_parameters.ex_strength,// final double ex_strength, // double this_sure, // minimal strength to be considered definitely good
tp.clt_3d_passes.get(bg_pass).getSelected(),// final boolean [] bg_tiles, // get from selected in clt_3d_passes.get(0);
clt_parameters.ex_nstrength,//final double ex_nstrength, // double ex_nstrength, // minimal 4-corr strength divided by channel diff for new (border) tiles
filterMinStrength,// final double minStrength,
clt_parameters.bgnd_maybe,// final double bgnd_maybe, // double this_maybe, // maximal strength to ignore as non-background
clt_parameters.ex_min_over);// final double ex_min_over // when expanding over previously detected (by error) background, disregard far tiles
clt_parameters.sure_smth,// final double sure_smth, // sure_smth, // if 2-nd worst image difference (noise-normalized) exceeds this - do not propagate bgnd
}
clt_parameters.pt_super_trust,//final double pt_super_trust, // final double super_trust, // If strength exceeds ex_strength * super_trust, do not apply ex_nstrength and plate_ds
refine_pass=tp.clt_3d_passes.size();// 1
// using plates disparity/strength - averaged for small square sets of tiles. If null - just use raw tiles
// refine pass uses hor/vert thresholds inside
clt_parameters.pt_keep_raw_fg,// final boolean pt_keep_raw_fg, // final boolean keep_raw_fg, // do not replace raw tiles by the plates, if raw is closer (like poles)
CLTPass3drefined=tp.refinePassSetup(// prepare tile tasks for the refine pass (re-measure disparities)
clt_parameters.pt_scale_pre,// final double pt_scale_pre, // final double scale_filtered_strength_pre, // scale plate_ds[1] before comparing to raw strength
// final double [][][] image_data, // first index - number of image in a quad
clt_parameters.pt_scale_post,// final double pt_scale_post, // final double scale_filtered_strength_post,// scale plate_ds[1] when replacing raw (generally plate_ds is more reliable if it exists)
clt_parameters,
clt_parameters.stUseRefine,// use supertiles
// Composite scan parameters
bg_pass,
clt_parameters.combine_min_strength,// final double combine_min_strength, // final double minStrength,
// disparity range - differences from
clt_parameters.combine_min_hor,// final double combine_min_hor, // final double minStrengthHor,
clt_parameters.ex_strength,// double this_sure, // minimal strength to be considered definitely good
//getFilteredDisparityStrength parameters
clt_parameters.ex_nstrength,// double ex_nstrength, // minimal 4-corr strength divided by channel diff for new (border) tiles
clt_parameters.bgnd_maybe,// double this_maybe, // maximal strength to ignore as non-background
// Consider separate parameters for FDS?
clt_parameters.sure_smth,// sure_smth, // if 2-nd worst image difference (noise-normalized) exceeds this - do not propagate bgnd
clt_parameters.fds_str_floor,// final double fds_str_floor,
clt_parameters.pt_super_trust,// final double super_trust, // If strength exceeds ex_strength * super_trust, do not apply ex_nstrength and plate_ds
clt_parameters.fds_str_pow,// final double fds_str_pow,
// using plates disparity/strength - averaged for small square sets of tiles. If null - just use raw tiles
clt_parameters.fds_smpl_side,// final int fds_smpl_size, // == 5
filtered_disp_strength,// final double [][] plate_ds, // disparity/strength last time measured for the multi-tile squares. Strength =-1 - not measured. May be null
clt_parameters.fds_smpl_num,// final int fds_smpl_points, // == 3
clt_parameters.pt_keep_raw_fg,// final boolean keep_raw_fg, // do not replace raw tiles by the plates, if raw is closer (like poles)
clt_parameters.fds_smpl_rms,// final double fds_abs_rms,
clt_parameters.pt_scale_pre,// final double scale_filtered_strength_pre, // scale plate_ds[1] before comparing to raw strength
clt_parameters.fds_smpl_rel_rms,// final double fds_rel_rms,
clt_parameters.pt_scale_post,// final double scale_filtered_strength_post,// scale plate_ds[1] when replacing raw (generally plate_ds is more reliable if it exists)
clt_parameters.fds_smpl_wnd,// final boolean fds_use_wnd, // use window function fro the neighbors
0.001,// final double fds_tilt_damp,
ImageDtt.DISPARITY_INDEX_CM,// index of disparity value in disparity_map == 2 (0,2 or 4)
clt_parameters.fds_abs_tilt,// final double fds_abs_tilt, // = 2.0; // pix per tile
geometryCorrection,
clt_parameters.fds_rel_tilt,// final double fds_rel_tilt, // = 0.2; // (pix / disparity) per tile
threadsMax,// maximal number of threads to launch
updateStatus,
// expansion from neighbors parameters:
debugLevel);
clt_parameters.gr_min_new,// final int gr_min_new, // discard variant if there are less new tiles
tp.clt_3d_passes.add(refined);
clt_parameters.gr_steps_over,// final int gr_steps_over, // how far to extend
clt_parameters.gr_var_new_sngl,// final boolean gr_var_new_sngl,
clt_parameters.gr_var_new_bg,// final boolean gr_var_new_bg,
"after_refine-"+refine_pass);
clt_parameters.gr_var_all_bg,// final boolean gr_var_all_bg,
}
clt_parameters.gr_var_next,// final boolean gr_var_next,
clt_parameters.gr_smpl_size,// final int gr_smpl_size , // 5, // final int smpl_size, // == 5
clt_parameters.gr_min_pnts,// final int gr_min_pnts , // 5, // 4, // 3, // final int min_points, // == 3
clt_parameters.gr_use_wnd,// final boolean gr_use_wnd , // true, // final boolean use_wnd, // use window function fro the neighbors
clt_parameters.gr_tilt_damp,// final double gr_tilt_damp , // 0.001, // final double tilt_cost,
clt_parameters.gr_split_rng,// final double gr_split_rng , // 5.0, // final double split_threshold, // if full range of the values around the cell higher, need separate fg, bg
// if (show_expand || (clt_parameters.show_expand && last_pass)) {
clt_parameters.gr_same_rng,// final double gr_same_rng , // 3.0, // final double same_range, // modify
// tp.showScan(
clt_parameters.gr_diff_cont,// final double gr_diff_cont , // 2.0, // final double diff_continue, // maximal difference from the old value (for previously defined tiles
clt_parameters.gr_abs_tilt,// final double gr_abs_tilt , // 2.0, // final double max_abs_tilt, // = 2.0; // pix per tile
// "after_refine-"+refine_pass);
clt_parameters.gr_rel_tilt,// final double gr_rel_tilt , // 0.2, // final double max_rel_tilt, // = 0.2; // (pix / disparity) per tile
// }
clt_parameters.gr_smooth,// final int gr_smooth , // 50, // final int max_tries, // maximal number of smoothing steps
clt_parameters.gr_fin_diff,// final double gr_fin_diff , // 0.01, // final double final_diff, // maximal change to finish iterations
clt_parameters.gr_unique_pretol,// final double gr_unique_pretol , // 1.0, // final double unique_pre_tolerance, // usually larger than clt_parameters.unique_tolerance
tp.calcMaxTried(
tp.clt_3d_passes,// final ArrayList <CLTPass3d> passes,
// legacy expansion
bg_pass,// final int firstPass,
clt_parameters.grow_min_diff,// final double grow_min_diff, // = 0.5; // Grow more only if at least one channel has higher variance from others for the tile
refine_pass,// may add 1 to include current (for future?) // final int lastPassPlus1,
clt_parameters.grow_retry_far,// final boolean grow_retry_far, // final boolean grow_retry_far, // Retry tiles around known foreground that have low max_tried_disparity
tp.clt_3d_passes.get(refine_pass));// final int lastPassPlus1,
clt_parameters.grow_pedantic,// final boolean grow_pedantic, // final boolean grow_pedantic, // Scan full range between max_tried_disparity of the background and known foreground
clt_parameters.grow_retry_inf,// final boolean grow_retry_inf, // final boolean grow_retry_inf, // Retry border tiles that were identified as infinity earlier
// repeated composite scan may be replaced by just a clone
CLTPass3dextended_pass=tp.compositeScan(
// common expansion
tp.clt_3d_passes,// final ArrayList <CLTPass3d> passes,
clt_parameters.gr_num_steps,// final int gr_num_steps, // how far to extend
bg_pass,// final int firstPass,
clt_parameters.gr_unique_tol,// final double gr_unique_tol,
tp.clt_3d_passes.size(),// final int lastPassPlus1,
0.0,// clt_parameters.grow_disp_min , // final double grow_disp_min, // final double disp_near,
// tp.clt_3d_passes.get(bg_pass).getSelected(), // selected , // final boolean [] bg_tiles, // get from selected in clt_3d_passes.get(0);
clt_parameters.grow_disp_max,// final double grow_disp_max, // final double disp_near,
// clt_parameters.ex_min_over,// final double ex_min_over, // when expanding over previously detected (by error) background, disregard far tiles
clt_parameters.grow_disp_step,// final double grow_disp_step, // = 6.0; // Increase disparity (from maximal tried) if nothing found in that tile // TODO: handle enclosed dips?
tp.getTrustedCorrelation(),// final double trustedCorrelation,
0.0,// clt_parameters.bgnd_range, // final double disp_far, // limit results to the disparity range
// for debug level > 1, just corresponding clt_parameters.* will work, otherwise following 3 can override
clt_parameters.grow_disp_max,// final double disp_near,
last_pass,// final boolean last_pass, // just for more debug?
clt_parameters.combine_min_strength,// final double minStrength,
true,// final boolean remove_non_measurement, // save memory, true is OK
clt_parameters.combine_min_hor,// final double minStrengthHor,
show_expand,// final boolean show_expand,
clt_parameters.combine_min_vert,// final double minStrengthVert,
clt_parameters.show_unique,// final boolean show_unique,
true,// false, // final boolean use_last, //
show_retry_far,// final boolean show_retry_far,
// TODO: when useCombo - pay attention to borders (disregard)
false,// final boolean usePoly) // use polynomial method to find max), valid if useCombo == false
dbg_x,
true,// final boolean copyDebug)
dbg_y,// final int dbg_y,
debugLevel);
debugLevel+1);// final int debugLevel)
if(over_infinity){
tp.filterOverBackground(
extended_pass,// final CLTPass3d pass,
}else{// if (use_zMapExpansionStep) {
comboMinStrength,// final double minStrength,
comboMinStrengthHor,// final double minStrengthHor,
// Temporarily mixing results of refinePassSetup() and tp.getFilteredDisparityStrength(). The Later needs measurement pass, not refined
clt_parameters.ex_strength,// double this_sure, // minimal strength to be considered definitely good
clt_parameters.ex_nstrength,// double ex_nstrength, // minimal 4-corr strength divided by channel diff for new (border) tiles
clt_parameters.bgnd_maybe,// double this_maybe, // maximal strength to ignore as non-background
clt_parameters.sure_smth,// sure_smth, // if 2-nd worst image difference (noise-normalized) exceeds this - do not propagate bgnd
clt_parameters.pt_super_trust,// final double super_trust, // If strength exceeds ex_strength * super_trust, do not apply ex_nstrength and plate_ds
// using plates disparity/strength - averaged for small square sets of tiles. If null - just use raw tiles
filtered_disp_strength,// final double [][] plate_ds, // disparity/strength last time measured for the multi-tile squares. Strength =-1 - not measured. May be null
clt_parameters.pt_keep_raw_fg,// final boolean keep_raw_fg, // do not replace raw tiles by the plates, if raw is closer (like poles)
clt_parameters.pt_scale_pre,// final double scale_filtered_strength_pre, // scale plate_ds[1] before comparing to raw strength
clt_parameters.pt_scale_post,// final double scale_filtered_strength_post,// scale plate_ds[1] when replacing raw (generally plate_ds is more reliable if it exists)
ImageDtt.DISPARITY_INDEX_CM,// index of disparity value in disparity_map == 2 (0,2 or 4)