System.out.print(String.format("Tiles per quadrants :[%d, %d, %d, %d], tiles at infinity %d",pq[0],pq[1],pq[2],pq[3],num_inf));
System.out.println(String.format("Tiles per quadrants :[%d, %d, %d, %d], tiles at infinity %d",pq[0],pq[1],pq[2],pq[3],num_inf));
}
if(per_quad[1]<min_per_quadrant){
if(debugLevel>-20){
System.out.print(String.format("Too few tiles in quadrants :[%d, %d, %d, %d], minimum for the second worst is %d",pq[0],pq[1],pq[2],pq[3],min_per_quadrant));
System.out.println(String.format("Too few tiles in quadrants :[%d, %d, %d, %d], minimum for the second worst is %d",pq[0],pq[1],pq[2],pq[3],min_per_quadrant));
}
returnnull;
}
if(num_inf<min_inf){
if(debugLevel>-20){
System.out.print(String.format("Too few tiles at infinity: %d minimum is %d",num_inf,min_inf));
System.out.println(String.format("Too few tiles at infinity: %d minimum is %d",num_inf,min_inf));
}
returnnull;
}
...
...
@@ -2810,19 +2810,19 @@ B = |+dy0 -dy1 -2*dy3 |
Arrays.sort(per_quad);
if(per_quad[1]<min_per_quadrant){
if(debugLevel>-20){
System.out.print(String.format("Too few tiles in quadrants :[%d, %d, %d, %d], minimum for the second worst is %d",pq[0],pq[1],pq[2],pq[3],min_per_quadrant));
System.out.println(String.format("Too few tiles in quadrants :[%d, %d, %d, %d], minimum for the second worst is %d",pq[0],pq[1],pq[2],pq[3],min_per_quadrant));
}
returnnull;
}
if(num_inf<min_inf){
if(debugLevel>-20){
System.out.print(String.format("Too few tiles at infinity (<%4f): %d minimum is %d",inf_max_disparity,num_inf,min_inf));
System.out.println(String.format("Too few tiles at infinity (<%4f): %d minimum is %d",inf_max_disparity,num_inf,min_inf));
}
returnnull;
}
if(debugLevel>-20){
System.out.print(String.format("Tiles per quadrants :[%d, %d, %d, %d], tiles at infinity %d",pq[0],pq[1],pq[2],pq[3],num_inf));
System.out.println(String.format("Tiles per quadrants :[%d, %d, %d, %d], tiles at infinity %d",pq[0],pq[1],pq[2],pq[3],num_inf));
finaldouble[][]lt_corr=(lt_rad>0)?(newdouble[nTilesInChn][]):null;// will keep inter-camera combo correlation, later combined in a separate multi-thread run
...
...
@@ -8824,9 +8840,18 @@ public class ImageDtt {
finalThread[]threads=newThreadArray(threadsMax);
finalAtomicIntegerai=newAtomicInteger(0);
finaldouble[]col_weights=newdouble[numcol];// colors are RBG
col_weights[2]=1.0/(1.0+clt_parameters.corr_red+clt_parameters.corr_blue);// green color
finalMatrix[]corr_rots_aux=calc_aux?geometryCorrection_aux.getCorrVector().getRotMatrices(rigMatrix):null;// get array of per-sensor rotation matrices (will be OK if (rigMatrix==null)
publicdouble[][]dsi_aux_from_main;// Main camera DSI converted into the coordinates of the AUX one (see QuadCLT.FGBG_TITLES)-added two slises from aux ds
imp_ml.setProperty("comment_ML_OTHER_TARGET","Offset of the target disparity in the \"other\" layer tile");
imp_ml.setProperty("comment_ML_OTHER_GTRUTH","Offset of the ground truth disparity in the \"other\" layer tile");
imp_ml.setProperty("comment_ML_OTHER_GTRUTH_STRENGTH","Offset of the ground truth strength in the \"other\" layer tile");
imp_ml.setProperty("comment_data_min","Defined only for 8bpp mode - value, corresponding to -127 (-128 is NaN)");
imp_ml.setProperty("comment_data_max","Defined only for 8bpp mode - value, corresponding to +127 (-128 is NaN)");
imp_ml.setProperty("comment_disparityRadiusMain","Side of the square where 4 main camera subcameras are located (mm)");
if(aux_mode){
imp_ml.setProperty("comment_ML_OTHER_GTRUTH_RMS","Offset of the GT disparity RMS");
imp_ml.setProperty("comment_ML_OTHER_GTRUTH_RMS_SPLIT","Offset of the GT disparity RMS combined from FG and BG");
imp_ml.setProperty("comment_ML_OTHER_GTRUTH_FG_DISP","Offset of the GT FG disparity");
imp_ml.setProperty("comment_ML_OTHER_GTRUTH_FG_STR","Offset of the GT FG strength");
imp_ml.setProperty("comment_ML_OTHER_GTRUTH_BG_DISP","Offset of the GT BG disparity");
imp_ml.setProperty("comment_ML_OTHER_GTRUTH_BG_STR","Offset of the GT BG strength");
}
if(use8bpp){
imp_ml.setProperty("comment_data_min","Defined only for 8bpp mode - value, corresponding to -127 (-128 is NaN)");
imp_ml.setProperty("comment_data_max","Defined only for 8bpp mode - value, corresponding to +127 (-128 is NaN)");
}
if(has_main){
imp_ml.setProperty("comment_disparityRadiusMain","Side of the square where 4 main camera subcameras are located (mm)");
imp_ml.setProperty("comment_intercameraBaseline","Horizontal distance between the main and the auxiliary camera centers (mm). Disparity is specified for the main camera");
}
imp_ml.setProperty("comment_disparityRadiusAux","Side of the square where 4 main camera subcameras are located (mm). Disparity is specified for the main camera");
imp_ml.setProperty("comment_intercameraBaseline","Horizontal distance between the main and the auxiliary camera centers (mm). Disparity is specified for the main camera");
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)
CLTParametersclt_parameters,
doublefatzero,
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
double[][]disparity_bimap=newdouble[ImageDtt.BIDISPARITY_TITLES.length][];//[0] -residual disparity, [1] - orthogonal (just for debugging) last 4 - max pixel differences
image_dtt.clt_bi_quad(
clt_parameters,// final EyesisCorrectionParameters.CLTParameters clt_parameters,
fatzero,// 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
lt_rad,// final int lt_rad, // low texture mode - inter-correlation is averaged between the neighbors before argmax-ing, using
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 wide
tile_op,// final int [][] tile_op_main, // [tilesY][tilesX] - what to do - 0 - nothing for this tile
null,// quadCLT_main.image_data, // final double [][][] image_data_main, // first index - number of image in a quad
quadCLT_aux.image_data,// final double [][][] image_data_aux, // first index - number of image in a quad
null,// quadCLT_main.saturation_imp, // final boolean [][] saturation_main, // (near) saturated pixels or null
quadCLT_aux.saturation_imp,// final boolean [][] saturation_aux, // (near) saturated pixels or null
// correlation results - combo will be for the correation between two quad cameras
null,// final double [][][][] clt_corr_combo, // [type][tilesY][tilesX][(2*transform_size-1)*(2*transform_size-1)] // if null - will not calculate
disparity_bimap,// final double [][] disparity_bimap, // [23][tilesY][tilesX]
ml_data,// final 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)
null,// final double [][][][] texture_tiles_main, // [tilesY][tilesX]["RGBA".length()][]; null - will skip images combining
null,// final double [][][][] texture_tiles_aux, // [tilesY][tilesX]["RGBA".length()][]; null - will skip images combining
// quadCLT_main.tp.getTilesX()*clt_parameters.transform_size, // final int width,
quadCLT_aux.tp.getTilesX()*clt_parameters.transform_size,// final int width,
null,// quadCLT_main.getGeometryCorrection(), // final GeometryCorrection geometryCorrection_main,
quadCLT_aux.getGeometryCorrection(),// final GeometryCorrection geometryCorrection_aux,
null,// quadCLT_main.getCLTKernels(), // final double [][][][][][] clt_kernels_main, // [channel_in_quad][color][tileY][tileX][band][pixel] , size should match image (have 1 tile around)
quadCLT_aux.getCLTKernels(),// final double [][][][][][] clt_kernels_aux, // [channel_in_quad][color][tileY][tileX][band][pixel] , size should match image (have 1 tile around)
clt_parameters.corr_magic_scale,// final double corr_magic_scale, // still not understood coefficient that reduces reported disparity value. Seems to be around 0.85
false,// true, // final boolean keep_clt_data,
null,// final double [][][] ers_delay, // if not null - fill with tile center acquisition delay
threadsMax,// final int threadsMax, // maximal number of threads to launch
debugLevel-2);// final int globalDebugLevel);
returndisparity_bimap;
}
publicdouble[][]remeasureAuxML(
QuadCLTquadCLT_aux,
double[]disparity,// Double.NaN - do not measure
double[][]dsi_aux_from_main,// Main camera DSI converted into the coordinates of the AUX one (see QuadCLT.FGBG_TITLES)-
CLTParametersclt_parameters,
intml_hwidth,
doublefatzero,
finalintthreadsMax,// maximal number of threads to launch
finalbooleanupdateStatus,
finalintdebugLevel){
inttile_op_all=clt_parameters.tile_task_op;//FIXME Use some constant?
tile_op,// int [][] tile_op, // common for both amin and aux
disparity_array,// double [][] disparity_array,
ml_data,// 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)
false,// final boolean notch_mode, // use notch filter for inter-camera correlation to detect poles
0,// 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
Stringx3d_path=quadCLT_main.correctionsParameters.selectX3dDirectory(// for x3d and obj
quadCLT_main.correctionsParameters.getModelName(quadCLT_main.image_name),// quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false
Stringx3d_path=quadCLT_main.correctionsParameters.selectX3dDirectory(// for x3d and obj
quadCLT_main.correctionsParameters.getModelName(quadCLT_main.image_name),// quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false