Commit 692610be authored by Andrey Filippov's avatar Andrey Filippov

Debugging, before refactoring

parent 2c6707fb
...@@ -1912,6 +1912,7 @@ public class CuasMotion { ...@@ -1912,6 +1912,7 @@ public class CuasMotion {
return vf; return vf;
} }
@Deprecated
public static double [][][] getTargetsFromHyper(String path){ public static double [][][] getTargetsFromHyper(String path){
int [] wh = new int [2]; int [] wh = new int [2];
String [][] pvf_top_titles = new String[1][]; String [][] pvf_top_titles = new String[1][];
...@@ -2016,7 +2017,8 @@ public class CuasMotion { ...@@ -2016,7 +2017,8 @@ public class CuasMotion {
int num_tiles = targets_file[0][0].length; int num_tiles = targets_file[0][0].length;
double [][][] target_sequence = new double [num_seq][num_tiles][]; double [][][] target_sequence = new double [num_seq][num_tiles][];
for (int nseq=0; nseq < num_seq; nseq++) { for (int nseq=0; nseq < num_seq; nseq++) {
for (int ntile = 0; ntile < num_tiles; ntile++) if (!Double.isNaN(targets_file[0][nseq][ntile])){ for (int ntile = 0; ntile < num_tiles; ntile++) if (!Double.isNaN(targets_file[CuasMotionLMA.RSLT_X][nseq][ntile]) ||
!Double.isNaN(targets_file[CuasMotionLMA.RSLT_FL_PX][nseq][ntile])){
double [] v = new double[num_fields_augmented]; // cut to originally calculated fields double [] v = new double[num_fields_augmented]; // cut to originally calculated fields
for (int i = 0; i < num_fields; i++) { for (int i = 0; i < num_fields; i++) {
v[i] = targets_file[i][nseq][ntile]; v[i] = targets_file[i][nseq][ntile];
...@@ -4408,6 +4410,7 @@ public class CuasMotion { ...@@ -4408,6 +4410,7 @@ public class CuasMotion {
double target_vx, double target_vx,
double target_vy) { double target_vy) {
double ifov = clt_parameters.imp.cuas_ifov; // 0.05; // degree per pixel double ifov = clt_parameters.imp.cuas_ifov; // 0.05; // degree per pixel
int px0 = clt_parameters.imp.cuas_px0; // 283; // pixel with known azimuth int px0 = clt_parameters.imp.cuas_px0; // 283; // pixel with known azimuth
int py0 = clt_parameters.imp.cuas_py0; // 386; // pixel with known elevation int py0 = clt_parameters.imp.cuas_py0; // 386; // pixel with known elevation
double az0 = clt_parameters.imp.cuas_az0; // 201.5; // degrees for cuas_px0; double az0 = clt_parameters.imp.cuas_az0; // 201.5; // degrees for cuas_px0;
......
...@@ -87,19 +87,22 @@ public class CuasMotionLMA { ...@@ -87,19 +87,22 @@ public class CuasMotionLMA {
public static final int RSLT_DISP_DIFF= 45; public static final int RSLT_DISP_DIFF= 45;
public static final int RSLT_DISP_STR = 46; public static final int RSLT_DISP_STR = 46;
public static final int RSLT_RANGE = 47; public static final int RSLT_RANGE = 47;
public static final int RSLT_GLOBAL = 48; public static final int RSLT_GLOBAL = 48; // local target ID (1-based)
public static final int RSLT_GLENGTH = 49; public static final int RSLT_GLENGTH = 49; // length (symmetrical around this one) for which disparity and range are provided
public static final int RSLT_GDISPARITY= 50; public static final int RSLT_GDISPARITY= 50;
public static final int RSLT_GDISP_DIFF= 51; public static final int RSLT_GDISP_DIFF= 51;
public static final int RSLT_GDISP_STR = 52; public static final int RSLT_GDISP_STR = 52;
public static final int RSLT_GRANGE = 53; public static final int RSLT_GRANGE = 53; // global range - calculated for long sequences (and its fractions)
public static final int RSLT_FL_PX = 54; // flight log px public static final int RSLT_FL_PX = 54; // flight log px
public static final int RSLT_FL_PY = 55; // flight log py public static final int RSLT_FL_PY = 55; // flight log py
public static final int RSLT_FL_DISP = 56; // flight log true disparity 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_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_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_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 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_LEN = RSLT_RANGE_LIN + 1;
public static final String [] LMA_TITLES = public static final String [] LMA_TITLES =
{"X-OFFS","Y-OFFS", "AMPLITUDE", "RADIUS","RAD_POS", "OVERSHOOT","OFFSET","RMSE","RMSE/A","MAX2A","ITERATIONS", {"X-OFFS","Y-OFFS", "AMPLITUDE", "RADIUS","RAD_POS", "OVERSHOOT","OFFSET","RMSE","RMSE/A","MAX2A","ITERATIONS",
...@@ -118,7 +121,7 @@ public class CuasMotionLMA { ...@@ -118,7 +121,7 @@ public class CuasMotionLMA {
"Disparity","Disparity-Diff","Strength","Range","Global-index", "Disparity","Disparity-Diff","Strength","Range","Global-index",
"segment-length","segment-disparity","segment_disp-diff", "segment-strength", "segment-range", "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"}; "GTarget-ID","Range-derivative"};
public static final String EXTRA_SLICE_DISCARD_ON_LOAD = "Targets"; public static final String EXTRA_SLICE_DISCARD_ON_LOAD = "Targets";
public static final int FAIL_NONE = 0; public static final int FAIL_NONE = 0;
public static final int FAIL_MOTION = 1; // motion strength/fraction too low public static final int FAIL_MOTION = 1; // motion strength/fraction too low
......
...@@ -1796,15 +1796,23 @@ public class GeometryCorrection { ...@@ -1796,15 +1796,23 @@ public class GeometryCorrection {
public double getDisparityFromZ(double z){ // USED in lwir public double getDisparityFromZ(double z){ // USED in lwir
return (1000.0 * SCENE_UNITS_SCALE * this.focalLength * this.disparityRadius / this.pixelSize) / z; return (1000.0 * SCENE_UNITS_SCALE * this.focalLength * this.disparityRadius / this.pixelSize) / z;
} }
/**
public double getFOVPix(){ // get ratio of 1 pixel X/Y to Z (distance to object) // USED in lwir * Get Intrinsic FOV - angular size of 1 pixel
* @return IFOV
*/
public double getIFOV(){ // get Intrinsic FOV - angular size of 1 pixel. Ratio of 1 pixel X/Y to Z (distance to object) // USED in lwir
return 0.001 * this.pixelSize / this.focalLength; return 0.001 * this.pixelSize / this.focalLength;
} }
public double getIFOVDegrees() {
return getIFOV() * 180 /Math.PI;
}
public double getFOVWidth(){ // get FOV ratio: width to distance // USED in lwir public double getFOVWidth(){ // get FOV ratio: width to distance // USED in lwir
return this.pixelCorrectionWidth * 0.001 * this.pixelSize / this.focalLength; return this.pixelCorrectionWidth * 0.001 * this.pixelSize / this.focalLength;
} }
public double getFOVHeight(){ // get FOV ratio: width to distance // USED in lwir public double getFOVHeight(){ // get FOV ratio: width to distance // USED in lwir
return this.pixelCorrectionHeight * 0.001 * this.pixelSize / this.focalLength; return this.pixelCorrectionHeight * 0.001 * this.pixelSize / this.focalLength;
} }
......
...@@ -898,7 +898,7 @@ min_str_neib_fpn 0.35 ...@@ -898,7 +898,7 @@ min_str_neib_fpn 0.35
public boolean cuas_reset_disparity = true; // reset target disparities from infinity public boolean cuas_reset_disparity = true; // reset target disparities from infinity
public double cuas_initial_disparity = 1.0; // Start correlation with this disparity (in addition to infinity) after reset public double cuas_initial_disparity = 1.0; // Start correlation with this disparity (in addition to infinity) after reset
public double cuas_infinity = 0.65; // disparity at infinity for targets public double cuas_infinity = 0.6466;// disparity at infinity for targets
public boolean cuas_rng_img = false; // Generate/save per-sensor target images public boolean cuas_rng_img = false; // Generate/save per-sensor target images
public boolean cuas_rng_glob= true; // Generate/save integrated target disparities (one per target) TODO: add first/second half public boolean cuas_rng_glob= true; // Generate/save integrated target disparities (one per target) TODO: add first/second half
......
...@@ -17117,7 +17117,7 @@ public class QuadCLTCPU { ...@@ -17117,7 +17117,7 @@ public class QuadCLTCPU {
boolean noalpha, // only with fillBlack, otherwise ignored boolean noalpha, // only with fillBlack, otherwise ignored
int debugLevel) int debugLevel)
{ {
double backdropPixels = 2.0/geometryCorrection.getFOVPix(); double backdropPixels = 2.0/geometryCorrection.getIFOV();
if (debugLevel > -1) { if (debugLevel > -1) {
System.out.println("backdropPixels = "+backdropPixels); System.out.println("backdropPixels = "+backdropPixels);
} }
......
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