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
publicbooleanuse_poly=true;
publicbooleanuse_xy_poly=true;
publicdoublemin_poly_strength=0.2;
publicdoublemin_poly_strength=0.2;// never
publicdoublemin_xy_poly_strength=1.0;// never
publicdoubleinf_min_strength_main=0.12;
publicdoubleinf_min_strength_aux=0.12;
...
...
@@ -72,6 +73,7 @@ public class BiQuadParameters {
publicdoubletrusted_tolerance=1.0;// Trusted tolerance for small baseline camera(s)
// rig LT (poor textured areas)
publicintlt_avg_radius=0;// average multiple tiles disparity (only used in certain modes)
publicdoublelt_min_disparity=0.0;// apply low texture to near objects
publicdoublelt_trusted_strength=0.2;// strength sufficient without neighbors
publicdoublelt_strength_rfloor=0.28;// fraction of trusted strength to subtract
...
...
@@ -146,7 +148,21 @@ public class BiQuadParameters {
publicdoublepf_new_diff=0.5;// Minimal disparity (in master camera pixels) difference between the new suggested and the already tried/measured one
publicintpf_min_new=5;// Minimal number of he new tiles during rig refine for plane filter
gd.addCheckbox("Debug rig/bi-camera functionality ",this.rig_mode_debug,"Enable debugging of the methods related to dual camera rig");
gd.addCheckbox("Do not offset window to integer maximum for the rig (CM mode)",this.no_int_x0,
"For the very wide/low strength maximums changing window from integer maximum causes \"jumps\" in the result, so this offset is automatically disabled in refine mode."+
" It is still useful for large offsets, and can be manually disabled with this parameter (rig only, not used for a single quad camera)");
gd.addCheckbox("Use poly for main/aux/rig correlations (false - CM)",this.use_poly,"Use LMA/polynomial if correlation is strong enough");
gd.addCheckbox("Use poly for rig X/Y mismatch measurements",this.use_xy_poly,"Use polynomial forX/Y offset measurements if correlation is strong enough");
...
...
@@ -286,6 +305,8 @@ public class BiQuadParameters {
gd.addTab("Rig LT","Deal with the low textured areas");
gd.addNumericField("Average multiple tiles disparity (only used in certain modes)",this.lt_avg_radius,0,3,"",
"Replace bi-quad correlation/strength with average over a sample square : 0 - avg off, 1 - 3x3, 2 - 5x5, ...");
gd.addNumericField("Apply low texture to near objects (disparity above)",this.lt_min_disparity,3,6,"pix",
"Handle low textured objects with disparity (main camera pixels) above this threshold");
gd.addNumericField("Inter-camera correlation strength sufficient without neighbors",this.lt_trusted_strength,3,6,"",
...
...
@@ -424,6 +445,33 @@ public class BiQuadParameters {
gd.addNumericField("Minimal refined tiles during plane filter",this.pf_min_new,0,3,"",
finaldouble[][]lt_corr=(lt_rad>0)?(newdouble[nTilesInChn][]):null;// will keep inter-camera combo correlation, later combined in a separate multi-thread run
finalThread[]threads=newThreadArray(threadsMax);
finalAtomicIntegerai=newAtomicInteger(0);
finaldouble[]col_weights=newdouble[numcol];// colors are RBG
...
...
@@ -8195,22 +8265,31 @@ public class ImageDtt {
if(clt_corr_combo!=null){// [type][tilesY][tilesX][(2*transform_size-1)*(2*transform_size-1)] // if null - will not calculate
scaleExposures_main,// double [] scaleExposures_main, // probably not needed here - restores brightness of the final image
scaleExposures_aux,// double [] scaleExposures_aux, // probably not needed here - restores brightness of the final image
false,// final boolean notch_mode, // use notch filter for inter-camera correlation to detect poles
false,// final boolean notch_mode, // use notch filter for inter-camera correlation to detect poles
// averages measurements
clt_parameters.rig.lt_avg_radius,// final int lt_rad, // low texture mode - inter-correlation is averaged between the neighbors before argmax-ing, using
// final boolean apply_corr, // calculate and apply additional fine geometry correction
// final boolean infinity_corr, // calculate and apply geometry correction at infinity
threadsMax,// final int threadsMax, // maximal number of threads to launch
...
...
@@ -262,6 +265,7 @@ public class TwoQuadCLT {
double[]scaleExposures_main,// probably not needed here - restores brightness of the final image
double[]scaleExposures_aux,// probably not needed here - restores brightness of the final image
booleannotch_mode,// use pole-detection mode for inter-camera correlation
finalintlt_rad,// low texture mode - inter-correlation is averaged between the neighbors before argmax-ing, using
finalintthreadsMax,// maximal number of threads to launch
finalbooleanupdateStatus,
finalintdebugLevel){
...
...
@@ -339,9 +343,11 @@ public class TwoQuadCLT {
image_dtt.clt_bi_quad(
clt_parameters,// final EyesisCorrectionParameters.CLTParameters clt_parameters,
clt_parameters.fat_zero,// final double fatzero, // May use correlation fat zero from 2 different parameters - fat_zero and rig.ml_fatzero
notch_mode,// final boolean notch_mode, // use notch filter for inter-camera correlation to detect poles
notch_mode,// final boolean notch_mode, // use notch filter for inter-camera correlation to detect poles
lt_rad,// final int lt_rad, // low texture mode - inter-correlation is averaged between the neighbors before argmax-ing, using
// first measurement - use default setting
clt_parameters.rig.no_int_x0,// boolean no_int_x0, // do not offset window to integer maximum - used when averaging low textures to avoid "jumps" for very wide
tile_op_main,// final int [][] tile_op_main, // [tilesY][tilesX] - what to do - 0 - nothing for this tile
// tile_op_aux, // final int [][] tile_op_aux, // [tilesY][tilesX] - what to do - 0 - nothing for this tile
false,// final boolean notch_mode, // use notch filter for inter-camera correlation to detect poles
0,// final int // low texture mode - inter-correlation is averaged between the neighbors before argmax-ing, using
// first measurement - use default setting
clt_parameters.rig.no_int_x0,// boolean no_int_x0, // do not offset window to integer maximum - used when averaging low textures to avoid "jumps" for very wide
threadsMax,// final int threadsMax, // maximal number of threads to launch
false,// final boolean notch_mode, // use notch filter for inter-camera correlation to detect poles
0,// final int // low texture mode - inter-correlation is averaged between the neighbors before argmax-ing, using
// first measurement - use default setting
clt_parameters.rig.no_int_x0,// boolean no_int_x0, // do not offset window to integer maximum - used when averaging low textures to avoid "jumps" for very wide
threadsMax,// final int threadsMax, // maximal number of threads to launch
false,// final boolean notch_mode, // use notch filter for inter-camera correlation to detect poles
0,// final int // low texture mode - inter-correlation is averaged between the neighbors before argmax-ing, using
// first measurement - use as set in parameters
clt_parameters.rig.no_int_x0,// boolean no_int_x0, // do not offset window to integer maximum - used when averaging low textures to avoid "jumps" for very wide
threadsMax,// final int threadsMax, // maximal number of threads to launch
true,// boolean notch_mode, // use notch filter for inter-camera correlation to detect poles
0,// final int // low texture mode - inter-correlation is averaged between the neighbors before argmax-ing, using
// any - in notch mode it is disabled
clt_parameters.rig.no_int_x0,// boolean no_int_x0, // do not offset window to integer maximum - used when averaging low textures to avoid "jumps" for very wide
threadsMax,// final int threadsMax, // maximal number of threads to launch
false,// final boolean notch_mode, // use notch filter for inter-camera correlation to detect poles
0,// final int // low texture mode - inter-correlation is averaged between the neighbors before argmax-ing, using
// first measurement - use default value:
clt_parameters.rig.no_int_x0,// boolean no_int_x0, // do not offset window to integer maximum - used when averaging low textures to avoid "jumps" for very wide
threadsMax,// final int threadsMax, // maximal number of threads to launch
intgrow=clt_parameters.rig.ltavg_grow;// each 2 add 8 directions step. Odd have last step in 4 ortho directions only.
intshrink=clt_parameters.rig.ltavg_shrink;// shrink after expanding. Combination of both fills small gaps
// smoothing parameters
booleansmooth_strength=clt_parameters.rig.ltavg_smooth_strength;// provide tile strength when smoothing target disparity
doubleneib_pull=clt_parameters.rig.ltavg_neib_pull;// pull to weighted average relative to pull to the original disparity value. If 0.0 - will only update former NaN-s
lt_strength,// final double [] src_strength, // if not null will be used for weighted pull
lt_select,// final boolean [] selection,
neib_pull,// final double neib_pull, // pull to weighted average relative to pull to the original disparity value. If 0.0 - will only update former NaN-s
false,// boolean notch_mode, // use notch filter for inter-camera correlation to detect poles
lt_radius,// int lt_rad, // low texture mode - inter-correlation is averaged between the neighbors before argmax-ing, using (2*notch_mode+1)^2 square
// use set from parameters
clt_parameters.rig.no_int_x0,// boolean no_int_x0, // do not offset window to integer maximum - used when averaging low textures to avoid "jumps" for very wide
threadsMax,// final int threadsMax, // maximal number of threads to launch
updateStatus,// updateStatus, // final boolean updateStatus,
disparity_bimap[ImageDtt.BI_TARGET_INDEX],// ds1[0], // final double [] src_disparity,
null,// lt_strength, // final double [] src_strength, // if not null will be used for weighted pull
lt_select,// final boolean [] selection,
neib_pull,// final double neib_pull, // pull to weighted average relative to pull to the original disparity value. If 0.0 - will only update former NaN-s
false,// final boolean notch_mode, // use notch filter for inter-camera correlation to detect poles
0,// final int // low texture mode - inter-correlation is averaged between the neighbors before argmax-ing, using
// use default mode:
clt_parameters.rig.no_int_x0,// boolean no_int_x0, // do not offset window to integer maximum - used when averaging low textures to avoid "jumps" for very wide
threadsMax,// final int threadsMax, // maximal number of threads to launch
false,// final boolean notch_mode, // use notch filter for inter-camera correlation to detect poles
0,// final int // low texture mode - inter-correlation is averaged between the neighbors before argmax-ing, using
// first measurement - use default value:
clt_parameters.rig.no_int_x0,// boolean no_int_x0, // do not offset window to integer maximum - used when averaging low textures to avoid "jumps" for very wide
threadsMax,// final int threadsMax, // maximal number of threads to launch
false,// final boolean notch_mode, // use notch filter for inter-camera correlation to detect poles
0,// final int lt_rad, // low texture mode - inter-correlation is averaged between the neighbors before argmax-ing, using
clt_parameters.rig.no_int_x0,// final boolean no_int_x0, // do not offset window to integer maximum - used when averaging low textures to avoid "jumps" for very
threadsMax,// final int threadsMax, // maximal number of threads to launch
double[][]ml_data,// data for ML - 10 layers - 4 center areas (3x3, 5x5,..) per camera-per direction, 1 - composite, and 1 with just 1 data (target disparity)
booleannotch_mode,// use pole-detection mode for inter-camera correlation
finalintthreadsMax,// maximal number of threads to launch
finalbooleanupdateStatus,
finalintdebugLevel){
QuadCLTquadCLT_main,// tiles should be set
QuadCLTquadCLT_aux,
int[][]tile_op,// common for both amin and aux
double[][]disparity_array,
double[][]ml_data,// data for ML - 10 layers - 4 center areas (3x3, 5x5,..) per camera-per direction, 1 - composite, and 1 with just 1 data (target disparity)
booleannotch_mode,// use pole-detection mode for inter-camera correlation
intlt_rad,// low texture mode - inter-correlation is averaged between the neighbors before argmax-ing, using (2*notch_mode+1)^2 square
booleanno_int_x0,// do not offset window to integer maximum - used when averaging low textures to avoid "jumps" for very wide
finalintthreadsMax,// maximal number of threads to launch
finalbooleanupdateStatus,
finalintdebugLevel){
ImageDttimage_dtt=newImageDtt();
double[][]disparity_bimap=newdouble[ImageDtt.BIDISPARITY_TITLES.length][];//[0] -residual disparity, [1] - orthogonal (just for debugging) last 4 - max pixel differences
false,// final boolean notch_mode, // use notch filter for inter-camera correlation to detect poles
lt_rad,// final int // low texture mode - inter-correlation is averaged between the neighbors before argmax-ing, using
true,// whatever here. final boolean no_int_x0, // do not offset window to integer maximum - used when averaging low textures to avoid "jumps" for very
threadsMax,// maximal number of threads to launch // final int threadsMax, // maximal number of threads to launch