Commit 5d8a3045 authored by Andrey Filippov's avatar Andrey Filippov

cleaning up radar mode, fixed detection code

parent 61af6427
...@@ -876,7 +876,8 @@ public class Eyesis_Correction implements PlugIn, ActionListener { ...@@ -876,7 +876,8 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
jpanelLWIRWorld = new JPanel(); jpanelLWIRWorld = new JPanel();
jpanelLWIRWorld.setLayout(new GridLayout(1, 0, 5, 5)); // rows, columns, vgap, hgap jpanelLWIRWorld.setLayout(new GridLayout(1, 0, 5, 5)); // rows, columns, vgap, hgap
addJButton("Aux Build Series", jpanelLWIRWorld, color_stop); addJButton("Aux Build Series", jpanelLWIRWorld, color_stop);
addJButton("CUAS Combine", jpanelLWIRWorld, color_stop); addJButton("CUAS Combine", jpanelLWIRWorld, color_stop, "Combine previously processed CUAS series");
addJButton("CUAS Video", jpanelLWIRWorld, color_stop, "Combine previously rendered CUAS videos");
addJButton("Build World", jpanelLWIRWorld, color_process); addJButton("Build World", jpanelLWIRWorld, color_process);
addJButton("Test IMX5", jpanelLWIRWorld, color_process); addJButton("Test IMX5", jpanelLWIRWorld, color_process);
addJButton("Show mice", jpanelLWIRWorld, color_process); addJButton("Show mice", jpanelLWIRWorld, color_process);
...@@ -1483,16 +1484,26 @@ public class Eyesis_Correction implements PlugIn, ActionListener { ...@@ -1483,16 +1484,26 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
panel.add(b); panel.add(b);
} }
void addJButton(String label, JPanel panel, Color color) {
void addJButton(String label, JPanel panel, Color color, String tooltip) {
JButton b = new JButton(label); JButton b = new JButton(label);
if (color != null) { if (color != null) {
b.setBackground(color); b.setBackground(color);
} }
b.addActionListener(this); b.addActionListener(this);
b.addKeyListener(IJ.getInstance()); b.addKeyListener(IJ.getInstance());
b.setToolTipText(label); b.setToolTipText(tooltip);
panel.add(b); panel.add(b);
} }
void addJButton(String label, JPanel panel, Color color) {
addJButton(
label, // String label,
panel, // JPanel panel,
color, // Color color,
label); // String tooltip);
}
@Override @Override
...@@ -5703,7 +5714,16 @@ public class Eyesis_Correction implements PlugIn, ActionListener { ...@@ -5703,7 +5714,16 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
true, true,
1); // int cuas_proc_mode); // 0 - old, 1 combine scene series) {); 1); // int cuas_proc_mode); // 0 - old, 1 combine scene series) {);
return; return;
//"CUAS Combine" //"CUAS Combine" "CUAS Video"
/* ======================================================================== */
} else if (label.equals("CUAS Video")) {
DEBUG_LEVEL = MASTER_DEBUG_LEVEL;
EYESIS_CORRECTIONS.setDebug(DEBUG_LEVEL);
CLT_PARAMETERS.batch_run = true;
buildSeries(
true,
2); // int cuas_proc_mode); // 0 - old, 1 combine scene series) {);
return;
/* ======================================================================== */ /* ======================================================================== */
} else if (label.equals("Aux Inter Test")) { } else if (label.equals("Aux Inter Test")) {
DEBUG_LEVEL = MASTER_DEBUG_LEVEL; DEBUG_LEVEL = MASTER_DEBUG_LEVEL;
......
...@@ -58,7 +58,7 @@ public class CuasMotion { ...@@ -58,7 +58,7 @@ public class CuasMotion {
final static private int INDX_CONFIDENCE = 5; // calculated separately final static private int INDX_CONFIDENCE = 5; // calculated separately
final static String [] VF_TOP_TITLES = {"vX","vY","strength","fraction","speed", "confidence"}; final static String [] VF_TOP_TITLES = {"vX","vY","strength","fraction","speed", "confidence"};
final static public int TARGET_X = 0; final static public int TARGET_X = 0;
final static public int TARGET_Y = 1; final static public int TARGET_Y = 1;
final static public int TARGET_VX = 2; final static public int TARGET_VX = 2;
final static public int TARGET_VY = 3; final static public int TARGET_VY = 3;
...@@ -73,7 +73,8 @@ public class CuasMotion { ...@@ -73,7 +73,8 @@ public class CuasMotion {
final static public int TARGET_DISP_STR = 12; final static public int TARGET_DISP_STR = 12;
final static public int TARGET_RANGE = 13; final static public int TARGET_RANGE = 13;
final static public int TARGET_NTILE = 14; final static public int TARGET_NTILE = 14;
final static public int TARGET_LENGTH = TARGET_NTILE+1; final static public int TARGET_ID = 15;
final static public int TARGET_LENGTH = TARGET_ID+1;
final static public int IMPORTANCE_A = 0; final static public int IMPORTANCE_A = 0;
final static public int IMPORTANCE_RMS = 1; final static public int IMPORTANCE_RMS = 1;
...@@ -102,13 +103,32 @@ public class CuasMotion { ...@@ -102,13 +103,32 @@ public class CuasMotion {
public static String ICON_BLUE = "Circle63x63blue.png"; public static String ICON_BLUE = "Circle63x63blue.png";
public static final int ANNOT_ID = 0; // target ID (global index) public static final int ANNOT_ID = 0; // target ID (global index)
public static final int ANNOT_RANGE = 1; // range public static final int ANNOT_DISP = 1; // disparity
public static final int ANNOT_TRANG = 2; // true range public static final int ANNOT_RANGE = 2; // range
public static final int ANNOT_AGL = 3; // altitude AGL public static final int ANNOT_TRANG = 3; // true range
public static final int ANNOT_AZ = 4; // azimuth public static final int ANNOT_AGL = 4; // altitude AGL
public static final int ANNOT_VS = 5; // vertical speed public static final int ANNOT_AZ = 5; // azimuth
public static final int ANNOT_GS = 6; // ground speed public static final int ANNOT_EL = 6; // elevation
public static final int ANNOT_HDG = 7; // heading public static final int ANNOT_ELNOAGL=7; // elevation if no AGL is available. should be after ANNOT_AGL
public static final int ANNOT_OMEGA = 8; // omega_az,omega_el
public static final int ANNOT_VS = 9; // vertical speed
public static final int ANNOT_GS = 10; // ground speed
public static final int ANNOT_HDG = 11; // heading
public static final int ANNOT_MISM = 12; // Mismatch before/after
public static final int ANNOT_SCORE =13; // Score
public static final int ANNOT_SEQ = 14; // Sequence length
public static final int ANNOT_TRV = 15; // Sequence travel (pixel diagonal of the bounding box of travel)
public static final int ANNOT_CLEAN =
(1 << ANNOT_ID) |
(1 << ANNOT_RANGE) |
(1 << ANNOT_TRANG) |
(1 << ANNOT_AGL) |
(1 << ANNOT_AZ) |
(1 << ANNOT_ELNOAGL) |
(1 << ANNOT_VS) |
(1 << ANNOT_GS) |
(1 << ANNOT_HDG);
private final GPUTileProcessor gpuTileProcessor; private final GPUTileProcessor gpuTileProcessor;
private CLTParameters clt_parameters=null; private CLTParameters clt_parameters=null;
...@@ -3366,7 +3386,11 @@ public class CuasMotion { ...@@ -3366,7 +3386,11 @@ public class CuasMotion {
targets_data[nTarget][TARGET_DISPARITY] = target[CuasMotionLMA.RSLT_DISPARITY]; targets_data[nTarget][TARGET_DISPARITY] = target[CuasMotionLMA.RSLT_DISPARITY];
targets_data[nTarget][TARGET_DISP_STR] = target[CuasMotionLMA.RSLT_DISP_STR]; targets_data[nTarget][TARGET_DISP_STR] = target[CuasMotionLMA.RSLT_DISP_STR];
targets_data[nTarget][TARGET_DISP_DIFF] = target[CuasMotionLMA.RSLT_DISP_DIFF]; targets_data[nTarget][TARGET_DISP_DIFF] = target[CuasMotionLMA.RSLT_DISP_DIFF];
targets_data[nTarget][TARGET_RANGE] = target[CuasMotionLMA.RSLT_RANGE];
targets_data[nTarget][TARGET_RANGE] = // use RSLT_RANGE_LIN if available
Double.isNaN(target[CuasMotionLMA.RSLT_RANGE_LIN])? target[CuasMotionLMA.RSLT_RANGE]:
target[CuasMotionLMA.RSLT_RANGE_LIN];
targets_data[nTarget][TARGET_ID] = target[CuasMotionLMA.RSLT_TARGET_ID];
...@@ -4162,6 +4186,7 @@ public class CuasMotion { ...@@ -4162,6 +4186,7 @@ public class CuasMotion {
public void run() { public void run() {
for (int nSeq = ai.getAndIncrement(); nSeq < num_seq; nSeq = ai.getAndIncrement()) { for (int nSeq = ai.getAndIncrement(); nSeq < num_seq; nSeq = ai.getAndIncrement()) {
int frame_center = frame0 + nSeq * frame_step; int frame_center = frame0 + nSeq * frame_step;
for (int dscene = half_step0; dscene < half_step1; dscene ++) { for (int dscene = half_step0; dscene < half_step1; dscene ++) {
int nscene = frame_center + dscene; int nscene = frame_center + dscene;
if ((nscene >=0) && (nscene < num_scenes)) { if ((nscene >=0) && (nscene < num_scenes)) {
...@@ -4702,6 +4727,7 @@ public class CuasMotion { ...@@ -4702,6 +4727,7 @@ public class CuasMotion {
double disparity0 = Double.NaN; double disparity0 = Double.NaN;
double disparity1 = Double.NaN; double disparity1 = Double.NaN;
double radar_x0, radar_y0, radar_x1, radar_y1; double radar_x0, radar_y0, radar_x1, radar_y1;
boolean infinity_mode = false;
if ((range0 <= radar_range) && (range1 <= radar_range)) { if ((range0 <= radar_range) && (range1 <= radar_range)) {
disparity0 = ersCorrection.getDisparityFromZ(range0); disparity0 = ersCorrection.getDisparityFromZ(range0);
disparity1 = ersCorrection.getDisparityFromZ(range1); disparity1 = ersCorrection.getDisparityFromZ(range1);
...@@ -4728,11 +4754,15 @@ public class CuasMotion { ...@@ -4728,11 +4754,15 @@ public class CuasMotion {
radar_y0 = camera_xy0[1] - (radar_height + infinity_gap); radar_y0 = camera_xy0[1] - (radar_height + infinity_gap);
radar_x1 = camera_xy0[0] + (px1 - sensor_width/2) * ifov * (radar_height + infinity_gap); radar_x1 = camera_xy0[0] + (px1 - sensor_width/2) * ifov * (radar_height + infinity_gap);
radar_y1 = camera_xy0[1] - (radar_height + infinity_gap); radar_y1 = camera_xy0[1] - (radar_height + infinity_gap);
infinity_mode = true;
} }
// target_coord[ltarget-1] = new double [nscene1-nscene0+1][2]; // target_coord[ltarget-1] = new double [nscene1-nscene0+1][2];
target_coord[iltarget] = new double [nscene1-nscene0+1][2]; target_coord[iltarget] = new double [nscene1-nscene0+1][4];
annot_boxes[iltarget] = new Rectangle[nscene1-nscene0+1]; annot_boxes[iltarget] = new Rectangle[nscene1-nscene0+1];
annots[iltarget] = new String[nscene1-nscene0+1]; annots[iltarget] = new String[nscene1-nscene0+1];
int target_id = target_ids[targets_order[iltarget]];
boolean is_uas = target_id == CuasMultiSeries.TARGET_INDEX_UAS;
int icon_width = is_uas ? uas_icon_width: target_icon_width;
for (int nscene = nscene0; nscene < nscene1; nscene++) { // threads collide if <= (when drawing, here just not needed) for (int nscene = nscene0; nscene < nscene1; nscene++) { // threads collide if <= (when drawing, here just not needed)
double k = (nscene - nscene0) * kscene; // 0 when nscene=nscene0 double k = (nscene - nscene0) * kscene; // 0 when nscene=nscene0
double radar_x = interpolate(radar_x0, radar_x1, k); double radar_x = interpolate(radar_x0, radar_x1, k);
...@@ -4749,11 +4779,24 @@ public class CuasMotion { ...@@ -4749,11 +4779,24 @@ public class CuasMotion {
uas_target1, // double [] uas_target1, uas_target1, // double [] uas_target1,
k, // double k, k, // double k,
camera_atr, // double [] camera_atr, camera_atr, // double [] camera_atr,
ersCorrection); // ErsCorrection ersCorrection) ersCorrection, // ErsCorrection ersCorrection)
Double.NaN); // double fps); // if NaN, will use default 60Hz. Used only for omegas
target_coord[iltarget][nscene-nscene0][0] = radar_x; // null pointer target_coord[iltarget][nscene-nscene0][0] = radar_x; // null pointer
target_coord[iltarget][nscene-nscene0][1] = radar_y; target_coord[iltarget][nscene-nscene0][1] = radar_y;
annots[iltarget][nscene-nscene0] = annot_txt;
Rectangle text_box = getStringBounds(color_processors[nscene], annot_txt, font_ratio_radar); Rectangle text_box = getStringBounds(color_processors[nscene], annot_txt, font_ratio_radar);
// Rectangle abs_box = annot_boxes[iltarget][nscene-nscene0];
double text_left =radar_x + icon_width/2 + space_before_text;
double text_top = radar_y;
if (infinity_mode) {
text_left =radar_x - icon_width/2;
text_top = radar_y + icon_width/2 - text_box.y + space_before_text;
}
target_coord[iltarget][nscene-nscene0][2] = text_left;
target_coord[iltarget][nscene-nscene0][3] = text_top;
annots[iltarget][nscene-nscene0] = annot_txt;
// Rectangle text_box = getStringBounds(color_processors[nscene], annot_txt, font_ratio_radar);
annot_boxes[iltarget][nscene-nscene0] = text_box; annot_boxes[iltarget][nscene-nscene0] = text_box;
} }
} }
...@@ -4780,10 +4823,13 @@ public class CuasMotion { ...@@ -4780,10 +4823,13 @@ public class CuasMotion {
int icon_width = is_uas ? uas_icon_width: target_icon_width; int icon_width = is_uas ? uas_icon_width: target_icon_width;
for (int nscene = nscene0; nscene < nscene1; nscene++) { // threads collide if <= for (int nscene = nscene0; nscene < nscene1; nscene++) { // threads collide if <=
color_processors[nscene].setColor(is_uas ? selected_color: text_color); color_processors[nscene].setColor(is_uas ? selected_color: text_color);
String annot_txt=annots[iltarget][nscene-nscene0]; String annot_txt=annots[iltarget][nscene-nscene0];
/*
int text_left = (int)Math.round(target_coord[iltarget][nscene-nscene0][0] + icon_width/2 + space_before_text); int text_left = (int)Math.round(target_coord[iltarget][nscene-nscene0][0] + icon_width/2 + space_before_text);
int text_top = (int)Math.round(target_coord[iltarget][nscene-nscene0][1]); int text_top = (int)Math.round(target_coord[iltarget][nscene-nscene0][1]);
*/
int text_left = (int)Math.round(target_coord[iltarget][nscene-nscene0][2]);
int text_top = (int)Math.round(target_coord[iltarget][nscene-nscene0][3]);
Rectangle abs_box = annot_boxes[iltarget][nscene-nscene0]; Rectangle abs_box = annot_boxes[iltarget][nscene-nscene0];
abs_box.x += text_left; abs_box.x += text_left;
abs_box.y += text_top; abs_box.y += text_top;
...@@ -4890,15 +4936,6 @@ public class CuasMotion { ...@@ -4890,15 +4936,6 @@ public class CuasMotion {
} }
/*
if (target_text_transparent) {
color_processors[nscene].drawString(annot_txt, text_left, text_top); // transparent.
} else {
color_processors[nscene].drawString(annot_txt, text_left, text_top, Color.BLACK); // solid color
}
*/
public static String getAnnotationText( public static String getAnnotationText(
CLTParameters clt_parameters, CLTParameters clt_parameters,
...@@ -4912,17 +4949,38 @@ public class CuasMotion { ...@@ -4912,17 +4949,38 @@ public class CuasMotion {
double [] uas_target1, double [] uas_target1,
double k, double k,
double [] camera_atr, double [] camera_atr,
ErsCorrection ersCorrection) { ErsCorrection ersCorrection,
double fps) { // if NaN, will use default 60Hz. Used only for omegas
if (Double.isNaN(fps)) {
fps = 60.0;
}
if (target1 == null ) { // for compatibility with the camera view, where data is already interpolated
target1 = target0;
ntile1 = ntile0;
uas_target1 = uas_target0;
k = 0;
}
String number_unsigned_format = "%4.0f";
String number_frac_format = "%4.1f";
String number_signed_format = "%3.0f";
String omega_format = "%3.1f";
String omega = "\u03A9";
String sinfinity = "\u221E";
boolean show_inf = clt_parameters.imp.cuas_show_inf; // true; // Show distance greater than max (or negativce) as infinity boolean show_inf = clt_parameters.imp.cuas_show_inf; // true; // Show distance greater than max (or negativce) as infinity
boolean show_inf_gt = clt_parameters.imp.cuas_show_inf_gt; // false; // Use ">max" instead of infinity symbol boolean show_inf_gt = clt_parameters.imp.cuas_show_inf_gt; // false; // Use ">max" instead of infinity symbol
double max_annot_range = clt_parameters.imp.cuas_rng_limit; // 5000, maybe make a separate parameter double max_annot_range = clt_parameters.imp.cuas_rng_limit; // 5000, maybe make a separate parameter
double max_axial_range = clt_parameters.imp.cuas_radar_range; // may be a separate - maximal range for axial velocity/heading double max_axial_range = clt_parameters.imp.cuas_radar_range; // may be a separate - maximal range for axial velocity/heading
double ifov = ersCorrection.getIFOV(); double ifov = ersCorrection.getIFOV();
int sensor_width = ersCorrection.getSensorWH()[0]; int sensor_width = ersCorrection.getSensorWH()[0];
int sensor_height = ersCorrection.getSensorWH()[1];
int tileSize = GPUTileProcessor.DTT_SIZE; int tileSize = GPUTileProcessor.DTT_SIZE;
int tilesX = sensor_width/tileSize; int tilesX = sensor_width/tileSize;
int dbg_id = -21;
int id = (int) target0[CuasMotionLMA.RSLT_TARGET_ID]; double did = target0[CuasMotionLMA.RSLT_TARGET_ID];
int id = (int) did;
if (id == dbg_id) {
System.out.println("getAnnotationText(): id = 21");
}
double px0 = (ntile0 % tilesX +0.5) * tileSize + target0[CuasMotionLMA.RSLT_X]; // ignoring velocities double px0 = (ntile0 % tilesX +0.5) * tileSize + target0[CuasMotionLMA.RSLT_X]; // ignoring velocities
double py0 = (ntile0 / tilesX +0.5) * tileSize + target0[CuasMotionLMA.RSLT_Y]; double py0 = (ntile0 / tilesX +0.5) * tileSize + target0[CuasMotionLMA.RSLT_Y];
double range0= target0[CuasMotionLMA.RSLT_RANGE_LIN]; double range0= target0[CuasMotionLMA.RSLT_RANGE_LIN];
...@@ -4944,24 +5002,15 @@ public class CuasMotion { ...@@ -4944,24 +5002,15 @@ public class CuasMotion {
if (!Double.isInfinite(range)) { if (!Double.isInfinite(range)) {
disparity = ersCorrection.getDisparityFromZ(range); disparity = ersCorrection.getDisparityFromZ(range);
} }
// double [] xyz = null;
double [] wxyz = null; double [] wxyz = null;
double agl = Double.NaN; double agl = Double.NaN;
double az = Double.NaN; double az = Double.NaN;
double el = Double.NaN;
double [][] icamera_atr = ErsCorrection.invertXYZATR( double [][] icamera_atr = ErsCorrection.invertXYZATR(
OpticalFlow.ZERO3, // double [] source_xyz, OpticalFlow.ZERO3, // double [] source_xyz,
camera_atr); // double [] source_atr) camera_atr); // double [] source_atr)
if (disparity > 0) { if (disparity > 0) {
/*
xyz = ersCorrection.getWorldCoordinatesERS( // ersCorrection - reference
px, // double px, // pixel coordinate X in the reference view
py, // double py, // pixel coordinate Y in the reference view
disparity, // double disparity, // reference disparity
true, // boolean distortedView, // This camera view is distorted (diff.rect), false - rectilinear
OpticalFlow.ZERO3, // double [] reference_xyz, // this view position in world coordinates (typically ZERO3)
OpticalFlow.ZERO3); // double [] reference_atr, // this view orientation relative to world frame (typically ZERO3)
*/
wxyz = ersCorrection.getWorldCoordinatesERS( // ersCorrection - reference wxyz = ersCorrection.getWorldCoordinatesERS( // ersCorrection - reference
px, // double px, // pixel coordinate X in the reference view px, // double px, // pixel coordinate X in the reference view
py, // double py, // pixel coordinate Y in the reference view py, // double py, // pixel coordinate Y in the reference view
...@@ -4971,32 +5020,23 @@ public class CuasMotion { ...@@ -4971,32 +5020,23 @@ public class CuasMotion {
icamera_atr[1]); // double [] reference_atr, // this view orientation relative to world frame (typically ZERO3) icamera_atr[1]); // double [] reference_atr, // this view orientation relative to world frame (typically ZERO3)
agl = wxyz[1]; agl = wxyz[1];
az = Math.atan2(wxyz[0], -wxyz[2]); // TODO: check sign az = Math.atan2(wxyz[0], -wxyz[2]); // TODO: check sign
el = Math.atan(wxyz[1]/wxyz[2]); // TODO: check sign
} else { } else {
/* az = (px - sensor_width/2) * ifov + camera_atr[0];
xyz = ersCorrection.getWorldCoordinatesERS( // ersCorrection - reference el = - (py - sensor_height/2) * ifov + camera_atr[1];
px, // double px, // pixel coordinate X in the reference view
py, // double py, // pixel coordinate Y in the reference view
disparity, // double disparity, // reference disparity
true, // boolean distortedView, // This camera view is distorted (diff.rect), false - rectilinear
OpticalFlow.ZERO3, // double [] reference_xyz, // this view position in world coordinates (typically ZERO3)
OpticalFlow.ZERO3); // double [] reference_atr, // this view orientation relative to world frame (typically ZERO3)
wxyz = ersCorrection.getWorldCoordinatesERS( // ersCorrection - reference
px, // double px, // pixel coordinate X in the reference view
py, // double py, // pixel coordinate Y in the reference view
disparity, // double disparity, // reference disparity
true, // boolean distortedView, // This camera view is distorted (diff.rect), false - rectilinear
OpticalFlow.ZERO3, // double [] reference_xyz, // this view position in world coordinates (typically ZERO3)
icamera_atr[1]); // double [] reference_atr, // this view orientation relative to world frame (typically ZERO3)
if (wxyz != null) {
az = Math.atan2(wxyz[0], -wxyz[2]); // TODO: check sign
}
*/
az = (px1 - sensor_width/2) * ifov + camera_atr[0];
} }
while (az <0 ) az += 2*Math.PI; while (az < 0 ) az += 2*Math.PI;
while (az > 360 ) az -= 2*Math.PI; while (az > 2*Math.PI ) az -= 2*Math.PI;
while (el > Math.PI) el -= 2* Math.PI;
while (el < -Math.PI) el += 2* Math.PI;
double az_deg = az * 180/Math.PI; double az_deg = az * 180/Math.PI;
double el_deg = el * 180/Math.PI;
double omega_az = interpolate (target0[CuasMotionLMA.RSLT_VX],target1[CuasMotionLMA.RSLT_VX],k) * ifov * fps;
double omega_el = -interpolate (target0[CuasMotionLMA.RSLT_VY],target1[CuasMotionLMA.RSLT_VY],k) * ifov * fps;
double omega_az_degs = omega_az * 180/Math.PI;
double omega_el_degs = omega_el * 180/Math.PI;
double vel_away = interpolate (target0[CuasMotionLMA.RSLT_VEL_AWAY], target1[CuasMotionLMA.RSLT_VEL_AWAY], k); double vel_away = interpolate (target0[CuasMotionLMA.RSLT_VEL_AWAY], target1[CuasMotionLMA.RSLT_VEL_AWAY], k);
if (range > max_axial_range) { if (range > max_axial_range) {
vel_away = 0; vel_away = 0;
...@@ -5007,22 +5047,30 @@ public class CuasMotion { ...@@ -5007,22 +5047,30 @@ public class CuasMotion {
if (range > max_axial_range) { if (range > max_axial_range) {
vel_hor *= Math.sqrt(2); // increase horizontal speed when one component is unknown by sqrt(2) vel_hor *= Math.sqrt(2); // increase horizontal speed when one component is unknown by sqrt(2)
} }
double hdg = Math.atan2(-vel_right, vel_away); double hdg = Math.atan2(vel_right, vel_away) + camera_atr[0];
while (hdg <0 ) hdg += 2*Math.PI; while (hdg <0 ) hdg += 2*Math.PI;
double hdg_deg = hdg * 180/ Math.PI; double hdg_deg = hdg * 180/ Math.PI;
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
if ((annot_mode & (1 << ANNOT_ID)) != 0){ if ((annot_mode & (1 << ANNOT_ID)) != 0){
sb.append(String.format("ID %03d\n", id)); sb.append("ID "+String.format(number_unsigned_format,did)+"\n");
}
if ((annot_mode & (1 << ANNOT_DISP)) != 0){
if (!Double.isNaN(disparity)) {
sb.append("DISP"+String.format(number_unsigned_format,disparity*1000)+"\n");
} else if (reserve_missing_fields){
sb.append("\n");
}
} }
if ((annot_mode & (1 << ANNOT_RANGE)) != 0){ if ((annot_mode & (1 << ANNOT_RANGE)) != 0){
if (range <= max_annot_range) { // handles POSITIVE_INFINITY if (range <= max_annot_range) { // handles POSITIVE_INFINITY
sb.append(String.format("RNG %4.0f\n", range)); sb.append("RNG "+String.format(number_unsigned_format,range)+"\n");
} else if (show_inf && !Double.isNaN(range)){ } else if (show_inf && !Double.isNaN(range)){
if (show_inf_gt) { if (show_inf_gt) {
sb.append(String.format("RNG>%4.0f\n", max_annot_range)); sb.append("RNG>"+String.format(number_unsigned_format,max_annot_range)+"\n");
} else { } else {
sb.append("RNG \u221E\n"); sb.append("RNG "+sinfinity+"\n");
} }
} else if (reserve_missing_fields){ } else if (reserve_missing_fields){
sb.append("\n"); sb.append("\n");
...@@ -5030,46 +5078,85 @@ public class CuasMotion { ...@@ -5030,46 +5078,85 @@ public class CuasMotion {
} }
if ((annot_mode & (1 << ANNOT_TRANG)) != 0){ if ((annot_mode & (1 << ANNOT_TRANG)) != 0){
if (!Double.isNaN(true_range)) { if (!Double.isNaN(true_range)) {
sb.append(String.format("TRNG%4.0f\n", true_range)); sb.append("TRNG"+String.format(number_unsigned_format,true_range)+"\n");
} else if (reserve_missing_fields){ } else if (reserve_missing_fields){
sb.append("\n"); sb.append("\n");
} }
} }
boolean has_agl = false;
if ((annot_mode & (1 << ANNOT_AGL)) != 0){ if ((annot_mode & (1 << ANNOT_AGL)) != 0){
if (!Double.isNaN(agl) && (range <= max_annot_range)) { if (!Double.isNaN(agl) && (range <= max_annot_range)) {
sb.append(String.format("AGL %4.0f\n", agl)); sb.append("AGL "+String.format(number_unsigned_format,agl)+"\n");
has_agl = true;
} else if (reserve_missing_fields){ } else if (reserve_missing_fields){
sb.append("\n"); sb.append("\n");
} }
} }
if ((annot_mode & (1 << ANNOT_AZ)) != 0){ if ((annot_mode & (1 << ANNOT_AZ)) != 0){
if (!Double.isNaN(az_deg)) { if (!Double.isNaN(az_deg)) {
sb.append(String.format("AZM %4.0f\n", az_deg)); sb.append("AZM "+String.format(number_unsigned_format,az_deg)+"\n");
} else if (reserve_missing_fields){
sb.append("\n");
}
}
if (((annot_mode & (1 << ANNOT_EL)) != 0) || (!has_agl && ((annot_mode & (1 << ANNOT_ELNOAGL)) != 0)) ){
if (!Double.isNaN(el_deg)) {
// sb.append("EL "+getSignedDouble(el_deg,omega_format)+"\n");
sb.append("EL "+String.format(number_unsigned_format,el_deg)+"\n");
} else if (reserve_missing_fields){ } else if (reserve_missing_fields){
sb.append("\n"); sb.append("\n");
} }
}
if ((annot_mode & (1 << ANNOT_OMEGA)) != 0){
sb.append(omega+"AZ "+getSignedDouble(omega_az_degs,omega_format)+"\n");
sb.append(omega+"EL "+getSignedDouble(omega_el_degs,omega_format)+"\n");
} }
if ((annot_mode & (1 << ANNOT_VS)) != 0){ if ((annot_mode & (1 << ANNOT_VS)) != 0){
if (!Double.isNaN(vel_up) && (range <= max_annot_range)) { if (!Double.isNaN(vel_up) && (range <= max_annot_range)) {
sb.append(String.format("VS %4.1f\n", vel_up)); sb.append("VS "+getSignedDouble(vel_up,omega_format)+"\n");
} else if (reserve_missing_fields){ } else if (reserve_missing_fields){
sb.append("\n"); sb.append("\n");
} }
} }
if ((annot_mode & (1 << ANNOT_GS)) != 0){ if ((annot_mode & (1 << ANNOT_GS)) != 0){
if (!Double.isNaN(vel_hor) && (range <= max_annot_range)) { if (!Double.isNaN(vel_hor) && (range <= max_annot_range)) {
sb.append(String.format("GS %4.1f\n", vel_hor)); sb.append("GS "+String.format(number_frac_format,vel_hor)+"\n");
// sb.append(String.format("GS %4.1f\n", vel_hor));
} else if (reserve_missing_fields){ } else if (reserve_missing_fields){
sb.append("\n"); sb.append("\n");
} }
} }
if ((annot_mode & (1 << ANNOT_HDG)) != 0){ if ((annot_mode & (1 << ANNOT_HDG)) != 0){
if (!Double.isNaN(hdg_deg) && (range <= max_annot_range)) { if (!Double.isNaN(hdg_deg) && (range <= max_annot_range)) {
sb.append(String.format("HDG %4.0f\n", hdg_deg)); sb.append("HDG "+String.format(number_unsigned_format,hdg_deg)+"\n");
// sb.append(String.format("HDG %4.0f\n", hdg_deg));
} else if (reserve_missing_fields){ } else if (reserve_missing_fields){
sb.append("\n"); sb.append("\n");
} }
} }
if ((annot_mode & (1 << ANNOT_MISM)) != 0){
double mismatch_before = target0[CuasMotionLMA.RSLT_MISMATCH_BEFORE];
double mismatch_after = target0[CuasMotionLMA.RSLT_MISMATCH_AFTER];
sb.append("ERRb"+String.format(number_frac_format,mismatch_before)+"\n");
sb.append("ERRa"+String.format(number_frac_format,mismatch_after)+"\n");
}
if ((annot_mode & (1 << ANNOT_SEQ)) != 0){
double sequence_length = target0[CuasMotionLMA.RSLT_MATCH_LENGTH];
sb.append("SEQ "+String.format(number_unsigned_format,sequence_length)+"\n");
}
if ((annot_mode & (1 << ANNOT_TRV)) != 0){
double sequence_travel = target0[CuasMotionLMA.RSLT_SEQ_TRAVEL];
sb.append("TRV "+String.format(number_frac_format,sequence_travel)+"\n");
}
if ((annot_mode & (1 << ANNOT_SCORE)) != 0){
double score = target0[CuasMotionLMA.RSLT_QSCORE];
sb.append("S "+String.format(number_frac_format,score)+"\n");
}
// if (!Double.isInfinite(range)) {
return sb.toString(); return sb.toString();
} }
...@@ -5078,7 +5165,11 @@ public class CuasMotion { ...@@ -5078,7 +5165,11 @@ public class CuasMotion {
double v0, double v0,
double v1, double v1,
double k) { double k) {
return k*v1 + (1-k) * v0; if (k==0) {
return v0;
} else {
return k*v1 + (1-k) * v0;
}
} }
public static void drawCircle( public static void drawCircle(
ColorProcessor colorProcessor, ColorProcessor colorProcessor,
...@@ -5344,6 +5435,7 @@ public class CuasMotion { ...@@ -5344,6 +5435,7 @@ public class CuasMotion {
String omega_format = "%3.1f"; String omega_format = "%3.1f";
String omega = "\u03A9"; String omega = "\u03A9";
String txt = ""; String txt = "";
txt += " ID "+String.format("%03d",(int) Math.round(target[TARGET_ID]))+"\n";
txt += " AZ "+String.format(number_format,az_el_oaz_oel[0][0])+"\n"; txt += " AZ "+String.format(number_format,az_el_oaz_oel[0][0])+"\n";
txt += " EL "+ getSignedDouble(az_el_oaz_oel[0][1],number_format)+"\n"; txt += " EL "+ getSignedDouble(az_el_oaz_oel[0][1],number_format)+"\n";
txt += omega+"AZ "+getSignedDouble(az_el_oaz_oel[1][0],omega_format)+"\n"; txt += omega+"AZ "+getSignedDouble(az_el_oaz_oel[1][0],omega_format)+"\n";
...@@ -5405,7 +5497,6 @@ public class CuasMotion { ...@@ -5405,7 +5497,6 @@ public class CuasMotion {
boolean remove_avi = clt_parameters.imp.remove_avi; boolean remove_avi = clt_parameters.imp.remove_avi;
boolean dry_run = false; boolean dry_run = false;
String avi_path = null; String avi_path = null;
if (file_path != null) { if (file_path != null) {
try { try {
avi_path=QuadCLT.saveAVI( avi_path=QuadCLT.saveAVI(
...@@ -5711,9 +5802,13 @@ public class CuasMotion { ...@@ -5711,9 +5802,13 @@ public class CuasMotion {
0); // int y0) 0); // int y0)
// imp_color2.show(); // imp_color2.show();
// parentCLT.saveImagePlusInModelDirectory(imp_color2); // parentCLT.saveImagePlusInModelDirectory(imp_color2);
int annot_mode = 0xffffffbf;
if (video_pass) {
annot_mode &= ANNOT_CLEAN;
}
ImagePlus img_radar = generateRadarImage( ImagePlus img_radar = generateRadarImage(
clt_parameters, clt_parameters,
-1, // int annot_mode, // specify bits annot_mode, // -1, // int annot_mode, // specify bits
parentCLT, // QuadCLT scene, parentCLT, // QuadCLT scene,
target_sequence, target_sequence,
uasLogReader, // contains camera orientation (getCameraATR()) uasLogReader, // contains camera orientation (getCameraATR())
...@@ -6971,7 +7066,14 @@ public class CuasMotion { ...@@ -6971,7 +7066,14 @@ public class CuasMotion {
*/ */
final int len_grp_before = num_grp_before; final int len_grp_before = num_grp_before;
final int len_grp_after = agrp.get()-len_grp_before; final int len_grp_after = agrp.get()-len_grp_before;
final boolean [][] ba_pairs = new boolean [len_grp_before -1][len_grp_after]; System.out.println("calcMatchingTargetsLengths(): len_grp_before="+len_grp_before+", len_grp_after="+len_grp_after);
/*
with
calcMatchingTargetsLengths(): ba=0, agrp=772980
calcMatchingTargetsLengths(): ba=1, agrp=1545956
running with calc_linked== false, got Java heap space (). It could not work (over 4 TB)
*/
final boolean [][] ba_pairs = calc_linked ? (new boolean [len_grp_before -1][len_grp_after]): null;;
ai.set(0); ai.set(0);
// combine before/after into a single value // combine before/after into a single value
for (int ithread = 0; ithread < threads.length; ithread++) { for (int ithread = 0; ithread < threads.length; ithread++) {
...@@ -7013,7 +7115,9 @@ public class CuasMotion { ...@@ -7013,7 +7115,9 @@ public class CuasMotion {
} }
int grp_before = target_grp[0][nSeq][ntile][ntarg]-1; int grp_before = target_grp[0][nSeq][ntile][ntarg]-1;
int grp_after = target_grp[1][nSeq][ntile][ntarg] - len_grp_before; int grp_after = target_grp[1][nSeq][ntile][ntarg] - len_grp_before;
ba_pairs[grp_before][grp_after] = true; if (ba_pairs != null) {
ba_pairs[grp_before][grp_after] = true;
}
if (ntile == dbg_tile) { if (ntile == dbg_tile) {
System.out.println("calcMathingTargetsLengths().4 nSeq = "+nSeq+", targets["+ntarg+"][CuasMotionLMA.RSLT_MATCH_LENGTH]="+ System.out.println("calcMathingTargetsLengths().4 nSeq = "+nSeq+", targets["+ntarg+"][CuasMotionLMA.RSLT_MATCH_LENGTH]="+
target[CuasMotionLMA.RSLT_MATCH_LENGTH]+", travel="+target[CuasMotionLMA.RSLT_SEQ_TRAVEL]); target[CuasMotionLMA.RSLT_MATCH_LENGTH]+", travel="+target[CuasMotionLMA.RSLT_SEQ_TRAVEL]);
...@@ -9738,15 +9842,18 @@ public class CuasMotion { ...@@ -9738,15 +9842,18 @@ public class CuasMotion {
parentCLT.saveImagePlusInModelDirectory(imp_omegas); parentCLT.saveImagePlusInModelDirectory(imp_omegas);
} }
*/ */
target_single = convertFromMultiTarget(// single target per tile double [][][] target_single_new = convertFromMultiTarget(// single target per tile
targets_multi); // final double [][][][] target_multi) { targets_multi); // final double [][][][] target_multi) {
if (target_single_new != null) {
System.arraycopy(target_single_new, 0, target_single, 0, Math.min(target_single_new.length, target_single.length));
}
if (intermed_low) { if (intermed_low) {
ImagePlus imp_omegas = showTargetSequence( ImagePlus imp_omegas = showTargetSequence(
targets_multi, // double [][][] vector_fields_sequence, targets_multi, // double [][][] vector_fields_sequence,
slice_titles, // String [] titles, // all slices*frames titles or just slice titles or null slice_titles, // String [] titles, // all slices*frames titles or just slice titles or null
model_prefix+"-SMOOTH_OMEGAS_SINGLE",// String title, model_prefix+"-SMOOTH_OMEGAS_SINGLE",// String title,
false, // final boolean good_only, false, // final boolean good_only,
false, // final boolean show_empty, // show scenes with no (valid) targets true, // false, // final boolean show_empty, // show scenes with no (valid) targets
!batch_mode, // boolean show, !batch_mode, // boolean show,
tilesX); // int tilesX) { tilesX); // int tilesX) {
parentCLT.saveImagePlusInModelDirectory(imp_omegas); parentCLT.saveImagePlusInModelDirectory(imp_omegas);
......
...@@ -2,6 +2,10 @@ package com.elphel.imagej.cuas; ...@@ -2,6 +2,10 @@ package com.elphel.imagej.cuas;
import java.awt.Point; import java.awt.Point;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.nio.file.Path; import java.nio.file.Path;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
...@@ -51,6 +55,7 @@ public class CuasMultiSeries { ...@@ -51,6 +55,7 @@ public class CuasMultiSeries {
public CuasMultiSeries ( public CuasMultiSeries (
CLTParameters clt_parameters, CLTParameters clt_parameters,
boolean video_mode,
UasLogReader uasLogReader, UasLogReader uasLogReader,
QuadCLT quadCLT_main, QuadCLT quadCLT_main,
String path, String path,
...@@ -137,6 +142,113 @@ public class CuasMultiSeries { ...@@ -137,6 +142,113 @@ public class CuasMultiSeries {
} }
} }
public void combineVideos() {
String extra_suffix_with_radar = "-2";
// double video_fps = clt_parameters.imp.video_fps;
String video_codec_combo = clt_parameters.imp.video_codec.toLowerCase();
int video_crf_combo = clt_parameters.imp.video_crf;
double video_bitrate_m = clt_parameters.imp.video_bitrate_m;
System.out.println();
ArrayList<String> video_paths = new ArrayList<String>();
// int annot_mode = -1; // specify bits
int corr_pairs = clt_parameters.imp.cuas_corr_pairs;
boolean ra_background = clt_parameters.imp.cuas_ra_background; // true;
String ra_bg_suffix=(ra_background? ("-RABG"+corr_pairs):"");
String clean_suffix = "-CLEAN";
for (int nser = 0; nser < model_names.length; nser++) {
String image_name = model_names[nser];
String webm_title = image_name+CuasMotion.getParametersSuffixRslt(clt_parameters,"-RGB"+ra_bg_suffix+clean_suffix)+extra_suffix_with_radar+".webm";
String webm_path = new File(model_dirs[nser], webm_title).toString();
File webm_file = new File(webm_path);
if (webm_file.exists()) {
video_paths.add(webm_path);
}
}
System.out.println("Combining "+video_paths.size()+" video files.");
String videoDirectory = master_CLT.correctionsParameters.selectVideoDirectory(true,true);
if (videoDirectory == null) {
System.out.println("No video directory selected");
return;
}
File video_dir = new File (videoDirectory);
video_dir.mkdirs(); // Should already exist
String combo_video_name = "COMBO"+CuasMotion.getParametersSuffixRslt(clt_parameters,"-RGB"+ra_bg_suffix+clean_suffix)+extra_suffix_with_radar+".webm";
String concat_list_name = combo_video_name.substring(0, combo_video_name.lastIndexOf("."))+".list";
File list_to_concat = new File (video_dir,concat_list_name);
// delete if exists
if (list_to_concat.exists()) {
list_to_concat.delete();
}
PrintWriter writer = null;
try {
writer = new PrintWriter(list_to_concat, "UTF-8");
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if (writer == null) {
return;
}
// int num_segments = 0;
for (String path:video_paths) {
writer.println("file '"+path+"'");
// num_segments++;
}
writer.close();
File video_out = new File (video_dir,combo_video_name);
if (video_out.exists()) {
video_out.delete();
}
double pts_scale = clt_parameters.imp.video_fps/clt_parameters.imp.sensor_fps;
pts_scale = 1.0;
String shellCommand;
//ffmpeg -i input_file.mkv -c copy -metadata:s:v:0 stereo_mode=1 output_file.mkv
//https://ffmpeg.org/ffmpeg-formats.html
//ffmpeg -i sample_left_right_clip.mpg -an -c:v libvpx -metadata stereo_mode=left_right -y stereo_clip.webm
//anaglyph_cyan_red
shellCommand = String.format("ffmpeg -y -f concat -safe 0 -i %s -r 60 -vf setpts=%f*PTS -b:v %fM -crf %d -c %s %s",
list_to_concat.toString(), pts_scale, video_bitrate_m, video_crf_combo, video_codec_combo, video_out.toString());
Process p = null;
int exit_code = -1;
System.out.println("Will run shell command: \""+shellCommand+"\"");
System.out.println("This may take a while, please wait ...");
try {
p = Runtime.getRuntime().exec(
shellCommand,
null, // env
video_dir // working dir - needed if "-report" is added to ffmpeg command
);
} catch (IOException e) {
System.out.println("Failed shell command: \""+shellCommand+"\"");
}
if (p != null) {
try {
p.waitFor();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
exit_code = p.exitValue();
}
System.out.println("Ran shell command: \""+shellCommand+"\" -> ");
if ((exit_code != 0) || !video_out.exists()) {
System.out.println("Failed to create : \""+video_out.toString()+"\"");
}
return;
}
public void processGlobals() { public void processGlobals() {
int debugLevel = 0; int debugLevel = 0;
int setup_uas = setupUasTiles(); int setup_uas = setupUasTiles();
...@@ -147,7 +259,7 @@ public class CuasMultiSeries { ...@@ -147,7 +259,7 @@ public class CuasMultiSeries {
printUasStats(); printUasStats();
printAssignments(); printAssignments();
combineLocalTargets( combineLocalTargets(
true, // boolean skip_assigned, // if global ID is assigned, do not mess wi that pair true, // boolean skip_assigned, // if global ID is assigned, do not mess with that pair
debugLevel); // int debugLevel) debugLevel); // int debugLevel)
printLocalAssignments(); printLocalAssignments();
combineGlobalTargets( combineGlobalTargets(
...@@ -156,8 +268,8 @@ public class CuasMultiSeries { ...@@ -156,8 +268,8 @@ public class CuasMultiSeries {
printAssignmentStats(); printAssignmentStats();
printAssignments(); printAssignments();
printReverseAssignments(); printReverseAssignments();
double min_disparity_range = 0.02; double min_disparity_range = 0.02; // make parameter? do not calculate range for too small disparity
double min_disparity_velocity = 0.08; double min_disparity_velocity = 0.08; // make parameter? do not calculate axial velocity for too small disparity
avg_range_ts = getAverageRangeTimestamp( avg_range_ts = getAverageRangeTimestamp(
min_disparity_range, // double min_disparity_range){ min_disparity_range, // double min_disparity_range){
min_disparity_velocity); // double min_disparit_velocity); min_disparity_velocity); // double min_disparit_velocity);
...@@ -168,7 +280,7 @@ public class CuasMultiSeries { ...@@ -168,7 +280,7 @@ public class CuasMultiSeries {
// //
ImagePlus imp_radar = testGenerateRadarImage( ImagePlus imp_radar = testGenerateRadarImage(
clt_parameters, // CLTParameters clt_parameters, clt_parameters, // CLTParameters clt_parameters,
15, // int nser, 3, // 15, // int nser,
uasLogReader, // UasLogReader uasLogReader, // contains camera orientation (getCameraATR()) uasLogReader, // UasLogReader uasLogReader, // contains camera orientation (getCameraATR())
debugLevel); // int debugLevel) { debugLevel); // int debugLevel) {
return; return;
...@@ -418,17 +530,20 @@ public class CuasMultiSeries { ...@@ -418,17 +530,20 @@ public class CuasMultiSeries {
boolean debug = debugLevel>= debug_min; boolean debug = debugLevel>= debug_min;
final int tmtch_gaps = clt_parameters.imp.cuas_tmtch_gaps; final int tmtch_gaps = clt_parameters.imp.cuas_tmtch_gaps;
final double tmtch_apix = clt_parameters.imp.cuas_tmtch_apix; final double local_apix = clt_parameters.imp.cuas_local_apix;
// final double tmtch_axv = clt_parameters.imp.cuas_tmtch_axv; // final double tmtch_axv = clt_parameters.imp.cuas_tmtch_axv;
// final double tmtch_axv_k = clt_parameters.imp.cuas_tmtch_axv_k; // final double tmtch_axv_k = clt_parameters.imp.cuas_tmtch_axv_k;
// final double tmtch_disp = clt_parameters.imp.cuas_tmtch_disp; // final double tmtch_disp = clt_parameters.imp.cuas_tmtch_disp;
final double local_disp_diff = clt_parameters.imp.cuas_local_diff; // maximal disparity difference to match 3d (regardless of absolute disparity
// final double min_disp = clt_parameters.imp.cuas_tmtch_disp + clt_parameters.imp.cuas_infinity; // minimal "raw" disparity (with infinity at cuas_infinity)
final boolean shortest_gap = clt_parameters.imp.cuas_tmtch_short; // if two merges conflict, use one with the shortest gap (false - longest combo). Pairwise only final boolean shortest_gap = clt_parameters.imp.cuas_tmtch_short; // if two merges conflict, use one with the shortest gap (false - longest combo). Pairwise only
final double tmtch_pix2 = tmtch_apix * tmtch_apix; final double local_pix2 = local_apix * local_apix;
// final double velocity_scale = 1.0/clt_parameters.imp.cuas_corr_offset; // final double velocity_scale = 1.0/clt_parameters.imp.cuas_corr_offset;
final int tilesX = master_CLT.getTilesX(); final int tilesX = master_CLT.getTilesX();
final int tileSize = GPUTileProcessor.DTT_SIZE; final int tileSize = GPUTileProcessor.DTT_SIZE;
final Thread[] threads = ImageDtt.newThreadArray(); final Thread[] threads = ImageDtt.newThreadArray();
final AtomicInteger ai = new AtomicInteger(0); final AtomicInteger ai = new AtomicInteger(0);
final int dbg_nser = -3;
for (int ithread = 0; ithread < threads.length; ithread++) { for (int ithread = 0; ithread < threads.length; ithread++) {
threads[ithread] = new Thread() { threads[ithread] = new Thread() {
public void run() { public void run() {
...@@ -437,6 +552,9 @@ public class CuasMultiSeries { ...@@ -437,6 +552,9 @@ public class CuasMultiSeries {
int num_targ = targets_start_end[nSer].length; int num_targ = targets_start_end[nSer].length;
int num_after = 0; int num_after = 0;
boolean [][] after = new boolean [num_targ][num_targ]; boolean [][] after = new boolean [num_targ][num_targ];
if (nSer == dbg_nser) {
System.out.println("combineLocalTargets(): nSer="+nSer);
}
// skip pairs that have global target_id >0 (at least skip UAS // skip pairs that have global target_id >0 (at least skip UAS
for (int ntarg = 0; ntarg < num_targ; ntarg++) if (!skip_assigned ||(target_map[nSer][ntarg] <= 0)) { // no globally assigned for (int ntarg = 0; ntarg < num_targ; ntarg++) if (!skip_assigned ||(target_map[nSer][ntarg] <= 0)) { // no globally assigned
for (int ntarg1 = ntarg+1; ntarg1 < num_targ; ntarg1++) if (!skip_assigned || (target_map[nSer][ntarg1] <= 0)) { // no globally assigned for (int ntarg1 = ntarg+1; ntarg1 < num_targ; ntarg1++) if (!skip_assigned || (target_map[nSer][ntarg1] <= 0)) { // no globally assigned
...@@ -485,11 +603,30 @@ public class CuasMultiSeries { ...@@ -485,11 +603,30 @@ public class CuasMultiSeries {
fps); // double fps, fps); // double fps,
// check gap size // check gap size
// check ranges/disparity // check ranges/disparity
if (err2 <= tmtch_pix2) { if (err2 <= local_pix2) {
pair_list.add(new Point(ntarg0, ntarg1)); double [] middle_target0 = getMiddleTarget(
if (debug) { nSer, // int nser,
System.out.println("combineLocalTargets(): nSer="+nSer+", ntarg0="+ntarg0+", ntarg1="+ntarg1+ ntarg0, // int local_target)
", err="+Math.sqrt(err2)); null); // int [] seq_tile) {
double [] middle_target1 = getMiddleTarget(
nSer, // int nser,
ntarg1, // int local_target)
null); // int [] seq_tile) {
double md0 = (middle_target0 == null) ? Double.NaN: middle_target0[CuasMotionLMA.RSLT_GDISPARITY];
double md1 = (middle_target1 == null) ? Double.NaN: middle_target1[CuasMotionLMA.RSLT_GDISPARITY];
double md0z = Double.isNaN(md0)? 0 : md0;
double md1z = Double.isNaN(md1)? 0 : md1;
if (Math.abs(md1z-md0z) < local_disp_diff) { // false for NaN
pair_list.add(new Point(ntarg0, ntarg1));
if (debug) {
System.out.println("combineLocalTargets(): nSer="+nSer+", ntarg0="+ntarg0+", ntarg1="+ntarg1+
", disp_diff="+Math.abs(md1-md0));
}
} else {
if (debug) {
System.out.println("combineLocalTargets(): nSer="+nSer+", ntarg0="+ntarg0+", ntarg1="+ntarg1+
", md0="+md0+", md1="+md1+", abs(md1-md0) ="+Math.abs(md1-md0)+"> "+local_disp_diff+" (or NaN");
}
} }
} }
} }
...@@ -567,7 +704,8 @@ public class CuasMultiSeries { ...@@ -567,7 +704,8 @@ public class CuasMultiSeries {
final double tmtch_rpix = clt_parameters.imp.cuas_tmtch_rpix; final double tmtch_rpix = clt_parameters.imp.cuas_tmtch_rpix;
final double tmtch_axv = clt_parameters.imp.cuas_tmtch_axv; final double tmtch_axv = clt_parameters.imp.cuas_tmtch_axv;
final double tmtch_axv_k = clt_parameters.imp.cuas_tmtch_axv_k; final double tmtch_axv_k = clt_parameters.imp.cuas_tmtch_axv_k;
final double min_disp = clt_parameters.imp.cuas_tmtch_disp + clt_parameters.imp.cuas_infinity; // minimal "raw" disparity (with infinity at cuas_infinity) final double tmtch_disp_diff = clt_parameters.imp.cuas_tmtch_diff; // maximal disparity difference to match 3d (regardless of absolute disparity
final double min_disp = clt_parameters.imp.cuas_tmtch_disp + clt_parameters.imp.cuas_infinity; // minimal "raw" disparity (with infinity at cuas_infinity)
final boolean shortest_gap = clt_parameters.imp.cuas_tmtch_short; // if two merges conflict, use one with the shortest gap (false - longest combo). Pairwise only final boolean shortest_gap = clt_parameters.imp.cuas_tmtch_short; // if two merges conflict, use one with the shortest gap (false - longest combo). Pairwise only
// final double tmtch_pix2 = tmtch_apix * tmtch_apix; // final double tmtch_pix2 = tmtch_apix * tmtch_apix;
...@@ -581,12 +719,16 @@ public class CuasMultiSeries { ...@@ -581,12 +719,16 @@ public class CuasMultiSeries {
pairs[0] = new int [0][]; pairs[0] = new int [0][];
} }
// pair[0] is local target index, not the target group // pair[0] is local target index, not the target group
final int gbg_nser = -3;
for (int ithread = 0; ithread < threads.length; ithread++) { for (int ithread = 0; ithread < threads.length; ithread++) {
threads[ithread] = new Thread() { threads[ithread] = new Thread() {
public void run() { public void run() {
for (int nSer = ai.getAndIncrement(); nSer < targets_multi_series.length; nSer = ai.getAndIncrement()) { for (int nSer = ai.getAndIncrement(); nSer < targets_multi_series.length; nSer = ai.getAndIncrement()) {
double fps = getFps(nSer); double fps = getFps(nSer);
int prev_ser = nSer -1; int prev_ser = nSer -1;
if (nSer==gbg_nser) {
System.out.println("combineGlobalTargets(): nSer="+nSer);
}
ArrayList<Point> pair_list = new ArrayList<Point>(); ArrayList<Point> pair_list = new ArrayList<Point>();
for (int ntgrp0 = 0; ntgrp0 < local_imap[prev_ser].length; ntgrp0++) { for (int ntgrp0 = 0; ntgrp0 < local_imap[prev_ser].length; ntgrp0++) {
int [] targs0 = local_imap[prev_ser][ntgrp0]; int [] targs0 = local_imap[prev_ser][ntgrp0];
...@@ -638,38 +780,52 @@ public class CuasMultiSeries { ...@@ -638,38 +780,52 @@ public class CuasMultiSeries {
null); // int [] seq_tile) { null); // int [] seq_tile) {
// only check matches if disparity is sufficient // only check matches if disparity is sufficient
boolean range_match = true; boolean range_match = false;
if ((middle_target0 != null) && (middle_target1 != null) && // do not have measured disparity at all double md0 = (middle_target0 == null) ? 0: middle_target0[CuasMotionLMA.RSLT_GDISPARITY];
(middle_target0[CuasMotionLMA.RSLT_GDISPARITY] > min_disp) && double md1 = (middle_target1 == null) ? 0: middle_target1[CuasMotionLMA.RSLT_GDISPARITY];
(middle_target1[CuasMotionLMA.RSLT_GDISPARITY] > min_disp)) { if (Math.abs(md1-md0) < tmtch_disp_diff) { // false for NaN
double range0 = middle_target0[CuasMotionLMA.RSLT_GRANGE]; range_match = true;
double range1 = middle_target1[CuasMotionLMA.RSLT_GRANGE]; /*
double avelocity = (range1 - range0)/dt; if ((middle_target0 != null) && (middle_target1 != null) && // do not have measured disparity at all
double lvelocity = getLateralVelocity ( (middle_target0[CuasMotionLMA.RSLT_GDISPARITY] > min_disp) &&
clt_parameters, //CLTParameters clt_parameters, (middle_target1[CuasMotionLMA.RSLT_GDISPARITY] > min_disp)) {
gc, // GeometryCorrection gc, */
middle_target0, // double [] target0, // should contain RSLT_VX, RSLT_VX, RSLT_GRANGE, if ((md0 > min_disp) && (md1 > min_disp)) {
middle_target1, // double [] target1, // should contain RSLT_VX, RSLT_VX, RSLT_GRANGE, double range0 = middle_target0[CuasMotionLMA.RSLT_GRANGE];
fps); // double fps){ // velocity_scale times fps double range1 = middle_target1[CuasMotionLMA.RSLT_GRANGE];
double max_axial_velocity = Math.max(tmtch_axv, lvelocity * tmtch_axv_k); double avelocity = (range1 - range0)/dt;
if (Math.abs (avelocity) > max_axial_velocity) { double lvelocity = getLateralVelocity (
range_match = false; clt_parameters, //CLTParameters clt_parameters,
} gc, // GeometryCorrection gc,
if (debug) { middle_target0, // double [] target0, // should contain RSLT_VX, RSLT_VX, RSLT_GRANGE,
System.out.println("combineGlobalTargets(): nSer="+nSer+", ntarg0="+ntarg0+", ntarg1="+ntarg1+ middle_target1, // double [] target1, // should contain RSLT_VX, RSLT_VX, RSLT_GRANGE,
", range0="+range0+", range1="+range1+", avelocity="+avelocity+"m/s, lvelocity="+ fps); // double fps){ // velocity_scale times fps
lvelocity+"m/s, disparity="+ double max_axial_velocity = Math.max(tmtch_axv, lvelocity * tmtch_axv_k);
middle_target0[CuasMotionLMA.RSLT_GDISPARITY]+ if (Math.abs (avelocity) > max_axial_velocity) {
":"+middle_target1[CuasMotionLMA.RSLT_GDISPARITY] + range_match = false;
", max_axial_velocity="+max_axial_velocity+"m/s, range_match="+range_match); }
if (debug) {
System.out.println("combineGlobalTargets(): nSer="+nSer+", ntarg0="+ntarg0+", ntarg1="+ntarg1+
", range0="+range0+", range1="+range1+", avelocity="+avelocity+"m/s, lvelocity="+
lvelocity+"m/s, disparity="+
middle_target0[CuasMotionLMA.RSLT_GDISPARITY]+
":"+middle_target1[CuasMotionLMA.RSLT_GDISPARITY] +
", max_axial_velocity="+max_axial_velocity+"m/s, range_match="+range_match);
}
} else {
if (debug) {
//double disp0 = (middle_target0 == null)? Double.NaN: middle_target0[CuasMotionLMA.RSLT_GDISPARITY];
//double disp1 = (middle_target1 == null)? Double.NaN: middle_target1[CuasMotionLMA.RSLT_GDISPARITY];
System.out.println("combineGlobalTargets(): nSer="+nSer+", ntarg0="+ntarg0+", ntarg1="+ntarg1+
". Bypassing axial matching - disparity="+md0+
":"+md1+" < "+min_disp+" .");
}
} }
} else { } else {
if (debug) { if (debug) {
double disp0 = (middle_target0 == null)? Double.NaN: middle_target0[CuasMotionLMA.RSLT_GDISPARITY];
double disp1 = (middle_target1 == null)? Double.NaN: middle_target1[CuasMotionLMA.RSLT_GDISPARITY];
System.out.println("combineGlobalTargets(): nSer="+nSer+", ntarg0="+ntarg0+", ntarg1="+ntarg1+ System.out.println("combineGlobalTargets(): nSer="+nSer+", ntarg0="+ntarg0+", ntarg1="+ntarg1+
". Bypassing axial matching - disparity="+disp0+ ", disparity0="+md0+", disparity1="+md1+
":"+disp1+" < "+min_disp+" ."); ". Disparity difference="+Math.abs(md1-md0)+" is not less than "+tmtch_disp_diff+" .");
} }
} }
if (range_match) { if (range_match) {
...@@ -900,6 +1056,7 @@ public class CuasMultiSeries { ...@@ -900,6 +1056,7 @@ public class CuasMultiSeries {
final GeometryCorrection gc = master_CLT.getGeometryCorrection(); final GeometryCorrection gc = master_CLT.getGeometryCorrection();
final Thread[] threads = ImageDtt.newThreadArray(); final Thread[] threads = ImageDtt.newThreadArray();
final AtomicInteger ai = new AtomicInteger(0); final AtomicInteger ai = new AtomicInteger(0);
final int dbg_gtarg = -21-1;
for (int ithread = 0; ithread < threads.length; ithread++) { for (int ithread = 0; ithread < threads.length; ithread++) {
threads[ithread] = new Thread() { threads[ithread] = new Thread() {
public void run() { public void run() {
...@@ -910,6 +1067,9 @@ public class CuasMultiSeries { ...@@ -910,6 +1067,9 @@ public class CuasMultiSeries {
int target_id = nGtarg+1; int target_id = nGtarg+1;
int indx_first = 0; int indx_first = 0;
int indx_next =0; int indx_next =0;
if (nGtarg == dbg_gtarg) {
System.out.println("getAverageRangeTimestamp(): nGtarg="+nGtarg);
}
for (; indx_first < rmap.length; indx_first = indx_next) { for (; indx_first < rmap.length; indx_first = indx_next) {
int nser = rmap[indx_first][0]; int nser = rmap[indx_first][0];
double ts_start = getKeyTimeStamp( double ts_start = getKeyTimeStamp(
...@@ -953,6 +1113,10 @@ public class CuasMultiSeries { ...@@ -953,6 +1113,10 @@ public class CuasMultiSeries {
avg_rts[nGtarg][nser][AVG_DISPARITY] = avg_disp; avg_rts[nGtarg][nser][AVG_DISPARITY] = avg_disp;
avg_rts[nGtarg][nser][AVG_VELOCIY] = Double.NaN; avg_rts[nGtarg][nser][AVG_VELOCIY] = Double.NaN;
} }
}
if (nGtarg == dbg_gtarg) {
System.out.println("getAverageRangeTimestamp(): nGtarg="+nGtarg);
} }
} }
} }
...@@ -1345,7 +1509,7 @@ public class CuasMultiSeries { ...@@ -1345,7 +1509,7 @@ public class CuasMultiSeries {
int nser, int nser,
UasLogReader uasLogReader, // contains camera orientation (getCameraATR()) UasLogReader uasLogReader, // contains camera orientation (getCameraATR())
int debugLevel) { int debugLevel) {
int annot_mode = -1; // specify bits int annot_mode = 0xffffffbf; // -1; // specify bits
String image_name = model_names[nser]; String image_name = model_names[nser];
int corr_pairs = clt_parameters.imp.cuas_corr_pairs; int corr_pairs = clt_parameters.imp.cuas_corr_pairs;
boolean ra_background = clt_parameters.imp.cuas_ra_background; // true; boolean ra_background = clt_parameters.imp.cuas_ra_background; // true;
...@@ -1376,16 +1540,4 @@ public class CuasMultiSeries { ...@@ -1376,16 +1540,4 @@ public class CuasMultiSeries {
return null; return null;
} }
public void setupGlobalTargets(
) {
double known_err= clt_parameters.imp.cuas_known_err;
double tmtch_frac = clt_parameters.imp.cuas_tmtch_frac;
int tmtch_ends = clt_parameters.imp.cuas_tmtch_ends;
double tmtch_pix = clt_parameters.imp.cuas_tmtch_pix;
double tmtch_axv = clt_parameters.imp.cuas_tmtch_axv;
double tmtch_axv_k = clt_parameters.imp.cuas_tmtch_axv_k;
double tmtch_disp = clt_parameters.imp.cuas_tmtch_disp;
}
} }
...@@ -277,7 +277,7 @@ public class CuasRanging { ...@@ -277,7 +277,7 @@ public class CuasRanging {
} }
} }
} }
if (smooth_omegas) { if (smooth_omegas) { // may be empty
if (debugLevel > -4) { if (debugLevel > -4) {
System.out.println ("Recalculating omegas to better fit target positions in consecutive key frames."); System.out.println ("Recalculating omegas to better fit target positions in consecutive key frames.");
} }
......
...@@ -918,14 +918,17 @@ min_str_neib_fpn 0.35 ...@@ -918,14 +918,17 @@ min_str_neib_fpn 0.35
// targets matching parameters // targets matching parameters
public double cuas_known_err = 20; // pix, mark as "identified" when closer to the flight log position public double cuas_known_err = 20; // pix, mark as "identified" when closer to the flight log position
public double cuas_tmtch_frac = 0.8; // target should match flight log in theis fraction of keyframes public double cuas_tmtch_frac = 0.8; // target should match flight log in theis fraction of keyframes
public int cuas_tmtch_ends = 2; // maximal number of undetected first/last keyframes to compare to previous/next sequence public int cuas_tmtch_ends = 6; // 2; // maximal number of undetected first/last keyframes to compare to previous/next sequence
public int cuas_tmtch_gaps = 4; // maximal number of consecutive undetected keyframes of the same target public int cuas_tmtch_gaps = 10; // 4; // maximal number of consecutive undetected keyframes of the same target
public double cuas_tmtch_pix = 10.0; // maximal pixel mismatch for UAS target public double cuas_tmtch_pix = 10.0; // maximal pixel mismatch for UAS target
public double cuas_tmtch_apix = 10.0; // maximal absolute pixel mismatch for the same target extrapolated with the average of the before/after lateral speeds public double cuas_local_apix = 2.0; // maximal absolute pixel mismatch for local targets matching (tightened)
public double cuas_tmtch_rpix = 1.0; // maximal pixel/s mismatch for the same target extrapolated with the average of the before/after lateral speeds public double cuas_tmtch_apix = 5.0; // 10.0; // maximal absolute pixel mismatch for the same target extrapolated with the average of the before/after lateral speeds
public double cuas_tmtch_axv = 20.0; // m/s maximal axial (range) velocity in m/s public double cuas_tmtch_rpix = 1.0; // maximal pixel/s mismatch for the same target extrapolated with the average of the before/after lateral speeds
public double cuas_tmtch_axv = 50.0; //20.0; // m/s maximal axial (range) velocity in m/s
public double cuas_tmtch_axv_k = 3.0; // maximal axial (range) velocity to lateral velocity ratio (take max) 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 double cuas_local_diff = 1.5; // maximal disparity difference to match 3d for local target match (loosened for local)
public double cuas_tmtch_diff = 0.06;// maximal disparity difference to match 3d (regardless of absolute disparity)
public double cuas_tmtch_disp = 0.2; // 0.1; // minimal disparity (any should be above) to estimate lateral velocity (smaller - match2d only)
public boolean cuas_tmtch_short = true; // when multiple conflicting matches, prefer shortest gap (false - longest combo pair length) public boolean cuas_tmtch_short = true; // when multiple conflicting matches, prefer shortest gap (false - longest combo pair length)
// parameters for "radar" image generation // parameters for "radar" image generation
...@@ -2761,7 +2764,9 @@ min_str_neib_fpn 0.35 ...@@ -2761,7 +2764,9 @@ min_str_neib_fpn 0.35
"Maxiaml undetected target gaps in the same sequence."); "Maxiaml undetected target gaps in the same sequence.");
gd.addNumericField("Maximal pixel mismatch for the UAS target", this.cuas_tmtch_pix, 5,8,"pix", gd.addNumericField("Maximal pixel mismatch for the UAS target", this.cuas_tmtch_pix, 5,8,"pix",
"Maximal pixel mismatch for the UAS target extrapolated with the average of the before/after lateral speeds."); "Maximal pixel mismatch for the UAS target extrapolated with the average of the before/after lateral speeds.");
gd.addNumericField("Maximal lateral mismatch, same sequence", this.cuas_tmtch_apix, 5,8,"pix", gd.addNumericField("Maximal lateral mismatch, same sequence", this.cuas_local_apix, 5,8,"pix",
"Maximal pixel mismatch for the same non-UAS target in the same sequence (tighter than inter-sequence).");
gd.addNumericField("Maximal lateral mismatch, other sequence", this.cuas_tmtch_apix, 5,8,"pix",
"Maximal pixel mismatch for the same non-UAS target extrapolated with the average of the before/after lateral speeds."); "Maximal pixel mismatch for the same non-UAS target extrapolated with the average of the before/after lateral speeds.");
gd.addNumericField("Maximal lateral mismatch, per second", this.cuas_tmtch_rpix, 5,8,"pix/s", gd.addNumericField("Maximal lateral mismatch, per second", this.cuas_tmtch_rpix, 5,8,"pix/s",
"Maximal pixel mismatch for the same target extrapolated with the average of the before/after lateral speeds."); "Maximal pixel mismatch for the same target extrapolated with the average of the before/after lateral speeds.");
...@@ -2769,8 +2774,12 @@ min_str_neib_fpn 0.35 ...@@ -2769,8 +2774,12 @@ min_str_neib_fpn 0.35
"Maximal axial (range) velocity in m/s."); "Maximal axial (range) velocity in m/s.");
gd.addNumericField("Maximal axial to lateral ratio", this.cuas_tmtch_axv_k, 5,8,"pix", gd.addNumericField("Maximal axial to lateral ratio", this.cuas_tmtch_axv_k, 5,8,"pix",
"Maximal axial (range) velocity to lateral velocity ratio (take max axial velocity)."); "Maximal axial (range) velocity to lateral velocity ratio (take max axial velocity).");
gd.addNumericField("Minimal disparity difference", this.cuas_tmtch_disp, 5,8,"pix", gd.addNumericField("Maximal disparity difference (same sequence)", this.cuas_local_diff, 5,8,"pix",
"Minimal disparity difference to estimate lateral velocity (smaller - consider matching)."); "Maximal disparity difference to match 3d for local target match (loosened for local).");
gd.addNumericField("Maximal disparity difference (other sequence)", this.cuas_tmtch_diff, 5,8,"pix",
"Maximal disparity difference to match 3d (regardless of absolute disparity.");
gd.addNumericField("Minimal disparity for 3D matching", this.cuas_tmtch_disp, 5,8,"pix",
"Minimal disparity (any should be above) to estimate lateral velocity (smaller - match2d only).");
gd.addCheckbox ("Prefer shortest gap", this.cuas_tmtch_short, gd.addCheckbox ("Prefer shortest gap", this.cuas_tmtch_short,
"When multiple conflicting matches, prefer shortest gap (false - longest combo pair length)."); "When multiple conflicting matches, prefer shortest gap (false - longest combo pair length).");
gd.addMessage("=== Radar image generation (check Radar mode below) ==="); gd.addMessage("=== Radar image generation (check Radar mode below) ===");
...@@ -3987,10 +3996,13 @@ min_str_neib_fpn 0.35 ...@@ -3987,10 +3996,13 @@ min_str_neib_fpn 0.35
this.cuas_tmtch_ends= (int) gd.getNextNumber(); this.cuas_tmtch_ends= (int) gd.getNextNumber();
this.cuas_tmtch_gaps= (int) gd.getNextNumber(); this.cuas_tmtch_gaps= (int) gd.getNextNumber();
this.cuas_tmtch_pix= gd.getNextNumber(); this.cuas_tmtch_pix= gd.getNextNumber();
this.cuas_local_apix= gd.getNextNumber();
this.cuas_tmtch_apix= gd.getNextNumber(); this.cuas_tmtch_apix= gd.getNextNumber();
this.cuas_tmtch_rpix= gd.getNextNumber(); this.cuas_tmtch_rpix= gd.getNextNumber();
this.cuas_tmtch_axv= gd.getNextNumber(); this.cuas_tmtch_axv= gd.getNextNumber();
this.cuas_tmtch_axv_k= gd.getNextNumber(); this.cuas_tmtch_axv_k= gd.getNextNumber();
this.cuas_local_diff= gd.getNextNumber();
this.cuas_tmtch_diff= gd.getNextNumber();
this.cuas_tmtch_disp= gd.getNextNumber(); this.cuas_tmtch_disp= gd.getNextNumber();
this.cuas_tmtch_short = gd.getNextBoolean(); this.cuas_tmtch_short = gd.getNextBoolean();
...@@ -5095,10 +5107,13 @@ min_str_neib_fpn 0.35 ...@@ -5095,10 +5107,13 @@ min_str_neib_fpn 0.35
properties.setProperty(prefix+"cuas_tmtch_ends", this.cuas_tmtch_ends+""); // int properties.setProperty(prefix+"cuas_tmtch_ends", this.cuas_tmtch_ends+""); // int
properties.setProperty(prefix+"cuas_tmtch_gaps", this.cuas_tmtch_gaps+""); // int properties.setProperty(prefix+"cuas_tmtch_gaps", this.cuas_tmtch_gaps+""); // int
properties.setProperty(prefix+"cuas_tmtch_pix", this.cuas_tmtch_pix+""); // double properties.setProperty(prefix+"cuas_tmtch_pix", this.cuas_tmtch_pix+""); // double
properties.setProperty(prefix+"cuas_local_apix", this.cuas_local_apix+""); // double
properties.setProperty(prefix+"cuas_tmtch_apix", this.cuas_tmtch_apix+""); // double properties.setProperty(prefix+"cuas_tmtch_apix", this.cuas_tmtch_apix+""); // double
properties.setProperty(prefix+"cuas_tmtch_rpix", this.cuas_tmtch_rpix+""); // double properties.setProperty(prefix+"cuas_tmtch_rpix", this.cuas_tmtch_rpix+""); // double
properties.setProperty(prefix+"cuas_tmtch_axv", this.cuas_tmtch_axv+""); // double properties.setProperty(prefix+"cuas_tmtch_axv", this.cuas_tmtch_axv+""); // double
properties.setProperty(prefix+"cuas_tmtch_axv_k", this.cuas_tmtch_axv_k+""); // double properties.setProperty(prefix+"cuas_tmtch_axv_k", this.cuas_tmtch_axv_k+""); // double
properties.setProperty(prefix+"cuas_local_diff", this.cuas_local_diff+""); // double
properties.setProperty(prefix+"cuas_tmtch_diff", this.cuas_tmtch_diff+""); // double
properties.setProperty(prefix+"cuas_tmtch_disp", this.cuas_tmtch_disp+""); // double 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_tmtch_short", this.cuas_tmtch_short+""); // boolean
...@@ -6179,10 +6194,13 @@ min_str_neib_fpn 0.35 ...@@ -6179,10 +6194,13 @@ min_str_neib_fpn 0.35
if (properties.getProperty(prefix+"cuas_tmtch_ends")!=null) this.cuas_tmtch_ends=Integer.parseInt(properties.getProperty(prefix+"cuas_tmtch_ends")); if (properties.getProperty(prefix+"cuas_tmtch_ends")!=null) this.cuas_tmtch_ends=Integer.parseInt(properties.getProperty(prefix+"cuas_tmtch_ends"));
if (properties.getProperty(prefix+"cuas_tmtch_gaps")!=null) this.cuas_tmtch_gaps=Integer.parseInt(properties.getProperty(prefix+"cuas_tmtch_gaps")); if (properties.getProperty(prefix+"cuas_tmtch_gaps")!=null) this.cuas_tmtch_gaps=Integer.parseInt(properties.getProperty(prefix+"cuas_tmtch_gaps"));
if (properties.getProperty(prefix+"cuas_tmtch_pix")!=null) this.cuas_tmtch_pix=Double.parseDouble(properties.getProperty(prefix+"cuas_tmtch_pix")); if (properties.getProperty(prefix+"cuas_tmtch_pix")!=null) this.cuas_tmtch_pix=Double.parseDouble(properties.getProperty(prefix+"cuas_tmtch_pix"));
if (properties.getProperty(prefix+"cuas_local_apix")!=null) this.cuas_local_apix=Double.parseDouble(properties.getProperty(prefix+"cuas_local_apix"));
if (properties.getProperty(prefix+"cuas_tmtch_apix")!=null) this.cuas_tmtch_apix=Double.parseDouble(properties.getProperty(prefix+"cuas_tmtch_apix")); if (properties.getProperty(prefix+"cuas_tmtch_apix")!=null) this.cuas_tmtch_apix=Double.parseDouble(properties.getProperty(prefix+"cuas_tmtch_apix"));
if (properties.getProperty(prefix+"cuas_tmtch_rpix")!=null) this.cuas_tmtch_rpix=Double.parseDouble(properties.getProperty(prefix+"cuas_tmtch_rpix")); if (properties.getProperty(prefix+"cuas_tmtch_rpix")!=null) this.cuas_tmtch_rpix=Double.parseDouble(properties.getProperty(prefix+"cuas_tmtch_rpix"));
if (properties.getProperty(prefix+"cuas_tmtch_axv")!=null) this.cuas_tmtch_axv=Double.parseDouble(properties.getProperty(prefix+"cuas_tmtch_axv")); if (properties.getProperty(prefix+"cuas_tmtch_axv")!=null) this.cuas_tmtch_axv=Double.parseDouble(properties.getProperty(prefix+"cuas_tmtch_axv"));
if (properties.getProperty(prefix+"cuas_tmtch_axv_k")!=null) this.cuas_tmtch_axv_k=Double.parseDouble(properties.getProperty(prefix+"cuas_tmtch_axv_k")); if (properties.getProperty(prefix+"cuas_tmtch_axv_k")!=null) this.cuas_tmtch_axv_k=Double.parseDouble(properties.getProperty(prefix+"cuas_tmtch_axv_k"));
if (properties.getProperty(prefix+"cuas_local_diff")!=null) this.cuas_local_diff=Double.parseDouble(properties.getProperty(prefix+"cuas_local_diff"));
if (properties.getProperty(prefix+"cuas_tmtch_diff")!=null) this.cuas_tmtch_diff=Double.parseDouble(properties.getProperty(prefix+"cuas_tmtch_diff"));
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_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_tmtch_short")!=null) this.cuas_tmtch_short=Boolean.parseBoolean(properties.getProperty(prefix+"cuas_tmtch_short"));
...@@ -7251,10 +7269,13 @@ min_str_neib_fpn 0.35 ...@@ -7251,10 +7269,13 @@ min_str_neib_fpn 0.35
imp.cuas_tmtch_ends = this.cuas_tmtch_ends; imp.cuas_tmtch_ends = this.cuas_tmtch_ends;
imp.cuas_tmtch_gaps = this.cuas_tmtch_gaps; imp.cuas_tmtch_gaps = this.cuas_tmtch_gaps;
imp.cuas_tmtch_pix = this.cuas_tmtch_pix; imp.cuas_tmtch_pix = this.cuas_tmtch_pix;
imp.cuas_local_apix = this.cuas_local_apix;
imp.cuas_tmtch_apix = this.cuas_tmtch_apix; imp.cuas_tmtch_apix = this.cuas_tmtch_apix;
imp.cuas_tmtch_rpix = this.cuas_tmtch_rpix; imp.cuas_tmtch_rpix = this.cuas_tmtch_rpix;
imp.cuas_tmtch_axv = this.cuas_tmtch_axv; imp.cuas_tmtch_axv = this.cuas_tmtch_axv;
imp.cuas_tmtch_axv_k = this.cuas_tmtch_axv_k; imp.cuas_tmtch_axv_k = this.cuas_tmtch_axv_k;
imp.cuas_tmtch_diff = this.cuas_tmtch_diff;
imp.cuas_local_diff = this.cuas_local_diff;
imp.cuas_tmtch_disp = this.cuas_tmtch_disp; imp.cuas_tmtch_disp = this.cuas_tmtch_disp;
imp.cuas_tmtch_short = this.cuas_tmtch_short; imp.cuas_tmtch_short = this.cuas_tmtch_short;
......
...@@ -8951,14 +8951,27 @@ if (debugLevel > -100) return true; // temporarily ! ...@@ -8951,14 +8951,27 @@ if (debugLevel > -100) return true; // temporarily !
} }
break; // case 0 : break; // case 0 :
case 1: case 1:
CuasMultiSeries cuasMultiSeries = new CuasMultiSeries( {CuasMultiSeries cuasMultiSeries = new CuasMultiSeries(
clt_parameters, // CLTParameters clt_parameters, clt_parameters, // CLTParameters clt_parameters,
uasLogReader, //UasLogReader uasLogReader, false, // boolean video_mode,
uasLogReader, // UasLogReader uasLogReader,
quadCLT_main, // QuadCLT quadCLT_main, quadCLT_main, // QuadCLT quadCLT_main,
quadCLT_main.correctionsParameters.linkedCenters, quadCLT_main.correctionsParameters.linkedCenters,
quadCLT_main.correctionsParameters.x3dModelVersion); quadCLT_main.correctionsParameters.x3dModelVersion);
// CuasMultiSeries (String path) // CuasMultiSeries (String path)
cuasMultiSeries.processGlobals(); cuasMultiSeries.processGlobals();}
break;
case 2:
{CuasMultiSeries cuasMultiSeries = new CuasMultiSeries(
clt_parameters, // CLTParameters clt_parameters,
true, // boolean video_mode,
uasLogReader, // UasLogReader uasLogReader,
quadCLT_main, // QuadCLT quadCLT_main,
quadCLT_main.correctionsParameters.linkedCenters,
quadCLT_main.correctionsParameters.x3dModelVersion);
// CuasMultiSeries (String path)
cuasMultiSeries.combineVideos();
}
break; break;
} // switch (cuas_proc_mode) { } // switch (cuas_proc_mode) {
......
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