Commit 4aa60524 authored by Andrey Filippov's avatar Andrey Filippov

Added average roll

parent 7edcdbe5
...@@ -35,9 +35,9 @@ public class CuasCenterLma { ...@@ -35,9 +35,9 @@ public class CuasCenterLma {
private int [] sel_par_index = null; private int [] sel_par_index = null;
private int [] sel_par_rindex = null; private int [] sel_par_rindex = null;
public double [] parameters_vector = null; private double [] parameters_vector = null;
public double [] full_parameters_vector = null; private double [] full_parameters_vector = null;
private double roll_average = 0;
private double [] last_rms = null; // {rms, rms_pure}, matching this.vector private double [] last_rms = null; // {rms, rms_pure}, matching this.vector
private double [] good_or_bad_rms = null; // just for diagnostics, to read last (failed) rms private double [] good_or_bad_rms = null; // just for diagnostics, to read last (failed) rms
private double [] initial_rms = null; // {rms, rms_pure}, first-calcualted rms private double [] initial_rms = null; // {rms, rms_pure}, first-calcualted rms
...@@ -77,6 +77,7 @@ public class CuasCenterLma { ...@@ -77,6 +77,7 @@ public class CuasCenterLma {
cuasCenterLma.getRMS()+" ("+cuasCenterLma.getInitialRMS()+")"); cuasCenterLma.getRMS()+" ("+cuasCenterLma.getInitialRMS()+")");
System.out.println("azimuth_center = "+ rslt[0][0]); System.out.println("azimuth_center = "+ rslt[0][0]);
System.out.println(" tilt_center = "+ rslt[0][1]); System.out.println(" tilt_center = "+ rslt[0][1]);
System.out.println(" average roll = "+ rslt[0][2]);
System.out.println("azimuth_radius = "+ rslt[1][0]); System.out.println("azimuth_radius = "+ rslt[1][0]);
System.out.println(" tilt_radius = "+ rslt[1][1]); System.out.println(" tilt_radius = "+ rslt[1][1]);
} }
...@@ -226,7 +227,16 @@ public class CuasCenterLma { ...@@ -226,7 +227,16 @@ public class CuasCenterLma {
last_rms); // final double [] rms_fp // null or [2] last_rms); // final double [] rms_fp // null or [2]
initial_rms = last_rms.clone(); initial_rms = last_rms.clone();
good_or_bad_rms = this.last_rms.clone(); good_or_bad_rms = this.last_rms.clone();
// calculate average roll
double cos_sum=0, sin_sum = 0;
for (int i = 0; i < scene_indices.length; i++) {
int nscene = scene_indices[i];
double roll = scenes_atr[nscene][2];
cos_sum+=Math.cos(roll);
sin_sum+=Math.sin(roll);
}
roll_average=Math.atan2(sin_sum, cos_sum);
return 0; return 0;
} }
...@@ -634,7 +644,7 @@ public class CuasCenterLma { ...@@ -634,7 +644,7 @@ public class CuasCenterLma {
return rslt; return rslt;
} }
public double [] getCenter() { public double [] getCenter() {
return new double[] {full_parameters_vector[PARAM_AZIMUTH_CENTER],full_parameters_vector[PARAM_TILT_CENTER]}; return new double[] {full_parameters_vector[PARAM_AZIMUTH_CENTER],full_parameters_vector[PARAM_TILT_CENTER],roll_average};
} }
public double [] getRadius() { public double [] getRadius() {
return new double[] {full_parameters_vector[PARAM_AZIMUTH_RADIUS], full_parameters_vector[PARAM_TILT_RADIUS]}; return new double[] {full_parameters_vector[PARAM_AZIMUTH_RADIUS], full_parameters_vector[PARAM_TILT_RADIUS]};
...@@ -646,5 +656,9 @@ public class CuasCenterLma { ...@@ -646,5 +656,9 @@ public class CuasCenterLma {
return initial_rms[0]; return initial_rms[0];
} }
public double getAverageRoll() {
return roll_average;
}
} }
...@@ -5595,8 +5595,9 @@ public class OpticalFlow { ...@@ -5595,8 +5595,9 @@ public class OpticalFlow {
} }
} }
boolean extract_center_orientation = true; boolean extract_center_orientation = true;
double [][] center_ATR = null; // {{center_A, center_T, average_R},{radius_A, radius_T}}
if (extract_center_orientation && clt_parameters.imp.lock_position) { if (extract_center_orientation && clt_parameters.imp.lock_position) {
double [][] center_ATR = CuasCenterLma.getCenterATR( center_ATR = CuasCenterLma.getCenterATR(
quadCLTs, // QuadCLT [] quadCLTs, quadCLTs, // QuadCLT [] quadCLTs,
ref_index, //int ref_index, ref_index, //int ref_index,
new int [] {earliest_scene, last_index}, //int [] range, new int [] {earliest_scene, last_index}, //int [] range,
......
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