Commit 2c6707fb authored by Andrey Filippov's avatar Andrey Filippov

Matching and processing series

parent d0c338fe
......@@ -876,6 +876,7 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
jpanelLWIRWorld = new JPanel();
jpanelLWIRWorld.setLayout(new GridLayout(1, 0, 5, 5)); // rows, columns, vgap, hgap
addJButton("Aux Build Series", jpanelLWIRWorld, color_stop);
addJButton("CUAS Combine", jpanelLWIRWorld, color_stop);
addJButton("Build World", jpanelLWIRWorld, color_process);
addJButton("Test IMX5", jpanelLWIRWorld, color_process);
addJButton("Show mice", jpanelLWIRWorld, color_process);
......@@ -1283,6 +1284,7 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
panelLWIRWorld = new Panel();
panelLWIRWorld.setLayout(new GridLayout(1, 0, 5, 5)); // rows, columns, vgap, hgap
addButton("Aux Build Series", panelLWIRWorld, color_stop);
addButton("CUAS Combine", panelLWIRWorld, color_stop);
addButton("Build World", panelLWIRWorld, color_process);
addButton("Test IMX5", panelLWIRWorld, color_process);
addButton("Show mice", panelLWIRWorld, color_process);
......@@ -5688,9 +5690,21 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
DEBUG_LEVEL = MASTER_DEBUG_LEVEL;
EYESIS_CORRECTIONS.setDebug(DEBUG_LEVEL);
CLT_PARAMETERS.batch_run = true;
buildSeries(true);
buildSeries(
true,
0); // int cuas_proc_mode); // 0 - old, 1 combine scene series) {);
return;
/* ======================================================================== */
} else if (label.equals("CUAS Combine")) {
DEBUG_LEVEL = MASTER_DEBUG_LEVEL;
EYESIS_CORRECTIONS.setDebug(DEBUG_LEVEL);
CLT_PARAMETERS.batch_run = true;
buildSeries(
true,
1); // int cuas_proc_mode); // 0 - old, 1 combine scene series) {);
return;
//"CUAS Combine"
/* ======================================================================== */
} else if (label.equals("Aux Inter Test")) {
DEBUG_LEVEL = MASTER_DEBUG_LEVEL;
EYESIS_CORRECTIONS.setDebug(DEBUG_LEVEL);
......@@ -7832,7 +7846,9 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
}
public boolean buildSeries(boolean use_aux) {
public boolean buildSeries(
boolean use_aux,
int cuas_proc_mode) { // 0 - old, 1 combine scene series) {
long startTime = System.nanoTime();
// load needed sensor and kernels files
if (!prepareRigImages())
......@@ -7893,23 +7909,21 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
try {
TwoQuadCLT.buildSeriesTQ(
0, // int cuas_proc_mode, // 0 - old, 1 combine scene series
quadCLT, // QUAD_CLT, // QuadCLT quadCLT_main,
-1, // int ref_index,
0, // int ref_step,
// QUAD_CLT_AUX, // QuadCLT quadCLT_aux,
CLT_PARAMETERS, // EyesisCorrectionParameters.DCTParameters dct_parameters,
DEBAYER_PARAMETERS, // EyesisCorrectionParameters.DebayerParameters debayerParameters,
colorProcParameters, // COLOR_PROC_PARAMETERS, //EyesisCorrectionParameters.ColorProcParameters
// colorProcParameters,
CHANNEL_GAINS_PARAMETERS, // CorrectionColorProc.ColorGainsParameters channelGainParameters,
RGB_PARAMETERS, // EyesisCorrectionParameters.RGBParameters rgbParameters,
cuas_proc_mode, // int cuas_proc_mode, // 0 - old, 1 combine scene series
quadCLT, // QUAD_CLT, // QuadCLT quadCLT_main,
-1, // int ref_index,
0, // int ref_step,
CLT_PARAMETERS, // EyesisCorrectionParameters.DCTParameters dct_parameters,
DEBAYER_PARAMETERS, // EyesisCorrectionParameters.DebayerParameters debayerParameters,
colorProcParameters, // COLOR_PROC_PARAMETERS, //EyesisCorrectionParameters.ColorProcParameters
CHANNEL_GAINS_PARAMETERS, // CorrectionColorProc.ColorGainsParameters channelGainParameters,
RGB_PARAMETERS, // EyesisCorrectionParameters.RGBParameters rgbParameters,
EQUIRECTANGULAR_PARAMETERS, // EyesisCorrectionParameters.EquirectangularParameters
// equirectangularParameters,
PROPERTIES, // Properties properties,
true, // false, // boolean reset_from_extrinsics,
THREADS_MAX, // final int threadsMax, // maximal number of threads to launch
UPDATE_STATUS, // final boolean updateStatus,
PROPERTIES, // Properties properties,
true, // false, // boolean reset_from_extrinsics,
THREADS_MAX, // final int threadsMax, // maximal number of threads to launch
UPDATE_STATUS, // final boolean updateStatus,
DEBUG_LEVEL);
} catch (Exception e) {
// TODO Auto-generated catch block
......
......@@ -131,9 +131,16 @@ public class CuasMotion {
public int getSeqLength() {
return clt_parameters.imp.cuas_corr_offset + clt_parameters.imp.cuas_corr_pairs;
}
public int getCorrInc() { // == frame_step;
public static int getCorrInc(
CLTParameters clt_parameters) {
return clt_parameters.imp.cuas_half_step ? (clt_parameters.imp.cuas_corr_offset/2) : clt_parameters.imp.cuas_corr_offset;
}
public int getCorrInc() { // == frame_step;
return getCorrInc(clt_parameters);
// return clt_parameters.imp.cuas_half_step ? (clt_parameters.imp.cuas_corr_offset/2) : clt_parameters.imp.cuas_corr_offset;
}
public int getNumCorrSamples() {
return slice_titles.length;
}
......@@ -148,6 +155,26 @@ public class CuasMotion {
return 0.5* getCorrInc()/corr_offset;
}
/**
* Multiply RESULT_VX,RESULT_VX to get pixel offset per scene (at ~60Hz)
* @param clt_parameters
* @return coefficient for VX, VY
*/
public static double getFrameVelocityScale(CLTParameters clt_parameters) {
return 1.0/clt_parameters.imp.cuas_corr_offset;
}
/**
* Multiply RESULT_VX,RESULT_VX to get pixel offset per key frame (now ~6Hz)
* @param clt_parameters
* @return coefficient for VX, VY
*/
public static double getKeyFrameVelocityScale(CLTParameters clt_parameters) {
return getCorrInc(clt_parameters)/clt_parameters.imp.cuas_corr_offset;
}
public String [] getSceneTitles() {
return scene_titles;
}
......@@ -1914,7 +1941,7 @@ public class CuasMotion {
return vf;
}
public static double [][][] getTargetsFromHyperAugment(
public static double [][][] getTargetsFromHyperAugment_old(
String path){ // add empty fields to the end of each target if shorter than CuasMotionLMA.RSLT_LEN
int [] wh = new int [2];
String [][] pvf_top_titles = new String[1][];
......@@ -1952,6 +1979,56 @@ public class CuasMotion {
return target_sequence;
}
public static double [][][] getTargetsFromHyperAugment(
String path) {
return getTargetsFromHyperAugment(
null, // String [][] pvf_top_titles,
null, // String [][] pvf_titles,
path); //String path)
}
public static double [][][] getTargetsFromHyperAugment(
String [][] pvf_top_titles,
String [][] pvf_titles,
String path){ // add empty fields to the end of each target if shorter than CuasMotionLMA.RSLT_LEN
int [] wh = new int [2];
if (pvf_top_titles == null) pvf_top_titles = new String[1][];
if (pvf_titles == null) pvf_titles = new String[1][];
double [][][] targets_file = ShowDoubleFloatArrays.readDoubleHyperstack(
path, // String path,
wh, // int [] wh, // should be null or int[2]
pvf_top_titles, // String [][] ptop_titles, // should be null or String [1][]
pvf_titles); // String [][] pslice_titles){// should be null or String [1][]
if (targets_file == null) {
return null;
}
int num_fields = targets_file.length;
// fix - discarding last slice if it is called CuasMotionLMA.EXTRA_SLICE_DISCARD_ON_LOAD ("Targets")
if (pvf_top_titles[0][pvf_top_titles[0].length-1].equals(CuasMotionLMA.EXTRA_SLICE_DISCARD_ON_LOAD)) {
System.out.println("getTargetsFromHyperAugment(): removing last slice called "+ pvf_top_titles[0][pvf_top_titles[0].length-1]);
num_fields--;
String [] ss = new String[num_fields];
System.arraycopy(pvf_top_titles[0], 0, ss, 0, num_fields);
pvf_top_titles[0] = ss;
}
int num_fields_augmented = Math.max(num_fields, CuasMotionLMA.RSLT_LEN);
int num_seq = targets_file[0].length;
int num_tiles = targets_file[0][0].length;
double [][][] target_sequence = new double [num_seq][num_tiles][];
for (int nseq=0; nseq < num_seq; nseq++) {
for (int ntile = 0; ntile < num_tiles; ntile++) if (!Double.isNaN(targets_file[0][nseq][ntile])){
double [] v = new double[num_fields_augmented]; // cut to originally calculated fields
for (int i = 0; i < num_fields; i++) {
v[i] = targets_file[i][nseq][ntile];
}
for (int i = num_fields; i < num_fields_augmented; i++) {
v[i] = Double.NaN;
}
target_sequence[nseq][ntile] = v;
}
}
return target_sequence;
}
......@@ -6101,7 +6178,7 @@ public class CuasMotion {
}
/**
* Same for singl-layer targets (one target per tile)
* Same for single-layer targets (one target per tile)
* @param targets_single [num_sequences][num_tiles][CuasMotionLMA.RSLT_LEN] source targets array
* @return variable-length (may be empty) arrays following targets
*/
......
......@@ -98,8 +98,8 @@ public class CuasMotionLMA {
public static final int RSLT_FL_DISP = 56; // flight log true disparity
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_LEN = RSLT_INFINITY + 1;
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_LEN = RSLT_TARGET_ID + 1;
public static final String [] LMA_TITLES =
{"X-OFFS","Y-OFFS", "AMPLITUDE", "RADIUS","RAD_POS", "OVERSHOOT","OFFSET","RMSE","RMSE/A","MAX2A","ITERATIONS",
......@@ -117,7 +117,8 @@ public class CuasMotionLMA {
"WHEN", "FAILURE",
"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"};
"FLOG-px","FLOG-pY","FLOG-DISP","FLOG-range","infinity",
"GTarget-ID"};
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
......
This diff is collapsed.
......@@ -27,6 +27,7 @@ public class CuasRanging {
public static final String TARGET_RANGING_LOGS_SUFFIX = "-TARGET_RANGING.log";
public static final String TARGET_RANGING_LOGS_FULL_SUFFIX = "-TARGET_RANGING_FULL.log";
public static final String TARGET_DISPARITIES_SUFFIX = "-TARGET_DISPARITIES";
public static final String TARGET_GLOBALS_SUFFIX = "-TARGET_GLOBALS";
public static final String TARGET_STATS_SUFFIX = "-TARGETS"; // *.csv
......
......@@ -72,6 +72,7 @@ import com.elphel.imagej.correction.Eyesis_Correction;
import com.elphel.imagej.cuas.CorrectionFPN;
import com.elphel.imagej.cuas.Cuas;
import com.elphel.imagej.cuas.CuasData;
import com.elphel.imagej.gpu.GPUTileProcessor;
import com.elphel.imagej.gpu.GpuQuad;
import com.elphel.imagej.gpu.TpTask;
import com.elphel.imagej.ims.Did_gps_pos;
......@@ -3125,13 +3126,30 @@ public class QuadCLTCPU {
*/
public int getTileSize() {
if (tp == null) {
return GPUTileProcessor.DTT_SIZE;
}
return tp.getTileSize();
}
public int getTilesX() {
if (tp == null) {
// if (geometryCorrection == null) {
// if QuadCLT use gpuQuad
// } else {
return geometryCorrection.getSensorWH()[0]/GPUTileProcessor.DTT_SIZE;
// }
}
return tp.getTilesX();
}
public int getTilesY() {
if (tp == null) {
// if (geometryCorrection == null) {
// if QuadCLT use gpuQuad
// } else {
return geometryCorrection.getSensorWH()[1]/GPUTileProcessor.DTT_SIZE;
// }
}
return tp.getTilesY();
}
public int getNumColors(){
......
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