Commit 8946631f authored by Andrey Filippov's avatar Andrey Filippov

Implemented legend, clean up

parent d0583386
...@@ -2762,18 +2762,21 @@ public class CuasRanging { ...@@ -2762,18 +2762,21 @@ public class CuasRanging {
sb.append("\n"); // there will be 1 extra blank column sb.append("\n"); // there will be 1 extra blank column
String [] slice_titles = cuasMotion.getSliceTitles(); // timestamps String [] slice_titles = cuasMotion.getSliceTitles(); // timestamps
UasLogReader uasLogReader = cuasMotion.getUasLogReader(); UasLogReader uasLogReader = cuasMotion.getUasLogReader();
ErsCorrection ersCorrection = center_CLT.getErsCorrection();
for (int nseq = 0; nseq < num_seq; nseq++) { for (int nseq = 0; nseq < num_seq; nseq++) {
String timestamp = slice_titles[nseq]; String timestamp = slice_titles[nseq];
sb.append(nseq+"\t"+timestamp+"\t"); sb.append(nseq+"\t"+timestamp+"\t");
// get azimuth, elevation, target disparity from the log plus infinity, log range // get azimuth, elevation, target disparity from the log plus infinity, log range
double [] uas_pXpYDRange = uasLogReader.getUasPxPyDRange(timestamp); // px, py, d- cuas_infinity (true disparity), range double [] uas_pXpYDRange = uasLogReader.getUasPxPyDRange(timestamp); // px, py, d- cuas_infinity (true disparity), range
double [][] az_el_oaz_oel= CuasMotion.getPixToAzElev( double [][] az_el_oaz_oel= CuasMotion.getPixToAzElev(
clt_parameters, // CLTParameters clt_parameters, ersCorrection, // ErsCorrection ersCorrection,
gc, // GeometryCorrection gc, uasLogReader, // UasLogReader uasLogReader,
Double.NaN, // double fps, // if NaN, will use default 60Hz. Used only for omegas
uas_pXpYDRange[0], // double target_x, uas_pXpYDRange[0], // double target_x,
uas_pXpYDRange[1], // double target_y, uas_pXpYDRange[1], // double target_y,
0, // double target_vx, 0, // double target_vx,
0); // double target_vy); 0); // double target_vy);
sb.append(uas_pXpYDRange[0]+"\t"+uas_pXpYDRange[1]+"\t"+az_el_oaz_oel[0][0]+"\t"+az_el_oaz_oel[0][1]+"\t"+(uas_pXpYDRange[2]+cuas_infinity)+"\t"+uas_pXpYDRange[3]+"\t"); sb.append(uas_pXpYDRange[0]+"\t"+uas_pXpYDRange[1]+"\t"+az_el_oaz_oel[0][0]+"\t"+az_el_oaz_oel[0][1]+"\t"+(uas_pXpYDRange[2]+cuas_infinity)+"\t"+uas_pXpYDRange[3]+"\t");
for (int ntarg = 0; ntarg < num_targets; ntarg++) { for (int ntarg = 0; ntarg < num_targets; ntarg++) {
...@@ -2794,15 +2797,16 @@ public class CuasRanging { ...@@ -2794,15 +2797,16 @@ public class CuasRanging {
double yc = tileSize * tileY + tileSize/2 + target[CuasMotionLMA.RSLT_Y]; double yc = tileSize * tileY + tileSize/2 + target[CuasMotionLMA.RSLT_Y];
double vx = target[CuasMotionLMA.RSLT_VX]; double vx = target[CuasMotionLMA.RSLT_VX];
double vy = target[CuasMotionLMA.RSLT_VY]; double vy = target[CuasMotionLMA.RSLT_VY];
// calculate and output target azimuth, elevation, disparity (full) and range // calculate and output target azimuth, elevation, disparity (full) and range
az_el_oaz_oel= CuasMotion.getPixToAzElev( az_el_oaz_oel= CuasMotion.getPixToAzElev(
clt_parameters, // CLTParameters clt_parameters, ersCorrection, // ErsCorrection ersCorrection,
gc, // GeometryCorrection gc, uasLogReader, // UasLogReader uasLogReader,
xc, // double target_x, // null Double.NaN, // double fps, // if NaN, will use default 60Hz. Used only for omegas
yc, // double target_y, xc, // double px, // null
vx, // double target_vx, yc, // double py,
vy); // double target_vy); vx, // double vx,
vy); // double vy);
sb.append(xc+"\t"+yc+"\t"+az_el_oaz_oel[0][0]+"\t"+az_el_oaz_oel[0][1]+"\t"+ sb.append(xc+"\t"+yc+"\t"+az_el_oaz_oel[0][0]+"\t"+az_el_oaz_oel[0][1]+"\t"+
target[CuasMotionLMA.RSLT_DISPARITY]+"\t"+target[CuasMotionLMA.RSLT_RANGE]+"\t"); target[CuasMotionLMA.RSLT_DISPARITY]+"\t"+target[CuasMotionLMA.RSLT_RANGE]+"\t");
if (target[CuasMotionLMA.RSLT_GLENGTH] > 0) { if (target[CuasMotionLMA.RSLT_GLENGTH] > 0) {
......
...@@ -6064,6 +6064,27 @@ public class QuadCLTCPU { ...@@ -6064,6 +6064,27 @@ public class QuadCLTCPU {
return file_path; return file_path;
} }
public static String saveImagePlusInDirectory(
ImagePlus imp,
String dir) {
String file_name = imp.getTitle();
if (!file_name.endsWith(".tiff")) {
file_name +=".tiff";
}
if (!dir.endsWith(Prefs.getFileSeparator())) {
dir += Prefs.getFileSeparator();
}
String file_path = dir + file_name; // + ".tiff";
FileSaver fs=new FileSaver(imp);
fs.saveAsTiff(file_path); // image processor null?
System.out.println("saveImagePlusInDirectory(): saved "+file_path);
return file_path;
}
/*
File list_to_concat = new File (video_dir,concat_list_name);
*/
public String saveConfInModelDirectory() public String saveConfInModelDirectory()
{ {
String x3d_path = getX3dDirectory(); String x3d_path = getX3dDirectory();
......
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