Commit 4282653c authored by Andrey Filippov's avatar Andrey Filippov

Added scene sequence processing and ML generation to LWIR batch

parent 8814cdd9
...@@ -165,6 +165,19 @@ public class EyesisCorrectionParameters { ...@@ -165,6 +165,19 @@ public class EyesisCorrectionParameters {
public boolean clt_batch_save_extrinsics = true; // Save cameras extrinsic parameters with the model public boolean clt_batch_save_extrinsics = true; // Save cameras extrinsic parameters with the model
public boolean clt_batch_save_all = true; // Save all parameters with the model public boolean clt_batch_save_all = true; // Save all parameters with the model
public boolean clt_batch_skip_scenes = false; // Skip all per-scene processing, go directly to processing sequences
public boolean clt_batch_pose_pairs_main = false; // calculate pair-wise camera poses
public boolean clt_batch_pose_last_main = false; // calculate camera poses realtive to the last scene
public boolean clt_batch_pose_scene_main = false; // calculate camera poses relative to all other ones
public boolean clt_batch_ml_last_main = false; // export ML files for the last (reference scene)
public boolean clt_batch_ml_all_main = false; // export ML files for all available reference scenes
public boolean clt_batch_pose_pairs_aux = false; // calculate pair-wise camera poses
public boolean clt_batch_pose_last_aux = false; // calculate camera poses realtive to the last scene
public boolean clt_batch_pose_scene_aux = false; // calculate camera poses relative to all other ones
public boolean clt_batch_ml_last_aux = false; // export ML files for the last (reference scene)
public boolean clt_batch_ml_all_aux = false; // export ML files for all available reference scenes
public String x3dModelVersion="v01"; public String x3dModelVersion="v01";
...@@ -307,6 +320,20 @@ public class EyesisCorrectionParameters { ...@@ -307,6 +320,20 @@ public class EyesisCorrectionParameters {
cp.clt_batch_save_extrinsics= this.clt_batch_save_extrinsics; cp.clt_batch_save_extrinsics= this.clt_batch_save_extrinsics;
cp.clt_batch_save_all= this.clt_batch_save_all; cp.clt_batch_save_all= this.clt_batch_save_all;
cp.clt_batch_skip_scenes= this.clt_batch_skip_scenes;
cp.clt_batch_pose_pairs_main= this.clt_batch_pose_pairs_main;
cp.clt_batch_pose_last_main= this.clt_batch_pose_last_main;
cp.clt_batch_pose_scene_main= this.clt_batch_pose_scene_main;
cp.clt_batch_ml_last_main= this.clt_batch_ml_last_main;
cp.clt_batch_ml_all_main= this.clt_batch_ml_all_main;
cp.clt_batch_pose_pairs_aux= this.clt_batch_pose_pairs_aux;
cp.clt_batch_pose_last_aux= this.clt_batch_pose_last_aux;
cp.clt_batch_pose_scene_aux= this.clt_batch_pose_scene_aux;
cp.clt_batch_ml_last_aux= this.clt_batch_ml_last_aux;
cp.clt_batch_ml_all_aux= this.clt_batch_ml_all_aux;
cp.thumb_overwrite = this.thumb_overwrite; cp.thumb_overwrite = this.thumb_overwrite;
cp.thumb_width = this.thumb_width; cp.thumb_width = this.thumb_width;
...@@ -488,6 +515,20 @@ public class EyesisCorrectionParameters { ...@@ -488,6 +515,20 @@ public class EyesisCorrectionParameters {
properties.setProperty(prefix+"clt_batch_save_extrinsics", this.clt_batch_save_extrinsics+""); properties.setProperty(prefix+"clt_batch_save_extrinsics", this.clt_batch_save_extrinsics+"");
properties.setProperty(prefix+"clt_batch_save_all", this.clt_batch_save_all+""); properties.setProperty(prefix+"clt_batch_save_all", this.clt_batch_save_all+"");
properties.setProperty(prefix+"clt_batch_skip_scenes", this.clt_batch_skip_scenes+"");
properties.setProperty(prefix+"clt_batch_pose_pairs_main", this.clt_batch_pose_pairs_main+"");
properties.setProperty(prefix+"clt_batch_pose_last_main", this.clt_batch_pose_last_main+"");
properties.setProperty(prefix+"clt_batch_pose_scene_main", this.clt_batch_pose_scene_main+"");
properties.setProperty(prefix+"clt_batch_ml_last_main", this.clt_batch_ml_last_main+"");
properties.setProperty(prefix+"clt_batch_ml_all_main", this.clt_batch_ml_all_main+"");
properties.setProperty(prefix+"clt_batch_pose_pairs_aux", this.clt_batch_pose_pairs_aux+"");
properties.setProperty(prefix+"clt_batch_pose_last_aux", this.clt_batch_pose_last_aux+"");
properties.setProperty(prefix+"clt_batch_pose_scene_aux", this.clt_batch_pose_scene_aux+"");
properties.setProperty(prefix+"clt_batch_ml_last_aux", this.clt_batch_ml_last_aux+"");
properties.setProperty(prefix+"clt_batch_ml_all_aux", this.clt_batch_ml_all_aux+"");
properties.setProperty(prefix+"thumb_overwrite", this.thumb_overwrite+""); properties.setProperty(prefix+"thumb_overwrite", this.thumb_overwrite+"");
properties.setProperty(prefix+"thumb_width", this.thumb_width+""); properties.setProperty(prefix+"thumb_width", this.thumb_width+"");
properties.setProperty(prefix+"thumb_height", this.thumb_height+""); properties.setProperty(prefix+"thumb_height", this.thumb_height+"");
...@@ -647,6 +688,20 @@ public class EyesisCorrectionParameters { ...@@ -647,6 +688,20 @@ public class EyesisCorrectionParameters {
if (properties.getProperty(prefix+"clt_batch_save_extrinsics")!= null) this.clt_batch_save_extrinsics=Boolean.parseBoolean(properties.getProperty(prefix+"clt_batch_save_extrinsics")); if (properties.getProperty(prefix+"clt_batch_save_extrinsics")!= null) this.clt_batch_save_extrinsics=Boolean.parseBoolean(properties.getProperty(prefix+"clt_batch_save_extrinsics"));
if (properties.getProperty(prefix+"clt_batch_save_all")!= null) this.clt_batch_save_all=Boolean.parseBoolean(properties.getProperty(prefix+"clt_batch_save_all")); if (properties.getProperty(prefix+"clt_batch_save_all")!= null) this.clt_batch_save_all=Boolean.parseBoolean(properties.getProperty(prefix+"clt_batch_save_all"));
if (properties.getProperty(prefix+"clt_batch_skip_scenes")!= null) this.clt_batch_skip_scenes=Boolean.parseBoolean(properties.getProperty(prefix+"clt_batch_skip_scenes"));
if (properties.getProperty(prefix+"clt_batch_pose_pairs_main")!= null) this.clt_batch_pose_pairs_main=Boolean.parseBoolean(properties.getProperty(prefix+"clt_batch_pose_pairs_main"));
if (properties.getProperty(prefix+"clt_batch_pose_last_main")!= null) this.clt_batch_pose_last_main=Boolean.parseBoolean(properties.getProperty(prefix+"clt_batch_pose_last_main"));
if (properties.getProperty(prefix+"clt_batch_pose_scene_main")!= null) this.clt_batch_pose_scene_main=Boolean.parseBoolean(properties.getProperty(prefix+"clt_batch_pose_scene_main"));
if (properties.getProperty(prefix+"clt_batch_ml_last_main")!= null) this.clt_batch_ml_last_main=Boolean.parseBoolean(properties.getProperty(prefix+"clt_batch_ml_last_main"));
if (properties.getProperty(prefix+"clt_batch_ml_all_main")!= null) this.clt_batch_ml_all_main=Boolean.parseBoolean(properties.getProperty(prefix+"clt_batch_ml_all_main"));
if (properties.getProperty(prefix+"clt_batch_pose_pairs_aux")!= null) this.clt_batch_pose_pairs_aux=Boolean.parseBoolean(properties.getProperty(prefix+"clt_batch_pose_pairs_aux"));
if (properties.getProperty(prefix+"clt_batch_pose_last_aux")!= null) this.clt_batch_pose_last_aux=Boolean.parseBoolean(properties.getProperty(prefix+"clt_batch_pose_last_aux"));
if (properties.getProperty(prefix+"clt_batch_pose_scene_aux")!= null) this.clt_batch_pose_scene_aux=Boolean.parseBoolean(properties.getProperty(prefix+"clt_batch_pose_scene_aux"));
if (properties.getProperty(prefix+"clt_batch_ml_last_aux")!= null) this.clt_batch_ml_last_aux=Boolean.parseBoolean(properties.getProperty(prefix+"clt_batch_ml_last_aux"));
if (properties.getProperty(prefix+"clt_batch_ml_all_aux")!= null) this.clt_batch_ml_all_aux=Boolean.parseBoolean(properties.getProperty(prefix+"clt_batch_ml_all_aux"));
if (properties.getProperty(prefix+"thumb_overwrite")!= null) this.thumb_overwrite=Boolean.parseBoolean(properties.getProperty(prefix+"thumb_overwrite")); if (properties.getProperty(prefix+"thumb_overwrite")!= null) this.thumb_overwrite=Boolean.parseBoolean(properties.getProperty(prefix+"thumb_overwrite"));
if (properties.getProperty(prefix+"thumb_width")!=null) this.thumb_width=Integer.parseInt(properties.getProperty(prefix+"thumb_width")); if (properties.getProperty(prefix+"thumb_width")!=null) this.thumb_width=Integer.parseInt(properties.getProperty(prefix+"thumb_width"));
if (properties.getProperty(prefix+"thumb_height")!=null) this.thumb_height=Integer.parseInt(properties.getProperty(prefix+"thumb_height")); if (properties.getProperty(prefix+"thumb_height")!=null) this.thumb_height=Integer.parseInt(properties.getProperty(prefix+"thumb_height"));
...@@ -1018,7 +1073,7 @@ public class EyesisCorrectionParameters { ...@@ -1018,7 +1073,7 @@ public class EyesisCorrectionParameters {
"Save main camera, dual-quad rig and optionally aux camera combo DSI image with the model"); "Save main camera, dual-quad rig and optionally aux camera combo DSI image with the model");
gd.addCheckbox ("Include/genarate separate aux camera DSI data in the combo DSI", this.clt_batch_dsi_aux, gd.addCheckbox ("Include/genarate separate aux camera DSI data in the combo DSI", this.clt_batch_dsi_aux,
"8-rig: DSI for the AUX camera is offset (by the rig baseline) from the main and rig DSI. Aux DSI requires extra processing time."+ "8-rig: DSI for the AUX camera is offset (by the rig baseline) from the main and rig DSI. Aux DSI requires extra processing time."+
" EO+LWIR - generate a separate GT+AUX file"); "EO+LWIR - generate a separate GT+AUX file");
gd.addCheckbox ("Additional steps to calculate Aux DSI (more than for LY adjustment)", this.clt_batch_dsi_aux_full, gd.addCheckbox ("Additional steps to calculate Aux DSI (more than for LY adjustment)", this.clt_batch_dsi_aux_full,
"(Not yet tested)"); "(Not yet tested)");
...@@ -1028,7 +1083,32 @@ public class EyesisCorrectionParameters { ...@@ -1028,7 +1083,32 @@ public class EyesisCorrectionParameters {
gd.addCheckbox ("Save all parameters with the model", this.clt_batch_save_all, gd.addCheckbox ("Save all parameters with the model", this.clt_batch_save_all,
"Save a copy of all parameters with the model"); "Save a copy of all parameters with the model");
gd.addMessage ("============ LWIR16 processing ============");
gd.addCheckbox ("Skip scenes processing", this.clt_batch_skip_scenes,
"Skip all per-scene processing, go directly to processing sequences");
gd.addMessage ("============ RGB cameras ============");
gd.addCheckbox ("RGB: Calculate pair-wise camera poses", this.clt_batch_pose_pairs_main,
"RGB: Relative poses are calculated for pairs of consecututive scenes. Requires DSI for each scene");
gd.addCheckbox ("RGB: Scene poses relative to the last", this.clt_batch_pose_last_main,
"RGB: Relative camera poses to the reference (last) scene");
gd.addCheckbox ("RGB: Scene poses relative to others", this.clt_batch_pose_scene_main,
"RGB: Camera poses relative to all other scenes in the series, not just relative to the latest (not yet implemented)");
gd.addCheckbox ("RGB: Generate ML files for the last scene", this.clt_batch_ml_last_main,
"RGB: Generate ML output files for the last scene, requres 'Scene poses relative to the last'");
gd.addCheckbox ("RGB: Generate ML files for each scene", this.clt_batch_ml_all_main,
"RGB: Requires 'Scene poses relative to others', not yet implemented");
gd.addMessage ("============ LWIR cameras ============");
gd.addCheckbox ("LWIR: Calculate pair-wise camera poses", this.clt_batch_pose_pairs_aux,
"LWIR: Relative poses are calculated for pairs of consecututive scenes. Requires DSI for each scene");
gd.addCheckbox ("LWIR: Scene poses relative to the last", this.clt_batch_pose_last_aux,
"LWIR: Relative camera poses to the reference (last) scene");
gd.addCheckbox ("LWIR: Scene poses relative to others", this.clt_batch_pose_scene_aux,
"LWIR: Camera poses relative to all other scenes in the series, not just relative to the latest (not yet implemented)");
gd.addCheckbox ("LWIR: Generate ML files for the last scene", this.clt_batch_ml_last_aux,
"LWIR: Generate ML output files for the last scene, requres 'Scene poses relative to the last'");
gd.addCheckbox ("LWIR: Generate ML files for each scene", this.clt_batch_ml_all_aux,
"LWIR: Requires 'Scene poses relative to others', not yet implemented");
if (clt_parameters != null) { if (clt_parameters != null) {
// gd.addMessage ("============ selected CLT parameters ============"); // gd.addMessage ("============ selected CLT parameters ============");
...@@ -1114,6 +1194,21 @@ public class EyesisCorrectionParameters { ...@@ -1114,6 +1194,21 @@ public class EyesisCorrectionParameters {
this.clt_batch_dsi_aux_full= gd.getNextBoolean(); this.clt_batch_dsi_aux_full= gd.getNextBoolean();
this.clt_batch_save_extrinsics= gd.getNextBoolean(); this.clt_batch_save_extrinsics= gd.getNextBoolean();
this.clt_batch_save_all= gd.getNextBoolean(); this.clt_batch_save_all= gd.getNextBoolean();
this.clt_batch_skip_scenes= gd.getNextBoolean();
this.clt_batch_pose_pairs_main= gd.getNextBoolean();
this.clt_batch_pose_last_main= gd.getNextBoolean();
this.clt_batch_pose_scene_main= gd.getNextBoolean();
this.clt_batch_ml_last_main= gd.getNextBoolean();
this.clt_batch_ml_all_main= gd.getNextBoolean();
this.clt_batch_pose_pairs_aux= gd.getNextBoolean();
this.clt_batch_pose_last_aux= gd.getNextBoolean();
this.clt_batch_pose_scene_aux= gd.getNextBoolean();
this.clt_batch_ml_last_aux= gd.getNextBoolean();
this.clt_batch_ml_all_aux= gd.getNextBoolean();
if (clt_parameters != null) { if (clt_parameters != null) {
clt_parameters.grow_disp_max = gd.getNextNumber(); clt_parameters.grow_disp_max = gd.getNextNumber();
clt_parameters.gain_equalize = gd.getNextBoolean(); clt_parameters.gain_equalize = gd.getNextBoolean();
......
...@@ -476,7 +476,7 @@ public class ImagejJp4Tiff { ...@@ -476,7 +476,7 @@ public class ImagejJp4Tiff {
Date startDate = dateFormat.parse(FIXCH6_EARLIEST); Date startDate = dateFormat.parse(FIXCH6_EARLIEST);
Date endDate = dateFormat.parse(FIXCH6_LATEST); Date endDate = dateFormat.parse(FIXCH6_LATEST);
Date fileDate = dateFormat.parse(sfdate); Date fileDate = dateFormat.parse(sfdate);
if (fileDate.before(startDate) && fileDate.after(endDate)) { if (fileDate.before(startDate) || fileDate.after(endDate)) {
return -3; // too early or too late return -3; // too early or too late
} }
} catch (ParseException e) { } catch (ParseException e) {
......
...@@ -3289,6 +3289,7 @@ public class OpticalFlow { ...@@ -3289,6 +3289,7 @@ public class OpticalFlow {
clt_parameters.inp.show_final_2d, // final boolean show_2d_corr, clt_parameters.inp.show_final_2d, // final boolean show_2d_corr,
mcorr_sel, // final int mcorr_sel, // = Correlation2d.corrSelEncode(clt_parameters.img_dtt,scenes[nscene].getNumSensors()); mcorr_sel, // final int mcorr_sel, // = Correlation2d.corrSelEncode(clt_parameters.img_dtt,scenes[nscene].getNumSensors());
null, // final float [][][] accum_2d_corr, // if [1][][] - return accumulated 2d correlations (all pairs) null, // final float [][][] accum_2d_corr, // if [1][][] - return accumulated 2d correlations (all pairs)
false, // final boolean no_map, // do not generate disparity_map (time-consuming LMA)
debug_level-5); // final int debug_level) debug_level-5); // final int debug_level)
Runtime.getRuntime().gc(); Runtime.getRuntime().gc();
...@@ -3344,7 +3345,7 @@ public class OpticalFlow { ...@@ -3344,7 +3345,7 @@ public class OpticalFlow {
tilesX, // int width, tilesX, // int width,
tilesY); // int height) tilesY); // int height)
// save _DSI_INTER - sema format, as _DSI_MAIN, it will be used instead of _DSI_MAIN next time // save _DSI_INTER - same format, as _DSI_MAIN, it will be used instead of _DSI_MAIN next time
double [][] dsi = new double [TwoQuadCLT.DSI_SLICES.length][]; double [][] dsi = new double [TwoQuadCLT.DSI_SLICES.length][];
dsi[ref_scene.is_aux?TwoQuadCLT.DSI_DISPARITY_AUX:TwoQuadCLT.DSI_DISPARITY_MAIN] = combo_dsn_change[0]; dsi[ref_scene.is_aux?TwoQuadCLT.DSI_DISPARITY_AUX:TwoQuadCLT.DSI_DISPARITY_MAIN] = combo_dsn_change[0];
dsi[ref_scene.is_aux?TwoQuadCLT.DSI_STRENGTH_AUX:TwoQuadCLT.DSI_STRENGTH_MAIN] = combo_dsn_change[1]; dsi[ref_scene.is_aux?TwoQuadCLT.DSI_STRENGTH_AUX:TwoQuadCLT.DSI_STRENGTH_MAIN] = combo_dsn_change[1];
...@@ -3895,6 +3896,7 @@ public class OpticalFlow { ...@@ -3895,6 +3896,7 @@ public class OpticalFlow {
( nrefine == (max_refines - 1)) && clt_parameters.inp.show_final_2d, // final boolean show_2d_corr, ( nrefine == (max_refines - 1)) && clt_parameters.inp.show_final_2d, // final boolean show_2d_corr,
mcorr_sel, // final int mcorr_sel, // = mcorr_sel, // final int mcorr_sel, // =
null, // final float [][][] accum_2d_corr, // if [1][][] - return accumulated 2d correlations (all pairs) null, // final float [][][] accum_2d_corr, // if [1][][] - return accumulated 2d correlations (all pairs)
false, // final boolean no_map, // do not generate disparity_map (time-consuming LMA)
debug_level-8); // final int debug_level) debug_level-8); // final int debug_level)
if (debug_level > 0) { if (debug_level > 0) {
...@@ -4060,6 +4062,7 @@ public class OpticalFlow { ...@@ -4060,6 +4062,7 @@ public class OpticalFlow {
false, // final boolean show_2d_corr, false, // final boolean show_2d_corr,
mcorr_sel, // final int mcorr_sel, // = mcorr_sel, // final int mcorr_sel, // =
facc_2d_img, // final float [][][] accum_2d_corr, // if [1][][] - return accumulated 2d correlations (all pairs) facc_2d_img, // final float [][][] accum_2d_corr, // if [1][][] - return accumulated 2d correlations (all pairs)
true, // final boolean no_map, // do not generate disparity_map (time-consuming LMA)
debug_level-8); // final int debug_level) debug_level-8); // final int debug_level)
float [][] corr_2d_img = facc_2d_img[0]; float [][] corr_2d_img = facc_2d_img[0];
// double [] // double []
...@@ -4550,6 +4553,7 @@ public class OpticalFlow { ...@@ -4550,6 +4553,7 @@ public class OpticalFlow {
( nrefine == (max_refines - 1)) && clt_parameters.inp.show_final_2d, // final boolean show_2d_corr, ( nrefine == (max_refines - 1)) && clt_parameters.inp.show_final_2d, // final boolean show_2d_corr,
mcorr_sel, // final int mcorr_sel, // = mcorr_sel, // final int mcorr_sel, // =
null, // final float [][][] accum_2d_corr, // if [1][][] - return accumulated 2d correlations (all pairs) null, // final float [][][] accum_2d_corr, // if [1][][] - return accumulated 2d correlations (all pairs)
false, // final boolean no_map, // do not generate disparity_map (time-consuming LMA)
debug_level-5); // final int debug_level) debug_level-5); // final int debug_level)
Runtime.getRuntime().gc(); Runtime.getRuntime().gc();
...@@ -5762,6 +5766,7 @@ public double[][] correlateIntersceneDebug( // only uses GPU and quad ...@@ -5762,6 +5766,7 @@ public double[][] correlateIntersceneDebug( // only uses GPU and quad
final boolean show_2d_corr, final boolean show_2d_corr,
final int mcorr_sel, // = Correlation2d.corrSelEncode(clt_parameters.img_dtt,scenes[nscene].getNumSensors()); final int mcorr_sel, // = Correlation2d.corrSelEncode(clt_parameters.img_dtt,scenes[nscene].getNumSensors());
final float [][][] accum_2d_corr, // if [1][][] - return accumulated 2d correlations (all pairs) final float [][][] accum_2d_corr, // if [1][][] - return accumulated 2d correlations (all pairs)
final boolean no_map, // do not generate disparity_map (time-consuming LMA)
final int debug_level final int debug_level
) )
{ {
...@@ -5794,7 +5799,7 @@ public double[][] correlateIntersceneDebug( // only uses GPU and quad ...@@ -5794,7 +5799,7 @@ public double[][] correlateIntersceneDebug( // only uses GPU and quad
} }
image_dtt.getCorrelation2d(); // initiate image_dtt.correlation2d, needed if disparity_map != null image_dtt.getCorrelation2d(); // initiate image_dtt.correlation2d, needed if disparity_map != null
double[][] disparity_map = new double [image_dtt.getDisparityTitles().length][]; double[][] disparity_map = no_map ? null : new double [image_dtt.getDisparityTitles().length][];
final double disparity_corr = 0.00; // (z_correction == 0) ? 0.0 : geometryCorrection.getDisparityFromZ(1.0/z_correction); final double disparity_corr = 0.00; // (z_correction == 0) ? 0.0 : geometryCorrection.getDisparityFromZ(1.0/z_correction);
TpTask[] tp_tasks_ref = null; TpTask[] tp_tasks_ref = null;
for (int nscene = 0; nscene < num_scenes; nscene++) { for (int nscene = 0; nscene < num_scenes; nscene++) {
...@@ -6192,10 +6197,10 @@ public double[][] correlateIntersceneDebug( // only uses GPU and quad ...@@ -6192,10 +6197,10 @@ public double[][] correlateIntersceneDebug( // only uses GPU and quad
image_dtt.getCorrelation2d(); // initiate image_dtt.correlation2d, needed if disparity_map != null image_dtt.getCorrelation2d(); // initiate image_dtt.correlation2d, needed if disparity_map != null
double[][] disparity_map = new double [image_dtt.getDisparityTitles().length][]; // double[][] disparity_map = new double [image_dtt.getDisparityTitles().length][];
final double disparity_corr = 0.0; // (z_correction == 0) ? 0.0 : geometryCorrection.getDisparityFromZ(1.0/z_correction); final double disparity_corr = 0.0; // (z_correction == 0) ? 0.0 : geometryCorrection.getDisparityFromZ(1.0/z_correction);
TpTask[] tp_tasks_ref = null; TpTask[] tp_tasks_ref = null;
String ts = ref_scene.getImageName(); // String ts = ref_scene.getImageName();
double [][] scene_pXpYD; double [][] scene_pXpYD;
// transform to self - maybe use a method that sets central points // transform to self - maybe use a method that sets central points
scene_pXpYD = transformToScenePxPyD( scene_pXpYD = transformToScenePxPyD(
...@@ -6269,7 +6274,7 @@ public double[][] correlateIntersceneDebug( // only uses GPU and quad ...@@ -6269,7 +6274,7 @@ public double[][] correlateIntersceneDebug( // only uses GPU and quad
dcorr_tiles, // final double [][][] dcorr_tiles, // [tile][pair][(2*transform_size-1)*(2*transform_size-1)] // if null - will not calculate 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 // When clt_mismatch is non-zero, no far objects extraction will be attempted
//optional, may be null //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, // disparity_map, // final double [][] disparity_map, // [8][tilesY][tilesX], only [6][] is needed on input or null - do not calculate
clt_parameters.correlate_lma, // final boolean run_lma, // calculate LMA, false - CM only 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) // define combining of all 2D correlation pairs for CM (LMA does not use them)
(add_combo ? clt_parameters.img_dtt.mcorr_comb_width : 0), //final int mcorr_comb_width, // combined correlation tile width (set <=0 to skip combined correlations) (add_combo ? clt_parameters.img_dtt.mcorr_comb_width : 0), //final int mcorr_comb_width, // combined correlation tile width (set <=0 to skip combined correlations)
...@@ -6324,7 +6329,7 @@ public double[][] correlateIntersceneDebug( // only uses GPU and quad ...@@ -6324,7 +6329,7 @@ public double[][] correlateIntersceneDebug( // only uses GPU and quad
dcorr_tiles, // final double [][][] dcorr_tiles, // [tile][pair][(2*transform_size-1)*(2*transform_size-1)] // if null - will not calculate 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 // When clt_mismatch is non-zero, no far objects extraction will be attempted
//optional, may be null //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, // disparity_map, // final double [][] disparity_map, // [8][tilesY][tilesX], only [6][] is needed on input or null - do not calculate
clt_parameters.correlate_lma, // final boolean run_lma, // calculate LMA, false - CM only clt_parameters.correlate_lma, // final boolean run_lma, // calculate LMA, false - CM only
// last 2 - contrast, avg/ "geometric average) // last 2 - contrast, avg/ "geometric average)
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.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
......
...@@ -9050,7 +9050,7 @@ if (debugLevel > -100) return true; // temporarily ! ...@@ -9050,7 +9050,7 @@ if (debugLevel > -100) return true; // temporarily !
clt_parameters.inp.noise_debug_level // clt_parameters.ofp.debug_level_optical - 1); // 1); // -1); // int debug_level); clt_parameters.inp.noise_debug_level // clt_parameters.ofp.debug_level_optical - 1); // 1); // -1); // int debug_level);
); );
System.out.println("End of intersceneNoise()"); System.out.println("End of interIntraExportML()");
} }
...@@ -11144,6 +11144,7 @@ if (debugLevel > -100) return true; // temporarily ! ...@@ -11144,6 +11144,7 @@ if (debugLevel > -100) return true; // temporarily !
quadCLT_aux.gpuResetCorrVector(); // .getGPU().resetGeometryCorrectionVector(); quadCLT_aux.gpuResetCorrVector(); // .getGPU().resetGeometryCorrectionVector();
} }
// final boolean batch_mode = clt_parameters.batch_run; // final boolean batch_mode = clt_parameters.batch_run;
// Reset dsi data (only 2 slices will be used) // Reset dsi data (only 2 slices will be used)
this.dsi = new double [DSI_SLICES.length][]; this.dsi = new double [DSI_SLICES.length][];
...@@ -11152,6 +11153,9 @@ if (debugLevel > -100) return true; // temporarily ! ...@@ -11152,6 +11153,9 @@ if (debugLevel > -100) return true; // temporarily !
final int debugLevelInner=clt_parameters.batch_run? -2: debugLevel; final int debugLevelInner=clt_parameters.batch_run? -2: debugLevel;
this.startTime=System.nanoTime(); this.startTime=System.nanoTime();
// if (quadCLT_main.correctionsParameters.clt_batch_skip_scenes) {
String [] sourceFiles=quadCLT_main.correctionsParameters.getSourcePaths(); String [] sourceFiles=quadCLT_main.correctionsParameters.getSourcePaths();
QuadCLT.SetChannels [] set_channels_main = quadCLT_main.setChannels(debugLevel); QuadCLT.SetChannels [] set_channels_main = quadCLT_main.setChannels(debugLevel);
QuadCLT.SetChannels [] set_channels_aux = quadCLT_aux.setChannels(debugLevel); QuadCLT.SetChannels [] set_channels_aux = quadCLT_aux.setChannels(debugLevel);
...@@ -11164,13 +11168,14 @@ if (debugLevel > -100) return true; // temporarily ! ...@@ -11164,13 +11168,14 @@ if (debugLevel > -100) return true; // temporarily !
System.out.println("No files to process (of "+sourceFiles.length+")"); System.out.println("No files to process (of "+sourceFiles.length+")");
return; return;
} }
if (!quadCLT_main.correctionsParameters.clt_batch_skip_scenes) {
double [] referenceExposures_main = null; double [] referenceExposures_main = null;
double [] referenceExposures_aux = null; double [] referenceExposures_aux = null;
// if (!colorProcParameters.lwir_islwir && !(set_channels_main == null)) { // if (!colorProcParameters.lwir_islwir && !(set_channels_main == null)) {
if (!quadCLT_main.isLwir() && !(set_channels_main == null)) { if (!quadCLT_main.isLwir() && !(set_channels_main == null)) {
referenceExposures_main = quadCLT_main.eyesisCorrections.calcReferenceExposures(debugLevel); referenceExposures_main = quadCLT_main.eyesisCorrections.calcReferenceExposures(debugLevel);
} }
// if (!colorProcParameters_aux.lwir_islwir && !(set_channels_aux == null)) { // if (!colorProcParameters_aux.lwir_islwir && !(set_channels_aux == null)) {
if (!quadCLT_aux.isLwir() && !(set_channels_aux == null)) { if (!quadCLT_aux.isLwir() && !(set_channels_aux == null)) {
referenceExposures_aux = quadCLT_aux.eyesisCorrections.calcReferenceExposures(debugLevel); referenceExposures_aux = quadCLT_aux.eyesisCorrections.calcReferenceExposures(debugLevel);
} }
...@@ -11198,8 +11203,8 @@ if (debugLevel > -100) return true; // temporarily ! ...@@ -11198,8 +11203,8 @@ if (debugLevel > -100) return true; // temporarily !
} }
// int [] channelFiles_main = (set_channels_main==null)? null: set_channels_main[nSet].fileNumber(); // int [] channelFiles_main = (set_channels_main==null)? null: set_channels_main[nSet].fileNumber();
// int [] channelFiles_aux = (set_channels_aux ==null)? null: set_channels_aux[nSet].fileNumber(); // int [] channelFiles_aux = (set_channels_aux ==null)? null: set_channels_aux[nSet].fileNumber();
int [] channelFiles_main = (nSet_main < 0)? null: set_channels_main[nSet_main].fileNumber(); int [] channelFiles_main = (nSet_main < 0)? null: set_channels_main[nSet_main].fileNumber();
int [] channelFiles_aux = (nSet_aux < 0)? null: set_channels_aux[nSet_aux].fileNumber(); int [] channelFiles_aux = (nSet_aux < 0)? null: set_channels_aux[nSet_aux].fileNumber();
boolean [][] saturation_imp_main = ((channelFiles_main != null) && (clt_parameters.sat_level > 0.0))? new boolean[channelFiles_main.length][] : null; boolean [][] saturation_imp_main = ((channelFiles_main != null) && (clt_parameters.sat_level > 0.0))? new boolean[channelFiles_main.length][] : null;
...@@ -11350,7 +11355,7 @@ if (debugLevel > -100) return true; // temporarily ! ...@@ -11350,7 +11355,7 @@ if (debugLevel > -100) return true; // temporarily !
} else { } else {
if (updateStatus) IJ.showStatus("CPU: Rendering 4 image set (disparity = 0) for "+quadCLT_main.image_name+ "and a thumb nail"); if (updateStatus) IJ.showStatus("CPU: Rendering 4 image set (disparity = 0) for "+quadCLT_main.image_name+ "and a thumb nail");
quadCLT_main.processCLTQuadCorrCPU( // returns ImagePlus, but it already should be saved/shown quadCLT_main.processCLTQuadCorrCPU( // returns ImagePlus, but it already should be saved/shown
// imp_srcs_main, // [srcChannel], // should have properties "name"(base for saving results), "channel","path" // imp_srcs_main, // [srcChannel], // should have properties "name"(base for saving results), "channel","path"
saturation_imp_main, // boolean [][] saturation_imp, // (near) saturated pixels or null saturation_imp_main, // boolean [][] saturation_imp, // (near) saturated pixels or null
clt_parameters, clt_parameters,
debayerParameters, debayerParameters,
...@@ -11702,9 +11707,9 @@ if (debugLevel > -100) return true; // temporarily ! ...@@ -11702,9 +11707,9 @@ if (debugLevel > -100) return true; // temporarily !
updateStatus, updateStatus,
debugLevel); debugLevel);
} }
// double [][] aux_last_scan = quadCLT_aux.tp.getShowDS( // double [][] aux_last_scan = quadCLT_aux.tp.getShowDS(
// quadCLT_aux.tp.clt_3d_passes.get( quadCLT_aux.tp.clt_3d_passes.size() -1), // quadCLT_aux.tp.clt_3d_passes.get( quadCLT_aux.tp.clt_3d_passes.size() -1),
// false); // boolean force_final); // false); // boolean force_final);
double [][] aux_last_scan = quadCLT_aux.tp.getDSLMA( double [][] aux_last_scan = quadCLT_aux.tp.getDSLMA(
quadCLT_aux.tp.clt_3d_passes.get( quadCLT_aux.tp.clt_3d_passes.size() -1), quadCLT_aux.tp.clt_3d_passes.get( quadCLT_aux.tp.clt_3d_passes.size() -1),
false); // boolean force_final); false); // boolean force_final);
...@@ -11712,7 +11717,7 @@ if (debugLevel > -100) return true; // temporarily ! ...@@ -11712,7 +11717,7 @@ if (debugLevel > -100) return true; // temporarily !
dsi[DSI_STRENGTH_AUX] = aux_last_scan[1]; dsi[DSI_STRENGTH_AUX] = aux_last_scan[1];
dsi[DSI_DISPARITY_AUX_LMA] = aux_last_scan[2]; dsi[DSI_DISPARITY_AUX_LMA] = aux_last_scan[2];
// quadCLT_main.saveDSIMain (dsi); // quadCLT_main.saveDSIMain (dsi);
quadCLT_aux.saveDSIAll ( quadCLT_aux.saveDSIAll (
"-DSI_MAIN", // String suffix, // "-DSI_MAIN" "-DSI_MAIN", // String suffix, // "-DSI_MAIN"
dsi); dsi);
...@@ -11786,9 +11791,109 @@ if (debugLevel > -100) return true; // temporarily ! ...@@ -11786,9 +11791,109 @@ if (debugLevel > -100) return true; // temporarily !
return; return;
} }
} }
}
// System.out.println("batchLwirRig(): processing "+(quadCLT_main.getTotalFiles(set_channels_main)+quadCLT_aux.getTotalFiles(set_channels_aux))+" files ("+set_channels_main.length+" file sets) finished at "+ // System.out.println("batchLwirRig(): processing "+(quadCLT_main.getTotalFiles(set_channels_main)+quadCLT_aux.getTotalFiles(set_channels_aux))+" files ("+set_channels_main.length+" file sets) finished at "+
int num_main = (quadCLT_main==null)? 0 : quadCLT_main.getTotalFiles(set_channels_main); int num_main = (quadCLT_main==null)? 0 : quadCLT_main.getTotalFiles(set_channels_main);
int num_aux = (quadCLT_aux ==null)? 0 : quadCLT_aux.getTotalFiles(set_channels_aux); int num_aux = (quadCLT_aux ==null)? 0 : quadCLT_aux.getTotalFiles(set_channels_aux);
// Process LWIR16 tasks applicable to scene series rather than individual scenes
if (quadCLT_main.correctionsParameters.clt_batch_pose_pairs_main) {
TestInterLMA(quadCLT_main, // QUAD_CLT, // QuadCLT quadCLT_main,
clt_parameters, // EyesisCorrectionParameters.DCTParameters dct_parameters,
debayerParameters, // EyesisCorrectionParameters.DebayerParameters debayerParameters,
colorProcParameters, // COLOR_PROC_PARAMETERS, //EyesisCorrectionParameters.ColorProcParameters
// colorProcParameters,
channelGainParameters, // CorrectionColorProc.ColorGainsParameters channelGainParameters,
rgbParameters, // EyesisCorrectionParameters.RGBParameters rgbParameters,
equirectangularParameters, // EyesisCorrectionParameters.EquirectangularParameters
// equirectangularParameters,
properties, // Properties properties,
true, // false, // boolean reset_from_extrinsics,
threadsMax, // final int threadsMax, // maximal number of threads to launch
updateStatus, // final boolean updateStatus,
debugLevel);
}
if (quadCLT_main.correctionsParameters.clt_batch_pose_last_main) {
interSeriesLMA(quadCLT_main, // QUAD_CLT, // QuadCLT quadCLT_main,
clt_parameters, // EyesisCorrectionParameters.DCTParameters dct_parameters,
debayerParameters, // EyesisCorrectionParameters.DebayerParameters debayerParameters,
colorProcParameters, // COLOR_PROC_PARAMETERS, //EyesisCorrectionParameters.ColorProcParameters
// colorProcParameters,
channelGainParameters, // CorrectionColorProc.ColorGainsParameters channelGainParameters,
rgbParameters, // EyesisCorrectionParameters.RGBParameters rgbParameters,
equirectangularParameters, // EyesisCorrectionParameters.EquirectangularParameters
// equirectangularParameters,
properties, // Properties properties,
true, // false, // boolean reset_from_extrinsics,
threadsMax, // final int threadsMax, // maximal number of threads to launch
updateStatus, // final boolean updateStatus,
debugLevel);
}
if (quadCLT_main.correctionsParameters.clt_batch_ml_last_main) {
interIntraExportML(quadCLT_main, // QuadCLT quadCLT_main,
clt_parameters, // EyesisCorrectionParameters.DCTParameters dct_parameters,
debayerParameters, // EyesisCorrectionParameters.DebayerParameters debayerParameters,
colorProcParameters, // EyesisCorrectionParameters.ColorProcParameters colorProcParameters,
channelGainParameters, // CorrectionColorProc.ColorGainsParameters channelGainParameters,
rgbParameters, // EyesisCorrectionParameters.RGBParameters rgbParameters,
equirectangularParameters, // EyesisCorrectionParameters.EquirectangularParameters
// equirectangularParameters,
properties, // Properties properties,
threadsMax, // final int threadsMax, // maximal number of threads to launch
updateStatus, // final boolean updateStatus,
debugLevel);
}
if (quadCLT_main.correctionsParameters.clt_batch_pose_pairs_aux) {
TestInterLMA(quadCLT_aux, // QUAD_CLT, // QuadCLT quadCLT_main,
clt_parameters, // EyesisCorrectionParameters.DCTParameters dct_parameters,
debayerParameters, // EyesisCorrectionParameters.DebayerParameters debayerParameters,
colorProcParameters_aux, // COLOR_PROC_PARAMETERS, //EyesisCorrectionParameters.ColorProcParameters
// colorProcParameters,
channelGainParameters, // CorrectionColorProc.ColorGainsParameters channelGainParameters,
rgbParameters, // EyesisCorrectionParameters.RGBParameters rgbParameters,
equirectangularParameters, // EyesisCorrectionParameters.EquirectangularParameters
// equirectangularParameters,
properties, // Properties properties,
true, // false, // boolean reset_from_extrinsics,
threadsMax, // final int threadsMax, // maximal number of threads to launch
updateStatus, // final boolean updateStatus,
debugLevel);
}
if (quadCLT_main.correctionsParameters.clt_batch_pose_last_aux) {
interSeriesLMA(quadCLT_aux, // QUAD_CLT, // QuadCLT quadCLT_main,
clt_parameters, // EyesisCorrectionParameters.DCTParameters dct_parameters,
debayerParameters, // EyesisCorrectionParameters.DebayerParameters debayerParameters,
colorProcParameters_aux, // COLOR_PROC_PARAMETERS, //EyesisCorrectionParameters.ColorProcParameters
// colorProcParameters,
channelGainParameters, // CorrectionColorProc.ColorGainsParameters channelGainParameters,
rgbParameters, // EyesisCorrectionParameters.RGBParameters rgbParameters,
equirectangularParameters, // EyesisCorrectionParameters.EquirectangularParameters
// equirectangularParameters,
properties, // Properties properties,
true, // false, // boolean reset_from_extrinsics,
threadsMax, // final int threadsMax, // maximal number of threads to launch
updateStatus, // final boolean updateStatus,
debugLevel);
}
if (quadCLT_main.correctionsParameters.clt_batch_ml_last_aux) {
interIntraExportML(quadCLT_aux, // QuadCLT quadCLT_main,
clt_parameters, // EyesisCorrectionParameters.DCTParameters dct_parameters,
debayerParameters, // EyesisCorrectionParameters.DebayerParameters debayerParameters,
colorProcParameters_aux, // EyesisCorrectionParameters.ColorProcParameters colorProcParameters,
channelGainParameters, // CorrectionColorProc.ColorGainsParameters channelGainParameters,
rgbParameters, // EyesisCorrectionParameters.RGBParameters rgbParameters,
equirectangularParameters, // EyesisCorrectionParameters.EquirectangularParameters
// equirectangularParameters,
properties, // Properties properties,
threadsMax, // final int threadsMax, // maximal number of threads to launch
updateStatus, // final boolean updateStatus,
debugLevel);
}
System.out.println("batchLwirRig(): processing "+(num_main + num_aux)+" files ("+set_channels.length+" file sets) finished at "+ System.out.println("batchLwirRig(): processing "+(num_main + num_aux)+" files ("+set_channels.length+" file sets) finished at "+
IJ.d2s(0.000000001*(System.nanoTime()-this.startTime),3)+" sec, --- Free memory="+Runtime.getRuntime().freeMemory()+" (of "+Runtime.getRuntime().totalMemory()+")"); IJ.d2s(0.000000001*(System.nanoTime()-this.startTime),3)+" sec, --- Free memory="+Runtime.getRuntime().freeMemory()+" (of "+Runtime.getRuntime().totalMemory()+")");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment