Commit fadcab9e authored by Andrey Filippov's avatar Andrey Filippov

Working on radar

parent 692610be
......@@ -99,9 +99,10 @@ public class CuasMotionLMA {
public static final int RSLT_FL_RANGE = 57; // flight log range (meters)
public static final int RSLT_INFINITY = 58; // disparity at infinity used for range calculation
public static final int RSLT_TARGET_ID = 59; // unique target id for the whole sequence of segments. 1 is reserved for the UAS
public static final int RSLT_VEL_AXIAL = 60; // axial velocity (positive - away), range derivative (m/s), calculated from the difference to the previous/next series range
public static final int RSLT_VEL_LATERAL = 61; // lateral velocity ( calculated from angular and RSLT_GRANGE
public static final int RSLT_RANGE_LIN = 62; // range linear interpolated using previous/next series if the same target is present there
public static final int RSLT_VEL_AWAY = 60; // axial velocity (positive - away), range derivative (m/s), calculated from the difference to the previous/next series range
public static final int RSLT_VEL_RIGHT = 61; // lateral velocity, right ( calculated from angular and RSLT_GRANGE
public static final int RSLT_VEL_UP = 62; // lateral velocity, up ( calculated from angular and RSLT_GRANGE
public static final int RSLT_RANGE_LIN = 63; // range linear interpolated using previous/next series if the same target is present there
public static final int RSLT_LEN = RSLT_RANGE_LIN + 1;
public static final String [] LMA_TITLES =
......@@ -121,7 +122,7 @@ public class CuasMotionLMA {
"Disparity","Disparity-Diff","Strength","Range","Global-index",
"segment-length","segment-disparity","segment_disp-diff", "segment-strength", "segment-range",
"FLOG-px","FLOG-pY","FLOG-DISP","FLOG-range","infinity",
"GTarget-ID","Range-derivative"};
"GTarget-ID","Vel-away", "Vel-right", "Vel-up","Range-linear"};
public static final String EXTRA_SLICE_DISCARD_ON_LOAD = "Targets";
public static final int FAIL_NONE = 0;
public static final int FAIL_MOTION = 1; // motion strength/fraction too low
......
......@@ -855,7 +855,8 @@ min_str_neib_fpn 0.35
public int cuas_font_size = 8; // before scaling
public int cuas_font_type = 1; // 0 - PLAIN, 1 - BOLD, 2 - ITALIC
// AZ/EL calibration
public double cuas_ifov = 0.05; // degree per pixel
@Deprecated
public double cuas_ifov = 0.05; // degree per pixel Use gc.getIFOVDegrees() and gc.getIFOV() instead
public int cuas_px0 = 283; // pixel with known azimuth
public int cuas_py0 = 386; // pixel with known elevation
public double cuas_az0 = 201.5; // degrees for cuas_px0;
......@@ -926,7 +927,10 @@ min_str_neib_fpn 0.35
public double cuas_tmtch_axv_k = 3.0; // maximal axial (range) velocity to lateral velocity ratio (take max)
public double cuas_tmtch_disp = 0.1; // minimal disparity difference to estimate lateral velocity (smaller - consider matching)
public boolean cuas_tmtch_short = true; // when multiple conflicting matches, prefer shortest gap (false - longest combo pair length)
// parameters for "radar" image generation
public double cuas_radar_range = 1500.0; // maximal radar range in meters
// debug parameters
public boolean cuas_debug = false; // save debug images (and show them if not in batch mode)
public int cuas_dbg_rng_seq = -1; // Debug single sequence ranging (-1 - process all)
......@@ -946,6 +950,7 @@ min_str_neib_fpn 0.35
public boolean cuas_reuse_targets = true; // read previously calculated non-conflict (one per tile) targets
public String cuas_reuse_path = "-TARGETS_SINGLE-FINAL"; // either suffix (all parameters the same) or the full path (contains "/")
public boolean cuas_reuse_disparity = true; // read previously calculated non-conflict targets data with disparities (recalculate ranges)
public boolean cuas_reuse_globals = true; // if globally combined data is available, read it. If successful show 16:9 video
public double cuas_max_disp_diff = 0.05; // Maximal disparity difference during last change to consider disparity valid
public double cuas_min_disp_str = 0.4; // Minimal disparity strength to consider disparity valid
public double cuas_rng_limit = 5000; // maximal displayed distance to target
......@@ -2768,6 +2773,9 @@ min_str_neib_fpn 0.35
"Minimal disparity difference to estimate lateral velocity (smaller - consider matching).");
gd.addCheckbox ("Prefer shortest gap", this.cuas_tmtch_short,
"When multiple conflicting matches, prefer shortest gap (false - longest combo pair length).");
gd.addMessage("=== Radar image generation (check Radar mode below) ===");
gd.addNumericField("Maximal Radar distance", this.cuas_radar_range, 5,8,"m",
"Maximal Radar range in meters.");
gd.addMessage("=== Debug ===");
gd.addCheckbox ("Save/show debug images", this.cuas_debug,
......@@ -2805,6 +2813,8 @@ min_str_neib_fpn 0.35
"Either suffix (if all the parameters the same) or the full path (contains \"/\").");
gd.addCheckbox ("Reuse previosly calculated disparities", this.cuas_reuse_disparity,
"Read previously calculated non-conflict (one per tile) targets with disparities (recalculate ranges).");
gd.addCheckbox ("Reuse combined series (Radar mode)", this.cuas_reuse_globals,
"Read target data updated after global processing of scene series \"CUAS Combine\" command. If successful, go directly to output generation with 16:9 and a radar image.");
gd.addNumericField("Maximal disparity difference", this.cuas_max_disp_diff, 6,8,"pix",
"Maximal disparity difference during last change to consider disparity valid.");
gd.addNumericField("Minimal target disparity strength", this.cuas_min_disp_str, 6,8,"",
......@@ -3984,6 +3994,8 @@ min_str_neib_fpn 0.35
this.cuas_tmtch_disp= gd.getNextNumber();
this.cuas_tmtch_short = gd.getNextBoolean();
this.cuas_radar_range= gd.getNextNumber();
this.cuas_debug = gd.getNextBoolean();
this.cuas_dbg_rng_seq = (int) gd.getNextNumber();
this.cuas_dbg_rng_tgt = (int) gd.getNextNumber();
......@@ -4003,6 +4015,7 @@ min_str_neib_fpn 0.35
this.cuas_reuse_targets = gd.getNextBoolean();
this.cuas_reuse_path = gd.getNextString();
this.cuas_reuse_disparity = gd.getNextBoolean();
this.cuas_reuse_globals = gd.getNextBoolean();
this.cuas_max_disp_diff = gd.getNextNumber();
this.cuas_min_disp_str = gd.getNextNumber();
this.cuas_rng_limit = gd.getNextNumber();
......@@ -5089,6 +5102,8 @@ min_str_neib_fpn 0.35
properties.setProperty(prefix+"cuas_tmtch_disp", this.cuas_tmtch_disp+""); // double
properties.setProperty(prefix+"cuas_tmtch_short", this.cuas_tmtch_short+""); // boolean
properties.setProperty(prefix+"cuas_radar_range", this.cuas_radar_range+""); // double
properties.setProperty(prefix+"cuas_debug", this.cuas_debug+""); // boolean
properties.setProperty(prefix+"cuas_dbg_rng_seq", this.cuas_dbg_rng_seq+""); // int
properties.setProperty(prefix+"cuas_dbg_rng_tgt", this.cuas_dbg_rng_tgt+""); // int
......@@ -5109,9 +5124,10 @@ min_str_neib_fpn 0.35
properties.setProperty(prefix+"cuas_reuse_path", this.cuas_reuse_path+""); // String
properties.setProperty(prefix+"cuas_reuse_disparity", this.cuas_reuse_disparity+"");// boolean
properties.setProperty(prefix+"cuas_reuse_globals", this.cuas_reuse_globals+""); // boolean
properties.setProperty(prefix+"cuas_max_disp_diff", this.cuas_max_disp_diff+""); // double
properties.setProperty(prefix+"cuas_min_disp_str", this.cuas_min_disp_str+""); // double
properties.setProperty(prefix+"cuas_rng_limit", this.cuas_rng_limit+""); // double
properties.setProperty(prefix+"cuas_rng_limit", this.cuas_rng_limit+""); // double
properties.setProperty(prefix+"mb_gain_index_pose", this.mb_gain_index_pose+""); // int
properties.setProperty(prefix+"mb_gain_index_depth", this.mb_gain_index_depth+""); // int
......@@ -6170,6 +6186,8 @@ min_str_neib_fpn 0.35
if (properties.getProperty(prefix+"cuas_tmtch_disp")!=null) this.cuas_tmtch_disp=Double.parseDouble(properties.getProperty(prefix+"cuas_tmtch_disp"));
if (properties.getProperty(prefix+"cuas_tmtch_short")!=null) this.cuas_tmtch_short=Boolean.parseBoolean(properties.getProperty(prefix+"cuas_tmtch_short"));
if (properties.getProperty(prefix+"cuas_radar_range")!=null) this.cuas_radar_range=Double.parseDouble(properties.getProperty(prefix+"cuas_radar_range"));
if (properties.getProperty(prefix+"cuas_debug")!=null) this.cuas_debug=Boolean.parseBoolean(properties.getProperty(prefix+"cuas_debug"));
if (properties.getProperty(prefix+"cuas_dbg_rng_seq")!=null) this.cuas_dbg_rng_seq=Integer.parseInt(properties.getProperty(prefix+"cuas_dbg_rng_seq"));
if (properties.getProperty(prefix+"cuas_dbg_rng_tgt")!=null) this.cuas_dbg_rng_tgt=Integer.parseInt(properties.getProperty(prefix+"cuas_dbg_rng_tgt"));
......@@ -6189,6 +6207,7 @@ min_str_neib_fpn 0.35
if (properties.getProperty(prefix+"cuas_reuse_path")!=null) this.cuas_reuse_path=(String) properties.getProperty(prefix+"cuas_reuse_path");
if (properties.getProperty(prefix+"cuas_reuse_disparity")!=null) this.cuas_reuse_disparity=Boolean.parseBoolean(properties.getProperty(prefix+"cuas_reuse_disparity"));
if (properties.getProperty(prefix+"cuas_reuse_globals")!=null) this.cuas_reuse_globals=Boolean.parseBoolean(properties.getProperty(prefix+"cuas_reuse_globals"));
if (properties.getProperty(prefix+"cuas_max_disp_diff")!=null) this.cuas_max_disp_diff=Double.parseDouble(properties.getProperty(prefix+"cuas_max_disp_diff"));
if (properties.getProperty(prefix+"cuas_min_disp_str")!=null) this.cuas_min_disp_str=Double.parseDouble(properties.getProperty(prefix+"cuas_min_disp_str"));
if (properties.getProperty(prefix+"cuas_rng_limit")!=null) this.cuas_rng_limit=Double.parseDouble(properties.getProperty(prefix+"cuas_rng_limit"));
......@@ -7239,7 +7258,9 @@ min_str_neib_fpn 0.35
imp.cuas_tmtch_disp = this.cuas_tmtch_disp;
imp.cuas_tmtch_short = this.cuas_tmtch_short;
imp.cuas_debug = this.cuas_debug;
imp.cuas_radar_range = this.cuas_radar_range;
imp.cuas_debug = this.cuas_debug;
imp.cuas_dbg_rng_seq = this.cuas_dbg_rng_seq;
imp.cuas_dbg_rng_tgt = this.cuas_dbg_rng_tgt;
imp.cuas_dbg_show_mode = this.cuas_dbg_show_mode;
......@@ -7257,6 +7278,7 @@ min_str_neib_fpn 0.35
imp.cuas_reuse_targets = this.cuas_reuse_targets;
imp.cuas_reuse_path= this.cuas_reuse_path;
imp.cuas_reuse_disparity = this.cuas_reuse_disparity;
imp.cuas_reuse_globals = this.cuas_reuse_globals;
imp.cuas_max_disp_diff = this.cuas_max_disp_diff;
imp.cuas_min_disp_str = this.cuas_min_disp_str;
imp.cuas_rng_limit = this.cuas_rng_limit;
......
......@@ -6236,8 +6236,12 @@ public class OpticalFlow {
CuasMotion cuasMotion = cuasRanging.detectTargets(
uasLogReader, // UasLogReader uasLogReader,
batch_mode); // boolean batch_mode)
if (debugLevel > -4) {
System.out.println("Target detection DONE");
if (cuasMotion == null) {
System.out.println("Failed target detection. Probably, radar mode was selected but target file does not exist (created with \"CUAS Combine\" command)");
} else {
if (debugLevel > -4) {
System.out.println("Target detection DONE");
}
}
}
......
......@@ -8647,6 +8647,15 @@ if (debugLevel > -100) return true; // temporarily !
cuas_centers = new String [] {quadCLT_main.correctionsParameters.getCuasDir(),""};
}
*/
// Process UAS logs moved here to be used in 2 commands
UasLogReader uasLogReader = null;
String uas_log_path = quadCLT_main.correctionsParameters.getUasLogsPath();
System.out.println("Using UAS log file: "+uas_log_path);
if ((uas_log_path != null) && (uas_log_path.length() > 0)) {
uasLogReader = new UasLogReader(uas_log_path, quadCLT_main.correctionsParameters.cuasUasTimeStamp, null, quadCLT_main);
uasLogReader.setCameraATR(quadCLT_main.correctionsParameters.cuasCameraATR);
uasLogReader.setUASHomeNed(quadCLT_main.correctionsParameters.cuasSetHome? quadCLT_main.correctionsParameters.cuasUASHome : null);
}
switch (cuas_proc_mode) {
case 0 :
String uas_sky_mask_path = quadCLT_main.correctionsParameters.getUasSkyMask();
......@@ -8684,6 +8693,7 @@ if (debugLevel > -100) return true; // temporarily !
int ref_index = -1; // -1 - last
int [] start_ref_pointers = new int[2]; //{earlist, reference} - reference may be center
boolean first_in_series = true;
/*
// Process UAS logs
UasLogReader uasLogReader = null;
String uas_log_path = quadCLT_main.correctionsParameters.getUasLogsPath();
......@@ -8693,6 +8703,7 @@ if (debugLevel > -100) return true; // temporarily !
uasLogReader.setCameraATR(quadCLT_main.correctionsParameters.cuasCameraATR);
uasLogReader.setUASHomeNed(quadCLT_main.correctionsParameters.cuasSetHome? quadCLT_main.correctionsParameters.cuasUASHome : null);
}
*/
if (debugLevel > -4) {
System.out.println("cuas_centers="+((cuas_centers != null)?("[\""+cuas_centers[0]+"\",\""+cuas_centers[1]+"\"]"):"null"));
}
......@@ -8942,6 +8953,7 @@ if (debugLevel > -100) return true; // temporarily !
case 1:
CuasMultiSeries cuasMultiSeries = new CuasMultiSeries(
clt_parameters, // CLTParameters clt_parameters,
uasLogReader, //UasLogReader uasLogReader,
quadCLT_main, // QuadCLT quadCLT_main,
quadCLT_main.correctionsParameters.linkedCenters,
quadCLT_main.correctionsParameters.x3dModelVersion);
......
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