// link 1 (general): https://www.tensorflow.org/api_docs/java/reference/org/tensorflow/package-summary
// link 1 (general): https://www.tensorflow.org/api_docs/java/reference/org/tensorflow/package-summary
// link 2 (example of an TF & IJ plugin): https://github.com/google/microscopeimagequality/blob/main/microscopeimagequality/data/imagej/src/main/java/MicroscopeImageFocusQualityClassifier.java
// link 2 (example of an TF & IJ plugin): https://github.com/google/microscopeimagequality/blob/main/microscopeimagequality/data/imagej/src/main/java/MicroscopeImageFocusQualityClassifier.java
System.out.println("No files to process (of "+sourceFiles.length+")");
return;
}
double[]referenceExposures_main=quadCLT_main.eyesisCorrections.calcReferenceExposures(debugLevel);// multiply each image by this and divide by individual (if not NaN)
double[]referenceExposures_aux=quadCLT_aux.eyesisCorrections.calcReferenceExposures(debugLevel);// multiply each image by this and divide by individual (if not NaN)
thrownewException("Set names for cameras do not match: main camera: '"+set_channels_main[nSet].name()+"', aux. camera: '"+set_channels_main[nSet].name()+"'");
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
// 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
updateStatus,// final boolean updateStatus,
debugLevel);// final int debugLevel);
Runtime.getRuntime().gc();
if(debugLevel>-1)System.out.println("Processing set "+(nSet+1)+" (of "+set_channels_aux.length+") finished at "+
thrownewException("Set names for cameras do not match: main camera: '"+set_channels_main[nSet].name()+"', aux. camera: '"+set_channels_main[nSet].name()+"'");
thrownewException("Set names for cameras do not match: main camera: '"+set_channels_main[nSet].name()+"', aux. camera: '"+set_channels_main[nSet].name()+"'");
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
// 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
updateStatus,// final boolean updateStatus,
debugLevel);// final int debugLevel);
Runtime.getRuntime().gc();
if(debugLevel>-1)System.out.println("Processing set "+(nSet+1)+" (of "+set_channels_aux.length+") finished at "+
//TODO: Add array of default disparity - use for combining images in force disparity mode (no correlation), when disparity is predicted from other tiles
// start with all old arrays, remove some later
double[][][][]clt_corr_combo=null;
double[][][][]texture_tiles_main=null;// [tp.tilesY][tp.tilesX]["RGBA".length()][]; // tiles will be 16x16, 2 visualization mode full 16 or overlapped
double[][][][]texture_tiles_aux=null;// [tp.tilesY][tp.tilesX]["RGBA".length()][]; // tiles will be 16x16, 2 visualization mode full 16 or overlapped
// undecided, so 2 modes of combining alpha - same as rgb, or use center tile only
double[][]disparity_bimap=newdouble[ImageDtt.BIDISPARITY_TITLES.length][];//[0] -residual disparity, [1] - orthogonal (just for debugging) last 4 - max pixel differences
ImageDttimage_dtt=newImageDtt();
double[][]ml_data=null;
// int [][] woi_tops = {quadCLT_main.woi_tops,quadCLT_aux.woi_tops};
finaldouble[][][][][][][]clt_bidata=// new double[2][quad][nChn][tilesY][tilesX][][]; // first index - main/aux
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
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
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
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
clt_corr_combo,// final double [][][][] clt_corr_combo, // [type][tilesY][tilesX][(2*transform_size-1)*(2*transform_size-1)] // if null - will not calculate
// [type][tilesY][tilesX] should be set by caller
// types: 0 - selected correlation (product+offset), 1 - sum
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)
texture_tiles_main,// final double [][][][] texture_tiles_main, // [tilesY][tilesX]["RGBA".length()][]; null - will skip images combining
texture_tiles_aux,// final double [][][][] texture_tiles_aux, // [tilesY][tilesX]["RGBA".length()][]; null - will skip images combining
imp_quad_main[0].getWidth(),// final int width,
quadCLT_main.getGeometryCorrection(),// final GeometryCorrection geometryCorrection_main,
quadCLT_aux.getGeometryCorrection(),// final GeometryCorrection geometryCorrection_aux,
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
true,// final boolean keep_clt_data,
// woi_tops, // final int [][] woi_tops,
ers_delay,// final double [][][] ers_delay, // if not null - fill with tile center acquisition delay
threadsMax,// final int threadsMax, // maximal number of threads to launch
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
// 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
if(debugLevel>0){
// final boolean infinity_corr, // calculate and apply geometry correction at infinity
sdfa_instance.showArrays(clt,
threadsMax,// final int threadsMax, // maximal number of threads to launch