Commit a38fdb10 authored by Andrey Filippov's avatar Andrey Filippov

Fixed races in IMS-related code, debugged fresh start of multi-sequence

processing
parent 684b347d
...@@ -227,7 +227,7 @@ public class EyesisCorrectionParameters { ...@@ -227,7 +227,7 @@ public class EyesisCorrectionParameters {
public String linkedCenters=""; // linked models with centers scene in CUAS mode public String linkedCenters=""; // linked models with centers scene in CUAS mode
public String x3dDirectory=""; public String x3dDirectory="";
public String videoDirectory=""; // combined (with MPEG) from multiple scene sequences video files public String videoDirectory=""; // combined (with MPEG) from multiple scene sequences video files
public String cuasSeed =""; /// public String cuasSeed ="";
public String mlDirectory="ml"; public String mlDirectory="ml";
...@@ -349,7 +349,7 @@ public class EyesisCorrectionParameters { ...@@ -349,7 +349,7 @@ public class EyesisCorrectionParameters {
cp.swapSubchannels01= this.swapSubchannels01; cp.swapSubchannels01= this.swapSubchannels01;
cp.linkedModels= this.linkedModels; cp.linkedModels= this.linkedModels;
cp.linkedCenters= this.linkedCenters; cp.linkedCenters= this.linkedCenters;
cp.cuasSeed= this.cuasSeed; /// cp.cuasSeed= this.cuasSeed;
cp.videoDirectory= this.videoDirectory; cp.videoDirectory= this.videoDirectory;
cp.x3dDirectory= this.x3dDirectory; cp.x3dDirectory= this.x3dDirectory;
cp.mlDirectory= this.mlDirectory; cp.mlDirectory= this.mlDirectory;
...@@ -570,7 +570,7 @@ public class EyesisCorrectionParameters { ...@@ -570,7 +570,7 @@ public class EyesisCorrectionParameters {
properties.setProperty(prefix+"linkedModels", this.linkedModels); properties.setProperty(prefix+"linkedModels", this.linkedModels);
properties.setProperty(prefix+"linkedCenters", this.linkedCenters); properties.setProperty(prefix+"linkedCenters", this.linkedCenters);
properties.setProperty(prefix+"cuasSeed", this.cuasSeed); /// properties.setProperty(prefix+"cuasSeed", this.cuasSeed);
properties.setProperty(prefix+"videoDirectory", this.videoDirectory); properties.setProperty(prefix+"videoDirectory", this.videoDirectory);
properties.setProperty(prefix+"x3dDirectory", this.x3dDirectory); properties.setProperty(prefix+"x3dDirectory", this.x3dDirectory);
properties.setProperty(prefix+"use_x3d_subdirs", this.use_x3d_subdirs+""); properties.setProperty(prefix+"use_x3d_subdirs", this.use_x3d_subdirs+"");
...@@ -773,7 +773,7 @@ public class EyesisCorrectionParameters { ...@@ -773,7 +773,7 @@ public class EyesisCorrectionParameters {
if (properties.getProperty(prefix+"linkedModels")!= null) this.linkedModels=properties.getProperty(prefix+"linkedModels"); if (properties.getProperty(prefix+"linkedModels")!= null) this.linkedModels=properties.getProperty(prefix+"linkedModels");
if (properties.getProperty(prefix+"linkedCenters")!= null) this.linkedCenters=properties.getProperty(prefix+"linkedCenters"); if (properties.getProperty(prefix+"linkedCenters")!= null) this.linkedCenters=properties.getProperty(prefix+"linkedCenters");
if (properties.getProperty(prefix+"cuasSeed")!= null) this.cuasSeed=properties.getProperty(prefix+"cuasSeed"); /// if (properties.getProperty(prefix+"cuasSeed")!= null) this.cuasSeed=properties.getProperty(prefix+"cuasSeed");
if (properties.getProperty(prefix+"videoDirectory")!= null) this.videoDirectory=properties.getProperty(prefix+"videoDirectory"); if (properties.getProperty(prefix+"videoDirectory")!= null) this.videoDirectory=properties.getProperty(prefix+"videoDirectory");
if (properties.getProperty(prefix+"x3dDirectory")!= null) this.x3dDirectory=properties.getProperty(prefix+"x3dDirectory"); if (properties.getProperty(prefix+"x3dDirectory")!= null) this.x3dDirectory=properties.getProperty(prefix+"x3dDirectory");
...@@ -1665,7 +1665,10 @@ public class EyesisCorrectionParameters { ...@@ -1665,7 +1665,10 @@ public class EyesisCorrectionParameters {
for (String line:lines){ for (String line:lines){
if (line.split("#").length > 0) { if (line.split("#").length > 0) {
String[] tokens = line.split("#")[0].trim().split("[\\s,;=]+"); String[] tokens = line.split("#")[0].trim().split("[\\s,;=]+");
if ((tokens.length > 2) && (tokens[0].toUpperCase().equals("SET"))) { if ((tokens.length >= 2) && (tokens[0].toUpperCase().equals("SET"))) {
if (tokens.length == 2) {
tokens = new String[] {tokens[0], tokens[1], ""};
}
parse_set: parse_set:
{ {
for (String dir_name:KEY_DIRS) if (dir_name.equals(tokens[1])) { for (String dir_name:KEY_DIRS) if (dir_name.equals(tokens[1])) {
...@@ -1700,43 +1703,50 @@ public class EyesisCorrectionParameters { ...@@ -1700,43 +1703,50 @@ public class EyesisCorrectionParameters {
if (!source_dir.exists()) { if (!source_dir.exists()) {
source_dir.mkdirs(); source_dir.mkdirs();
} }
if (dir_map.containsKey("cuasSeed")) { /// if (dir_map.containsKey("cuasSeed")) {
this.cuasSeed=(base_path.resolve(Paths.get(dir_map.get("cuasSeed")))).toString(); /// this.cuasSeed=(base_path.resolve(Paths.get(dir_map.get("cuasSeed")))).toString();
} /// }
useCuasSeedDir = false;
// Set other directories (possibly relative to base_path) // Set other directories (possibly relative to base_path)
for (int i = 2; i < KEY_DIRS.length; i++) { // skip "rootDirectory" and "sourceDirectory" for (int i = 2; i < KEY_DIRS.length; i++) { // skip "rootDirectory" and "sourceDirectory"
if (dir_map.containsKey(KEY_DIRS[i])) { if (dir_map.containsKey(KEY_DIRS[i])) {
Path dir_path=base_path.resolve(Paths.get(dir_map.get(KEY_DIRS[i]))); // Path dir_path=null;
File dir_file = new File(dir_path.toString()); // File dir_file = null;
if (!dir_file.exists()) { String dir_string = "";
dir_file.mkdirs(); if (dir_map.get(KEY_DIRS[i]).length() > 0){
Path dir_path=base_path.resolve(Paths.get(dir_map.get(KEY_DIRS[i])));
File dir_file = new File(dir_path.toString());
if (!dir_file.exists()) {
dir_file.mkdirs();
}
dir_string = dir_path.toString();
} }
switch (i) { switch (i) {
case 2: case 2:
this.linkedModels = dir_path.toString(); this.linkedModels = dir_string; // dir_path.toString();
System.out.println("this.linkedModels="+this.linkedModels); System.out.println("this.linkedModels="+this.linkedModels);
break; break;
case 3: case 3:
this.linkedCenters = dir_path.toString(); this.linkedCenters = dir_string; // dir_path.toString();
System.out.println("this.linkedCenters="+this.linkedCenters); System.out.println("this.linkedCenters="+this.linkedCenters);
break; break;
case 4: case 4:
this.videoDirectory = dir_path.toString(); this.videoDirectory = dir_string; // dir_path.toString();
System.out.println("this.videoDirectory="+this.videoDirectory); System.out.println("this.videoDirectory="+this.videoDirectory);
break; break;
case 5: case 5:
this.x3dDirectory = dir_path.toString(); this.x3dDirectory = dir_string; // dir_path.toString();
System.out.println("this.x3dDirectory="+this.x3dDirectory); System.out.println("this.x3dDirectory="+this.x3dDirectory);
break; break;
case 6: case 6:
this.resultsDirectory = dir_path.toString(); this.resultsDirectory = dir_string; // dir_path.toString();
System.out.println("this.resultsDirectory="+this.resultsDirectory); System.out.println("this.resultsDirectory="+this.resultsDirectory);
break; break;
case 7: case 7: // cuasSeed
this.resultsDirectory = dir_path.toString(); this.cuasSeedDir = dir_string; // dir_path.toString();
System.out.println("this.cuasSeed="+this.cuasSeed); System.out.println("this.cuasSeedDir=" + this.cuasSeedDir);
useCuasSeedDir = true;
break; break;
} }
} }
...@@ -2363,14 +2373,17 @@ public class EyesisCorrectionParameters { ...@@ -2363,14 +2373,17 @@ public class EyesisCorrectionParameters {
return this.imsRootDirectory + Prefs.getFileSeparator() + this.imsPrintSubdirectory; return this.imsRootDirectory + Prefs.getFileSeparator() + this.imsPrintSubdirectory;
} }
/**
* Get directory with the CUAS seed (from previous sequences)
* @return : null if this.useCuasSeedDir==false (disabled), "" if empty, or absolute path ending with "/"
*/
public String getCuasDir() { public String getCuasDir() {
if ((this.cuasSeedDir == null) || (this.cuasSeedDir.length() == 0)|| !this.useCuasSeedDir) { if ((this.cuasSeedDir == null) || !this.useCuasSeedDir) {
return null; return null;
} }
// while (this.cuasSeedDir.startsWith(Prefs.getFileSeparator())) { if (this.cuasSeedDir.length() == 0) {
// this.cuasSeedDir=this.cuasSeedDir.substring(1); return "";
// } }
while (this.cuasSeedDir.endsWith(Prefs.getFileSeparator())) { while (this.cuasSeedDir.endsWith(Prefs.getFileSeparator())) {
this.cuasSeedDir=this.cuasSeedDir.substring(0, this.cuasSeedDir.length()-1); this.cuasSeedDir=this.cuasSeedDir.substring(0, this.cuasSeedDir.length()-1);
} }
......
...@@ -442,7 +442,7 @@ public class Eyesis_Correction implements PlugIn, ActionListener { ...@@ -442,7 +442,7 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
public static EyesisCorrections EYESIS_CORRECTIONS = null; public static EyesisCorrections EYESIS_CORRECTIONS = null;
public static EyesisCorrections EYESIS_CORRECTIONS_AUX = null; public static EyesisCorrections EYESIS_CORRECTIONS_AUX = null;
public static EyesisCorrectionParameters.EquirectangularParameters EQUIRECTANGULAR_PARAMETERS = new EyesisCorrectionParameters.EquirectangularParameters(); public static EyesisCorrectionParameters.EquirectangularParameters EQUIRECTANGULAR_PARAMETERS = new EyesisCorrectionParameters.EquirectangularParameters();
public static EventLogger EVENT_LOGGER = null; /// public static EventLogger EVENT_LOGGER = null;
public static int CONVOLVE_FFT_SIZE = 128; // FFT size for sliding convolution with kernel public static int CONVOLVE_FFT_SIZE = 128; // FFT size for sliding convolution with kernel
public static int THREADS_MAX = 100; // testing multi-threading, limit maximal number of threads public static int THREADS_MAX = 100; // testing multi-threading, limit maximal number of threads
...@@ -5686,6 +5686,24 @@ public class Eyesis_Correction implements PlugIn, ActionListener { ...@@ -5686,6 +5686,24 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
CLT_PARAMETERS.batch_run = true; CLT_PARAMETERS.batch_run = true;
String imx_logs = CORRECTION_PARAMETERS.getImsSourceDirectory(); // sourceImsDirectory; String imx_logs = CORRECTION_PARAMETERS.getImsSourceDirectory(); // sourceImsDirectory;
String debug_path = null; // CORRECTION_PARAMETERS.getImsPrintDirectory()+Prefs.getFileSeparator()+"debug_local_master"; String debug_path = null; // CORRECTION_PARAMETERS.getImsPrintDirectory()+Prefs.getFileSeparator()+"debug_local_master";
if ((imx_logs == null) || imx_logs.equals("")) {
System.out.println("sourceImsDirectory is not set. Use Setup CLT Batch parameters to define it.");
return;
}
EventLogger eventLogger = EventLogger.getEventLogger(
imx_logs,
debug_path);
if (eventLogger == null) {
System.out.println("Failed to create eventLogger instance.");
return;
}
eventLogger.print2Pps(CORRECTION_PARAMETERS.getImsPrintDirectory()+Prefs.getFileSeparator()+"rec_1pps");
eventLogger.printStrobeInTime(CORRECTION_PARAMETERS.getImsPrintDirectory()+Prefs.getFileSeparator()+"did_strobe_in_time");
eventLogger.printPimu(CORRECTION_PARAMETERS.getImsPrintDirectory()+Prefs.getFileSeparator()+"did_pimu");
eventLogger.printGps(CORRECTION_PARAMETERS.getImsPrintDirectory()+Prefs.getFileSeparator()+"did_gps", 7);
eventLogger.printDidIns1(CORRECTION_PARAMETERS.getImsPrintDirectory()+Prefs.getFileSeparator()+"did_ins1");
eventLogger.printDidIns2(CORRECTION_PARAMETERS.getImsPrintDirectory()+Prefs.getFileSeparator()+"did_ins2");
/*
if (EVENT_LOGGER == null) { if (EVENT_LOGGER == null) {
if ((imx_logs != null) && !imx_logs.equals("")) { if ((imx_logs != null) && !imx_logs.equals("")) {
EVENT_LOGGER = new EventLogger ( EVENT_LOGGER = new EventLogger (
...@@ -5706,6 +5724,7 @@ public class Eyesis_Correction implements PlugIn, ActionListener { ...@@ -5706,6 +5724,7 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
} else { } else {
System.out.println("EVENT_LOGGEER is null."); System.out.println("EVENT_LOGGEER is null.");
} }
*/
return; return;
//JTabbedTest //JTabbedTest
// End of buttons code // End of buttons code
...@@ -8459,6 +8478,7 @@ public class Eyesis_Correction implements PlugIn, ActionListener { ...@@ -8459,6 +8478,7 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
null, // String set_name null, // String set_name
QUAD_CLT, // QuadCLT quadCLT_main, QUAD_CLT, // QuadCLT quadCLT_main,
QUAD_CLT_AUX, // QuadCLT quadCLT_aux, QUAD_CLT_AUX, // QuadCLT quadCLT_aux,
null, // QuadCLT quadCLT_this,
CLT_PARAMETERS, // EyesisCorrectionParameters.DCTParameters dct_parameters, CLT_PARAMETERS, // EyesisCorrectionParameters.DCTParameters dct_parameters,
true, // boolean skip_existing, true, // boolean skip_existing,
true, // boolean search_KML, true, // boolean search_KML,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -320,18 +320,22 @@ public class CuasData implements Serializable { ...@@ -320,18 +320,22 @@ public class CuasData implements Serializable {
indx_best = i; indx_best = i;
} }
} }
CuasTile tile = tile_list.get(indx_best).clone(); if (tile_list.get(indx_best).clt_data != null) {
if ((num_vars > 1) && !single_variant){ CuasTile tile = tile_list.get(indx_best).clone();
for (int i = 0; i < num_vars; i++) if ((i != indx_best) && !tile_list.get(i).isEmpty()) { if ((num_vars > 1) && !single_variant){
if (all_variants || (tile_list.get(indx_best).diffTile2(tile_list.get(i)) <= tolerance2)) { for (int i = 0; i < num_vars; i++) if ((i != indx_best) && !tile_list.get(i).isEmpty()) {
tile.merge(tile_list.get(i),decay); if (all_variants || (tile_list.get(indx_best).diffTile2(tile_list.get(i)) <= tolerance2)) {
} tile.merge(tile_list.get(i),decay);
}
}
} }
tile.getData (
fclt, // float [] fclt
nTile); // int ntile)
fclt_weights[nTile] = (float) tile.getWeight(decay, ts_now);
} else {
System.out.println("collapse(): tile_list.get("+indx_best+")==null, num_vars= "+num_vars+", nTile="+nTile+", dts="+tile_list.get(indx_best).dts+", weight="+tile_list.get(indx_best).weight);
} }
tile.getData (
fclt, // float [] fclt
nTile); // int ntile)
fclt_weights[nTile] = (float) tile.getWeight(decay, ts_now);
} }
} }
} }
......
...@@ -96,7 +96,8 @@ public class CuasTile implements Comparable<CuasTile>, Serializable { ...@@ -96,7 +96,8 @@ public class CuasTile implements Comparable<CuasTile>, Serializable {
public CuasTile cloneEmpty() { public CuasTile cloneEmpty() {
int num_colors = clt_data.length/CLT_TILE_LENGTH; int num_colors = clt_data.length/CLT_TILE_LENGTH;
return new CuasTile(num_colors, dts, 0, null); // return new CuasTile(num_colors, dts, 0, null);
return new CuasTile(num_colors, dts, 0, new float[clt_data.length]);
} }
public double merge (CuasTile tile, double decay) { public double merge (CuasTile tile, double decay) {
......
...@@ -1289,7 +1289,7 @@ public class GpuQuad{ // quad camera description ...@@ -1289,7 +1289,7 @@ public class GpuQuad{ // quad camera description
if (!force && this.gpuTileProcessor.bayer_set && !quadCLT.hasNewImageData()) { if (!force && this.gpuTileProcessor.bayer_set && !quadCLT.hasNewImageData()) {
return; return;
} }
double [][] bayer_center = quadCLT.getImageCenter(); double [][] bayer_center = quadCLT.getImageCenter(); // null
// if (bayer_center != null) { // if (bayer_center != null) {
if (center) { if (center) {
quadCLT.getResetImageCenter(); quadCLT.getResetImageCenter();
......
...@@ -14,7 +14,24 @@ import ij.Prefs; ...@@ -14,7 +14,24 @@ import ij.Prefs;
public class EventLogger { public class EventLogger {
public EventLoggerFileInfo [] logger_files; public EventLoggerFileInfo [] logger_files;
public EventLogger (String dir, String debug_prefix) { // dir should contain only event logger files private static EventLogger eventLogger = null;
// public static synchronized boolean hasEventLogger() { //
// return eventLogger != null;
// }
public static synchronized EventLogger getEventLogger() {
return eventLogger;
}
public static synchronized EventLogger getEventLogger(
String dir,
String debug_prefix) {
if (eventLogger == null) {
eventLogger = new EventLogger (dir, debug_prefix);
System.out.println("Created eventLogger");
}
return eventLogger;
}
private EventLogger (String dir, String debug_prefix) { // dir should contain only event logger files
if (!dir.endsWith(Prefs.getFileSeparator())) { if (!dir.endsWith(Prefs.getFileSeparator())) {
dir+=Prefs.getFileSeparator(); dir+=Prefs.getFileSeparator();
} }
...@@ -34,10 +51,6 @@ public class EventLogger { ...@@ -34,10 +51,6 @@ public class EventLogger {
} }
} }
Arrays.sort(logger_files); // increasing start time stamps Arrays.sort(logger_files); // increasing start time stamps
// testInterpolateDidIns1();
// testInterpolateDidIns1();
// testInterpolateDidIns1();
System.out.println("Processed "+logger_files.length+" event log files"); System.out.println("Processed "+logger_files.length+" event log files");
} }
......
...@@ -1019,6 +1019,15 @@ public class Interscene { ...@@ -1019,6 +1019,15 @@ public class Interscene {
quat_corr, // double [] quat_corr, // only applies to rotations - verify! quat_corr, // double [] quat_corr, // only applies to rotations - verify!
debugLevel) ; // int debugLevel) debugLevel) ; // int debugLevel)
} }
boolean debug_ims_xyzatr = true;
if (debug_ims_xyzatr) {
System.out.println("lock_position(set x,y,z = 0)="+lock_position);
System.out.println(String.format("%6s, %20s, %15s, %15s, %15s, %15s, %15s, %15s", "index","timestamp", "X", "Y", "Z", "Azimuth", "Tilt", "Roll"));
for (int i = 0; i < quadCLTs.length; i++) {
System.out.println(String.format("%6d, %20s, %15.12f, %15.12f, %15.12f, %15.12f, %15.12f, %15.12f", i,quadCLTs[i].getImageName(),
ims_xyzatr[i][0][0],ims_xyzatr[i][0][1],ims_xyzatr[i][0][2],ims_xyzatr[i][1][0],ims_xyzatr[i][1][1],ims_xyzatr[i][1][2]));
}
}
if (lock_position) { // zero linear offsets if (lock_position) { // zero linear offsets
for (int i = 0; i < quadCLTs.length; i++) for (int j = 0; j < 3; j++){ for (int i = 0; i < quadCLTs.length; i++) for (int j = 0; j < 3; j++){
ims_xyzatr[i][0][j]=0.0; ims_xyzatr[i][0][j]=0.0;
......
...@@ -167,13 +167,17 @@ public class QuadCLT extends QuadCLTCPU { ...@@ -167,13 +167,17 @@ public class QuadCLT extends QuadCLTCPU {
} }
return imp_virtual; return imp_virtual;
} }
/**
* Convert centerCLT image from transform domain
* @param fclt float transform-domain image representation. First index - sensor
* @return
*/
public double [][] convertCenterClt( public double [][] convertCenterClt(
float [][] fclt){ // may be null float [][] fclt){ // may be null
if (getCenterClt() == null) { // if (getCenterClt() == null) {
System.out.println("convertCenterClt(): not a center CLT"); // System.out.println("convertCenterClt(): not a center CLT");
return null; // return null;
} // }
int sensor_mask_clt = 1; // just one int sensor_mask_clt = 1; // just one
setQuadClt(); setQuadClt();
int tilesX = getTilesX(); int tilesX = getTilesX();
...@@ -1985,7 +1989,7 @@ public class QuadCLT extends QuadCLTCPU { ...@@ -1985,7 +1989,7 @@ public class QuadCLT extends QuadCLTCPU {
} }
} }
if (has_inv) { // if there is at least one (significant) inversion - keep only longest if (has_inv) { // if there is at least one (significant) inversion - keep only longest
for (int i = max_len_indx +1; i < tilesX; i++) { for (int i = max_len_indx +1; i < tilesY; i++) {
pXpYD[nTileX + i * tilesX] = null; pXpYD[nTileX + i * tilesX] = null;
} }
int start_i = max_len_indx - num_mono[max_len_indx]; int start_i = max_len_indx - num_mono[max_len_indx];
......
...@@ -3848,7 +3848,7 @@ public class TexturedModel { ...@@ -3848,7 +3848,7 @@ public class TexturedModel {
System.out.println("**** output3d(): likely a bug (not copied?), temporary fix ***"); System.out.println("**** output3d(): likely a bug (not copied?), temporary fix ***");
correctionsParameters.use_set_dirs = true; correctionsParameters.use_set_dirs = true;
} }
ref_scene.writeKml (null, debugLevel); ref_scene.writeKml (debugLevel);
/// ref_scene.writeRatingFile (debugLevel); broke /// ref_scene.writeRatingFile (debugLevel); broke
Runtime.getRuntime().gc(); Runtime.getRuntime().gc();
System.out.println("output3d(): generating 3d output files finished at "+ System.out.println("output3d(): generating 3d output files finished at "+
......
...@@ -2990,7 +2990,7 @@ if (debugLevel > -100) return true; // temporarily ! ...@@ -2990,7 +2990,7 @@ if (debugLevel > -100) return true; // temporarily !
return texture_tiles; return texture_tiles;
} }
public static void copyJP4src( public static void copyJP4src(
final SetChannels [] set_channels, final SetChannels [] set_channels,
final int [] range, // [earlies, latest] final int [] range, // [earlies, latest]
...@@ -3011,6 +3011,7 @@ if (debugLevel > -100) return true; // temporarily ! ...@@ -3011,6 +3011,7 @@ if (debugLevel > -100) return true; // temporarily !
set_channels[nScene].set_name, // String set_name set_channels[nScene].set_name, // String set_name
quadCLT_main, // QuadCLT quadCLT_main, quadCLT_main, // QuadCLT quadCLT_main,
null, // QuadCLT quadCLT_aux, null, // QuadCLT quadCLT_aux,
null, // QuadCLT quadCLT_this, // Does not setup IMS !!!
clt_parameters, // EyesisCorrectionParameters.DCTParameters dct_parameters, clt_parameters, // EyesisCorrectionParameters.DCTParameters dct_parameters,
true, // boolean skip_existing, true, // boolean skip_existing,
true, // boolean search_KML, true, // boolean search_KML,
...@@ -3020,8 +3021,6 @@ if (debugLevel > -100) return true; // temporarily ! ...@@ -3020,8 +3021,6 @@ if (debugLevel > -100) return true; // temporarily !
}; };
} }
ImageDtt.startAndJoin(threads); ImageDtt.startAndJoin(threads);
} }
...@@ -3030,6 +3029,7 @@ if (debugLevel > -100) return true; // temporarily ! ...@@ -3030,6 +3029,7 @@ if (debugLevel > -100) return true; // temporarily !
* @param set_name set name (timestamp) * @param set_name set name (timestamp)
* @param quadCLT_main RGB QuadCLT instance * @param quadCLT_main RGB QuadCLT instance
* @param quadCLT_aux secondary RGB or LWIR QuadCLT instance * @param quadCLT_aux secondary RGB or LWIR QuadCLT instance
* @param quadCLT_ims only used for IMS
* @param clt_parameters CLT parameters * @param clt_parameters CLT parameters
* @param skip_existing do not copy if destination files exist * @param skip_existing do not copy if destination files exist
* @param search_KML search for geo data and extract it to KML file if found * @param search_KML search for geo data and extract it to KML file if found
...@@ -3039,6 +3039,7 @@ if (debugLevel > -100) return true; // temporarily ! ...@@ -3039,6 +3039,7 @@ if (debugLevel > -100) return true; // temporarily !
String set_name, String set_name,
QuadCLT quadCLT_main, // tiles should be set QuadCLT quadCLT_main, // tiles should be set
QuadCLT quadCLT_aux, QuadCLT quadCLT_aux,
QuadCLT quadCLT_this,
CLTParameters clt_parameters, CLTParameters clt_parameters,
boolean skip_existing, boolean skip_existing,
boolean search_KML, boolean search_KML,
...@@ -3077,9 +3078,6 @@ if (debugLevel > -100) return true; // temporarily ! ...@@ -3077,9 +3078,6 @@ if (debugLevel > -100) return true; // temporarily !
path_list.add(sourceFiles_main[fn]); path_list.add(sourceFiles_main[fn]);
} }
} }
// if (set_channels_main !=null) {
// quadCLT_main.writeKml(debugLevel ); // also generated with x3d model
// }
String jp4_copy_path= quadCLT_main.correctionsParameters.selectX3dDirectory( String jp4_copy_path= quadCLT_main.correctionsParameters.selectX3dDirectory(
set_name, // quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false set_name, // quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false
...@@ -3096,25 +3094,24 @@ if (debugLevel > -100) return true; // temporarily ! ...@@ -3096,25 +3094,24 @@ if (debugLevel > -100) return true; // temporarily !
already_copied = true; already_copied = true;
} }
} }
// not needed, restoreNoModel() and restoreFromModel call restoreIMS
if (clt_parameters.imp.ims_use) { /*
String ims_path = dir.getParent() + Prefs.getFileSeparator()+set_name+quadCLT_main.correctionsParameters.imsSuffix; if (clt_parameters.imp.ims_use && (quadCLT_this != null)) {
double [] saved_offset = quadCLT_main.readImsOffset( quadCLT_this.setupIMS(
ims_path, // String ims_path, clt_parameters, // CLTParameters clt_parameters,
debugLevel); // int debugLevel) skip_existing, // boolean skip_existing,
if ((saved_offset == null) || (saved_offset[0] != clt_parameters.imp.ims_offset) || (saved_offset[1] != clt_parameters.imp.gmt_plus)) { debugLevel); // int debugLevel);
quadCLT_main.saveIms(
clt_parameters.imp.ims_offset,
clt_parameters.imp.gmt_plus, // double gmt_plus,
ims_path,
debugLevel);
}
} }
*/
if (search_KML && (set_channels_main !=null)) { // TODO: make it look in both MAIN and AUX. Look in only the same scene? if (search_KML && (set_channels_main !=null)) { // TODO: make it look in both MAIN and AUX. Look in only the same scene?
quadCLT_main.writeKml( if (quadCLT_this != null) {
set_name, quadCLT_main.writeKml(
debugLevel ); // also generated with x3d model debugLevel ); // also generated with x3d model
} else {
quadCLT_main.writeKml(
set_name,
debugLevel ); // also generated with x3d model
}
} }
if (already_copied) { if (already_copied) {
if (debugLevel >= min_dbg) System.out.println("Skipping existing directory "+dir); if (debugLevel >= min_dbg) System.out.println("Skipping existing directory "+dir);
...@@ -8086,6 +8083,7 @@ if (debugLevel > -100) return true; // temporarily ! ...@@ -8086,6 +8083,7 @@ if (debugLevel > -100) return true; // temporarily !
null, // String set_name null, // String set_name
quadCLT_main, // QuadCLT quadCLT_main, // tiles should be set quadCLT_main, // QuadCLT quadCLT_main, // tiles should be set
quadCLT_aux, // QuadCLT quadCLT_aux, quadCLT_aux, // QuadCLT quadCLT_aux,
null, // QuadCLT quadCLT_this,
clt_parameters, // EyesisCorrectionParameters.CLTParameters clt_parameters, clt_parameters, // EyesisCorrectionParameters.CLTParameters clt_parameters,
true, // boolean skip_existing, true, // boolean skip_existing,
true, // boolean search_KML, true, // boolean search_KML,
...@@ -8597,14 +8595,16 @@ if (debugLevel > -100) return true; // temporarily ! ...@@ -8597,14 +8595,16 @@ if (debugLevel > -100) return true; // temporarily !
EyesisCorrectionParameters.CorrectionParameters.PathFirstLast[] pathFirstLast = null; EyesisCorrectionParameters.CorrectionParameters.PathFirstLast[] pathFirstLast = null;
int num_seq = 1; int num_seq = 1;
clt_parameters.batch_run = false;// 07.08.2025
if (quadCLT_main.correctionsParameters.useSourceList) { if (quadCLT_main.correctionsParameters.useSourceList) {
System.out.println("\nReading source list from file: "+quadCLT_main.correctionsParameters.sourceSequencesList); System.out.println("\nReading source list from file: "+quadCLT_main.correctionsParameters.sourceSequencesList);
pathFirstLast = quadCLT_main.correctionsParameters.getSourceSets( pathFirstLast = quadCLT_main.correctionsParameters.getSourceSets(
quadCLT_main.correctionsParameters.sourceSequencesList); quadCLT_main.correctionsParameters.sourceSequencesList);
if (pathFirstLast != null) { if (pathFirstLast != null) {
num_seq = pathFirstLast.length; num_seq = pathFirstLast.length;
} }
clt_parameters.multiseq_run = true; // running from the source list - disable debug images clt_parameters.multiseq_run = true; // running from the source list - disable debug images
clt_parameters.batch_run = true; // 07.08.2025
} }
class VideoSet { class VideoSet {
...@@ -8629,11 +8629,19 @@ if (debugLevel > -100) return true; // temporarily ! ...@@ -8629,11 +8629,19 @@ if (debugLevel > -100) return true; // temporarily !
ArrayList<VideoSet> video_sets_list = new ArrayList<VideoSet>(); ArrayList<VideoSet> video_sets_list = new ArrayList<VideoSet>();
String [] cuas_centers = null; // [0] - cumulative input, [1] - cumulative output String [] cuas_centers = null; // [0] - cumulative input, [1] - cumulative output
if (quadCLT_main.correctionsParameters.useCuasSeedDir) {
cuas_centers = new String [] {quadCLT_main.correctionsParameters.cuasSeedDir,""};
}
if (debugLevel > -4) {
System.out.println("cuas_centers="+((cuas_centers != null)?("[\""+cuas_centers[0]+"\",\""+cuas_centers[1]+"\"]"):"null"));
}
/*
if ((quadCLT_main.correctionsParameters.cuasSeed != null) && (quadCLT_main.correctionsParameters.cuasSeed.length()>0)) { if ((quadCLT_main.correctionsParameters.cuasSeed != null) && (quadCLT_main.correctionsParameters.cuasSeed.length()>0)) {
cuas_centers = new String [] {quadCLT_main.correctionsParameters.cuasSeed,""}; cuas_centers = new String [] {quadCLT_main.correctionsParameters.cuasSeed,""};
} else if (quadCLT_main.correctionsParameters.getCuasDir() != null) { } else if (quadCLT_main.correctionsParameters.getCuasDir() != null) {
cuas_centers = new String [] {quadCLT_main.correctionsParameters.getCuasDir(),""}; cuas_centers = new String [] {quadCLT_main.correctionsParameters.getCuasDir(),""};
} }
*/
for (int nseq = 0; nseq < num_seq; nseq++) { for (int nseq = 0; nseq < num_seq; nseq++) {
long start_time_seq = System.nanoTime(); long start_time_seq = System.nanoTime();
System.out.println("\nSTARTED PROCESSING SCENE SEQUENCE "+nseq+" (last is "+(num_seq-1)+")\n"); System.out.println("\nSTARTED PROCESSING SCENE SEQUENCE "+nseq+" (last is "+(num_seq-1)+")\n");
...@@ -12181,6 +12189,7 @@ if (debugLevel > -100) return true; // temporarily ! ...@@ -12181,6 +12189,7 @@ if (debugLevel > -100) return true; // temporarily !
set_name, // String set_name set_name, // String set_name
quadCLT_main, // QuadCLT quadCLT_main, // tiles should be set quadCLT_main, // QuadCLT quadCLT_main, // tiles should be set
quadCLT_aux, // QuadCLT quadCLT_aux, quadCLT_aux, // QuadCLT quadCLT_aux,
null, // QuadCLT quadCLT_this,
clt_parameters, // EyesisCorrectionParameters.CLTParameters clt_parameters, clt_parameters, // EyesisCorrectionParameters.CLTParameters clt_parameters,
true, // boolean skip_existing, true, // boolean skip_existing,
true, // boolean search_KML, true, // boolean search_KML,
...@@ -12314,6 +12323,7 @@ if (debugLevel > -100) return true; // temporarily ! ...@@ -12314,6 +12323,7 @@ if (debugLevel > -100) return true; // temporarily !
set_name, // String set_name set_name, // String set_name
quadCLT_main, // QuadCLT quadCLT_main, // tiles should be set quadCLT_main, // QuadCLT quadCLT_main, // tiles should be set
quadCLT_aux, // QuadCLT quadCLT_aux, quadCLT_aux, // QuadCLT quadCLT_aux,
null, // QuadCLT quadCLT_this,
clt_parameters, // EyesisCorrectionParameters.CLTParameters clt_parameters, clt_parameters, // EyesisCorrectionParameters.CLTParameters clt_parameters,
true, // boolean skip_existing, true, // boolean skip_existing,
true, // boolean search_KML, true, // boolean search_KML,
...@@ -12623,6 +12633,7 @@ if (debugLevel > -100) return true; // temporarily ! ...@@ -12623,6 +12633,7 @@ if (debugLevel > -100) return true; // temporarily !
set_name, // String set_name set_name, // String set_name
quadCLT_main, // QuadCLT quadCLT_main, // tiles should be set quadCLT_main, // QuadCLT quadCLT_main, // tiles should be set
quadCLT_aux, // QuadCLT quadCLT_aux, quadCLT_aux, // QuadCLT quadCLT_aux,
null, // QuadCLT quadCLT_this,
clt_parameters, // EyesisCorrectionParameters.CLTParameters clt_parameters, clt_parameters, // EyesisCorrectionParameters.CLTParameters clt_parameters,
true, // boolean skip_existing, true, // boolean skip_existing,
true, // boolean search_KML, true, // boolean search_KML,
......
...@@ -328,6 +328,7 @@ public class LwirWorld { ...@@ -328,6 +328,7 @@ public class LwirWorld {
set_channels[ref_index].set_name, // String set_name set_channels[ref_index].set_name, // String set_name
quadCLT_main, // QuadCLT quadCLT_main, quadCLT_main, // QuadCLT quadCLT_main,
null, // QuadCLT quadCLT_aux, null, // QuadCLT quadCLT_aux,
null, // QuadCLT quadCLT_this,
clt_parameters, // EyesisCorrectionParameters.DCTParameters dct_parameters, clt_parameters, // EyesisCorrectionParameters.DCTParameters dct_parameters,
true, // boolean skip_existing, true, // boolean skip_existing,
true, // false, // boolean search_KML, true, // false, // boolean search_KML,
...@@ -520,6 +521,7 @@ public class LwirWorld { ...@@ -520,6 +521,7 @@ public class LwirWorld {
set_channels[scene_index].set_name, // String set_name set_channels[scene_index].set_name, // String set_name
quadCLT_main, // QuadCLT quadCLT_main, quadCLT_main, // QuadCLT quadCLT_main,
null, // QuadCLT quadCLT_aux, null, // QuadCLT quadCLT_aux,
null, // QuadCLT quadCLT_this,
clt_parameters, // EyesisCorrectionParameters.DCTParameters dct_parameters, clt_parameters, // EyesisCorrectionParameters.DCTParameters dct_parameters,
true, // boolean skip_existing, true, // boolean skip_existing,
true, // false, // boolean search_KML, true, // false, // boolean search_KML,
......
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