channels=this.pixelMapping.channelsForSubCamera(channels[0]-correctionsParameters.firstSubCameraConfig);// index in calibration files matching this source
if(!pixelMapping.subcamerasUsed()){
channels=pixelMapping.channelsForSubCamera(channels[0]-correctionsParameters.firstSubCameraConfig);// index in calibration files matching this source
}elseif(correctionsParameters.isJP4()){
intsubCamera=channels[0]-correctionsParameters.firstSubCamera;// to match those in the sensor files
double[][][][]dcorr_td=newdouble[tp_tasks.length][][][];// [tile][pair][4][64] sparse by pair transform domain representation of corr pairs
image_dtt.quadCorrTD(
scenes[nscene].getImageData(),// final double [][][] image_data, // first index - number of image in a quad
scenes[nscene].getErsCorrection().getSensorWH()[0],// final int width,
...
...
@@ -5631,8 +5651,9 @@ public double[][] correlateIntersceneDebug( // only uses GPU and quad
debug_level);//final int globalDebugLevel)
accumulateCorrelations(
tp_tasks,// final TpTask [] tp_tasks,
num_acc,// final int [][][] num_acc, // number of accumulated tiles [tilesY][tilesX][pair]
dcorr_td,// final double [][][][][] dcorr_td, // [pair][tilesY][tilesX][4][64] sparse transform domain representation of corr pairs
dcorr_td,// final double [][][][][] dcorr_td, // [tile][pair][4][64] sparse transform domain representation of corr pairs
dcorr_td_acc);// final double [][][][][] dcorr_td_acc // [pair][tilesY][tilesX][4][64] sparse transform domain representation of corr pairs
if((nscene==indx_ref)&&show_reference_correlations){// prepare 2d correlations for visualization, double/CPU mode
...
...
@@ -5642,18 +5663,21 @@ public double[][] correlateIntersceneDebug( // only uses GPU and quad
tp_tasks_ref,// final TpTask [] tp_tasks, // data from the reference frame - will be applied to LMW for the integrated correlations
// only listed tiles will be processed
ref_scene.getErsCorrection().getRXY(false),// final double [][] rXY, // from geometryCorrection
tilesX,// final int tilesX, // tp_tasks may lack maximal tileX, tileY
tilesY,// final int tilesY,
// no fcorr_combo_td here both arrays should have same non-null tiles
dcorr_td,// final double [][][][][] dcorr_td, // [pair][tilesY][tilesX][4][64] sparse transform domain representation of corr pairs
dcorr_td,// final double [][][][] dcorr_td, // [tile][pair][4][64] sparse by pair transform domain representation of corr pairs
null,// final double [] dcorr_weight, // [tile] weighted number of tiles averaged (divide squared fat zero by this)
// 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
null,// final double [][][][] clt_combo_out, // sparse (by the first index) [>=1][tilesY][tilesX][(combo_tile_size] or null
// 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
//optional, may be null
disparity_map,// final double [][] disparity_map, // [8][tilesY][tilesX], only [6][] is needed on input or null - do not calculate
true,// final boolean run_lma, // calculate LMA, false - CM only
// last 2 - contrast, avg/ "geometric average)
scaled_fat_zero,// clt_parameters.getGpuFatZero(ref_scene.isMonochrome()), // final double afat_zero2, // gpu_fat_zero ==30? clt_parameters.getGpuFatZero(is_mono); absolute fat zero, same units as components squared values
clt_parameters.getGpuFatZero(ref_scene.isMonochrome()),// clt_parameters.getGpuFatZero(ref_scene.isMonochrome()), // final double afat_zero2, // gpu_fat_zero ==30? clt_parameters.getGpuFatZero(is_mono); absolute fat zero, same units as components squared values
clt_parameters.gpu_sigma_m,// final double corr_sigma, //
// define combining of all 2D correlation pairs for CM (LMA does not use them)
...
...
@@ -5667,12 +5691,9 @@ public double[][] correlateIntersceneDebug( // only uses GPU and quad
clt_parameters.tileY,// final int debug_tileY,
threadsMax,// final int threadsMax, // maximal number of threads to launch
debug_level-1);// final int globalDebugLevel)
image_dtt.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
}
}
...
...
@@ -5688,6 +5709,14 @@ public double[][] correlateIntersceneDebug( // only uses GPU and quad
threadsMax,// final int threadsMax, // maximal number of threads to launch
image_dtt.clt_process_tl_correlations(// convert to pixel domain and process correlations already prepared in fcorr_td and/or fcorr_combo_td
clt_parameters.img_dtt,// final ImageDttParameters imgdtt_params, // Now just extra correlation parameters, later will include, most others
tp_tasks_ref,// final TpTask [] tp_tasks, // data from the reference frame - will be applied to LMW for the integrated correlations
// only listed tiles will be processed
ref_scene.getErsCorrection().getRXY(false),// final double [][] rXY, // from geometryCorrection
tilesX,// final int tilesX, // tp_tasks may lack maximal tileX, tileY
tilesY,// final int tilesY,
// no fcorr_combo_td here both arrays should have same non-null tiles
dcorr_td_acc,// final double [][][][][] dcorr_td, // [pair][tilesY][tilesX][4][64] sparse transform domain representation of corr pairs
dcorr_td,// final double [][][][] dcorr_td, // [tile][pair][4][64] sparse by pair transform domain representation of corr pairs
dcorr_weight,// final double [] dcorr_weight, // [tile] weighted number of tiles averaged (divide squared fat zero by this)
// 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
null,// final double [][][][] clt_combo_out, // sparse (by the first index) [>=1][tilesY][tilesX][(combo_tile_size] or null
// 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
//optional, may be null
disparity_map,// final double [][] disparity_map, // [8][tilesY][tilesX], only [6][] is needed on input or null - do not calculate
true,// final boolean run_lma, // calculate LMA, false - CM only
// last 2 - contrast, avg/ "geometric average)
scaled_fat_zero,// clt_parameters.getGpuFatZero(ref_scene.isMonochrome()), // final double afat_zero2, // gpu_fat_zero ==30? clt_parameters.getGpuFatZero(is_mono); absolute fat zero, same units as components squared values
clt_parameters.getGpuFatZero(ref_scene.isMonochrome()),// clt_parameters.getGpuFatZero(ref_scene.isMonochrome()), // final double afat_zero2, // gpu_fat_zero ==30? clt_parameters.getGpuFatZero(is_mono); absolute fat zero, same units as components squared values
clt_parameters.gpu_sigma_m,// final double corr_sigma, //
// define combining of all 2D correlation pairs for CM (LMA does not use them)
...
...
@@ -5786,7 +5827,6 @@ public double[][] correlateIntersceneDebug( // only uses GPU and quad
getGPU().updateQuadCLT(this);// to re-load new set of Bayer images to the GPU
}
...
...
@@ -2034,8 +2034,8 @@ public class QuadCLT extends QuadCLTCPU {
threadsMax,// final int threadsMax, // maximal number of threads to launch
false,// final boolean updateStatus,
debugLevel);// final int debugLevel);
FileSaverfs=newFileSaver(img_noise);
fs.saveAsTiff(file_path);
// FileSaver fs=new FileSaver(img_noise); // is null, will be saved inside to /home/elphel/lwir16-proc/proc1/results_cuda/1626032208_613623-AUX-SHIFTED-D0.0
// fs.saveAsTiff(file_path);
}
publicImagePlusprocessCLTQuadCorrGPU(
...
...
@@ -2054,7 +2054,7 @@ public class QuadCLT extends QuadCLTCPU {
if(gpuQuad==null){
System.out.println("GPU instance is not initialized, using CPU mode");
processCLTQuadCorrCPU(
imp_quad,// ImagePlus [] imp_quad, // should have properties "name"(base for saving results), "channel","path"
// imp_quad, // ImagePlus [] imp_quad, // should have properties "name"(base for saving results), "channel","path"
saturation_imp,// boolean [][] saturation_imp, // (near) saturated pixels or null // Not needed use this.saturation_imp
// System.out.println("Vignetting data for channel "+srcChannel+" has "+vign_pixels.length+" pixels, image "+sourceFiles[nFile]+" has "+pixels.length);
// System.out.println("Vignetting data for channel "+srcChannel+" has "+vign_pixels.length+" pixels, image "+sourceFiles[nFile]+" has "+pixels.length);