doublecuas_initial_disparity=clt_parameters.imp.cuas_initial_disparity;// 1.0; // Start correlation with this disparity (in addition to infinity) after reset
doublecuas_infinity=clt_parameters.imp.cuas_infinity;// 0.63; // disparity at infinity for targets
finalinttilesX=center_CLT.getTilesX();
finalinttilesY=center_CLT.getTilesY();
// final int frame_center = cuasMotion.getFrameCenter(nseq); // for debug only
finalbooleanuse_non_lma=false;
// TODO: move to parameters!
finaldoubleworsen_str=0.3;// 9; // do not update if new strength is below worsen_str * old_str
// Show disparity_map;
StringBuffersb=null;
StringBuffersb_full=null;
StringBuffersb_last=null;
if(log_ranging){
sb=newStringBuffer();
sb_full=newStringBuffer();
}
intrefine_vfy=0;// on which refine step to generate verify images
imgdtt_params,// clt_parameters.img_dtt, // final ImageDttParameters imgdtt_params, // Now just extra correlation parameters, later will include, most others
tp_tasks[0],// *** will be updated inside from GPU-calculated geometry
gpu_sigma_rb_corr,// final double gpu_sigma_rb_corr, // = 0.5; // apply LPF after accumulating R and B correlation before G, monochrome ? 1.0 : gpu_sigma_rb_corr;
gpu_sigma_corr,// = 0.9;gpu_sigma_corr_m
gpu_sigma_log_corr,// final double gpu_sigma_log_corr, // hpf to reduce dynamic range for correlations
clt_parameters.corr_red,// +used
clt_parameters.corr_blue,// +used
mcorr_sel,// final int mcorr_sel, // Which pairs to correlate // +1 - all, +2 - dia, +4 - sq, +8 - neibs, +16 - hor + 32 - vert
ImageDtt.THREADS_MAX,// maximal number of threads to launch
fcorr_td_acc[tileY0][tileX0]);// float [][] fcorr_td_acc // [pair][256] sparse transform domain representation of corr pairs // should not be null, same length as fcorr_td
image_dtt.clt_process_tl_correlations(// convert to pixel domain and process correlations already prepared in fcorr_td and/or fcorr_combo_td
imgdtt_params,// clt_parameters.img_dtt, // final ImageDttParameters imgdtt_params, // Now just extra correlation parameters, later will include, most others
fcorr_td_acc,// final float [][][][] fcorr_td, // [tilesY][tilesX][pair][4*64] transform domain representation of all selected corr pairs
accum_weights,// float [][][] num_acc, // number of accumulated tiles [tilesY][tilesX][pair] (or null)
null,// dcorr_weight, // double [] dcorr_weight, // alternative to num_acc, compatible with CPU processing (only one non-zero enough)
// clt_parameters.getGpuFatZero(center_CLT.isMonochrome()), // final double gpu_fat_zero, // clt_parameters.getGpuFatZero(is_mono);absolute == 30.0
rng_fz,// final double gpu_fat_zero, // clt_parameters.getGpuFatZero(is_mono);absolute == 30.0
image_dtt.transform_size-1,// final int gpu_corr_rad, // = transform_size - 1 ?
// The tp_tasks data should be decoded from GPU to get coordinates
tp_tasks_ref[0],// final TpTask [] tp_tasks, // data from the reference frame - will be applied to LMW for the integrated correlations
null,// final double [][] far_fgbg, // null, or [nTile]{disp(fg)-disp(bg), str(fg)-str(bg)} hints for LMA FG/BG split
center_CLT.getErsCorrection().getRXY(false),// final double [][] rXY, // from geometryCorrection
// next both can be nulls
null,// final double [][][][] clt_corr_out, // sparse (by the first index) [type][tilesY][tilesX][(2*transform_size-1)*(2*transform_size-1)] or null
// combo will be added as extra pair if mcorr_comb_width > 0 and clt_corr_out has a slot for it
// to be converted to float
dcorr_tiles,// final double [][][] dcorr_tiles, // [tile][pair][(2*transform_size-1)*(2*transform_size-1)] // if null - will not calculate
// When clt_mismatch is non-zero, no far objects extraction will be attempted
use_rms,// final boolean use_rms, // DISPARITY_STRENGTH_INDEX means LMA RMS (18/04/2023)
//optional, may be null
disparity_map,// final double [][] disparity_map, // [8][tilesY][tilesX], only [6][] is needed on input or null - do not calculate
null,// final double [][] ddnd, // data for LY. SHould be either null or [num_sensors][]
clt_parameters.correlate_lma,// final boolean run_lma, // calculate LMA, false - CM only
// define combining of all 2D correlation pairs for CM (LMA does not use them)
imgdtt_params.mcorr_comb_width,//final int mcorr_comb_width, // combined correlation tile width (set <=0 to skip combined correlations)
imgdtt_params.mcorr_comb_height,//final int mcorr_comb_height, // combined correlation tile full height
imgdtt_params.mcorr_comb_offset,//final int mcorr_comb_offset, // combined correlation tile height offset: 0 - centered (-height/2 to height/2), height/2 - only positive (0 to height)
imgdtt_params.mcorr_comb_disp,//final double mcorr_comb_disp, // Combined tile per-pixel disparity for baseline == side of a square
clt_parameters.clt_window,// final int window_type, // GPU: will not be used
clt_parameters.tileX,// final int debug_tileX,
clt_parameters.tileY,// final int debug_tileY,
ImageDtt.THREADS_MAX,// final int threadsMax, // maximal number of threads to launch
"accumulated",// final String debug_suffix,
debugLevel+0);// 2); // -1 ); // final int globalDebugLevel)
ImageDtt.convertFcltCorr(
dcorr_tiles,// double [][][] dcorr_tiles,// [tile][sparse, correlation pair][(2*transform_size-1)*(2*transform_size-1)] // if null - will not calculate
fclt_corr);// float [][][] fclt_corr) // new float [tilesX * tilesY][][] or null
if(show_corr||(accum_2d_corr!=null)){// -1
float[][]accum_2d_img=ImageDtt.corr_partial_dbg(// not used in lwir
fclt_corr,// final float [][][] fcorr_data, // [tile][pair][(2*transform_size-1)*(2*transform_size-1)] // if null - will not calculate
tp_tasks_ref[0],// final TpTask [] tp_tasks, //
tilesX,//final int tilesX,
tilesY,//final int tilesX,
2*image_dtt.transform_size-1,// final int corr_size,
1000,// will be limited by available layersfinal int layers0,
clt_parameters.corr_border_contrast,// final double border_contrast,
ImageDtt.THREADS_MAX,// final int threadsMax, // maximal number of threads to launch