// if (properties.getProperty(prefix+"unique_tolerance")!=null) this.unique_tolerance=Double.parseDouble(properties.getProperty(prefix+"unique_tolerance"));
// calculate "tilted" disparity, so planes parallel to the same world plane would have the same disparity
// also produces non-tilted, if world_plane_norm == null
// Protecting from behind the horizon - set strength of all tiles in the negative disparity area to 0
publicdouble[][][][]getPlaneDispStrengths(
finaldouble[]world_plane_norm,// real world normal vector to a suggested plane family (0,1,0) for horizontal planes
publicdouble[][][][]getPlaneDispStrengthsST(
finaldouble[]world_plane_norm,// real world normal vector to a suggested plane family (0,1,0) for horizontal planes, (0,0,1) const disparity, null - floating
finalintstMeasSel,// = 1; // Select measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
finalbooleanplPreferDisparity,// Always start with disparity-most axis (false - lowest eigenvalue)
passes,// final ArrayList <CLTPass3d> passes,// List, first, last - to search for the already tried disparity
firstPass,// final int firstPass,
lastPassPlus1,// final int lastPassPlus1,
variants[num_var].expand_discontinuity,// final boolean expand_discontinuity, // true - expand discontinuity over known tiles
variants[num_var].smooth_only,// final boolean smooth_only, // Do not expand ambiguous cells (with discontinuity) (only valid for expand_discontinuity = false)
variants[num_var].extend_far,// final boolean extend_far, // extend far (false - extend near)
variants[num_var].num_steps,// final int num_steps, // how far to extend
smpl_size,// final int smpl_size, // == 5
min_points,// final int min_points, // == 3
use_wnd,// final boolean use_wnd, // use window function fro the neighbors
tilt_cost,// final double tilt_cost,
variants[num_var].split_threshold,// final double split_threshold, // if full range of the values around the cell higher, need separate fg, bg
variants[num_var].same_range,// final double same_range, // modify
variants[num_var].diff_continue,// final double diff_continue, // maximal difference from the old value (for previously defined tiles
max_abs_tilt,// final double max_abs_tilt, // = 2.0; // pix per tile
max_rel_tilt,// final double max_rel_tilt, // = 0.2; // (pix / disparity) per tile
max_tries,// final int max_tries, // maximal number of smoothing steps
final_diff,// final double final_diff, // maximal change to finish iterations
grow_disp_max,// final double grow_disp_max,
unique_pre_tolerance,// final double unique_pre_tolerance, // usually larger than clt_parameters.unique_tolerance
show_expand,// final boolean show_expand,
dbg_x,// final int dbg_x,
dbg_y,// final int dbg_y,
debugLevel);// final int debugLevel)
if(num_op<min_new){
// scan.restoreKeepTileOpDisparity(); // it is not used from this scan, but from last_scan
continue;
}
// Remove tiles that were already tried, see if anything is left
int[]unique_stats=makeUnique(
passes,// clt_3d_passes, // final ArrayList <CLTPass3d> passes,
firstPass,// final int firstPass,
lastPassPlus1,// clt_3d_passes.size(),// last_scan, // - 1, // final int lastPassPlus1,
scan,//clt_3d_passes.get(refine_pass), // final CLTPass3d new_scan,
grow_disp_max,// final double grow_disp_max,
unique_tolerance,// final double unique_tolerance,
show_unique);// final boolean show_unique)
intnum_left=unique_stats[0];
if(num_left<min_new){
if(debugLevel>0){
System.out.println("prepareExpandVariants(): discarding variant "+num_var+" as remaining "+num_left+" < "+min_new);
}
// scan.restoreKeepTileOpDisparity();// it is not used from this scan, but from last_scan
continue;
}
if(debugLevel>0){
System.out.println("prepareExpandVariants(): remaining "+num_left+" tiles to be processed, used variant "+num_var);
}
int[]rslt={num_left,num_var};
returnrslt;
}
}
returnnewint[2];// nothing found
}
publicintsetupExpand(
finalCLTPass3dscan,// combined scan with max_tried_disparity, will be modified to re-scan
finalCLTPass3dlast_scan,// last prepared tile - can use last_scan.disparity, .border_tiles and .selected
selected[nTile]=(last_scan.selected[nTile]||expanded[nTile])&&!Double.isNaN(disparity[nTile]);// selected by refine and new java.lang.NullPointerException