Commit 50aab4a2 authored by Andrey Filippov's avatar Andrey Filippov

debugging, started refreshing ground plane

parent 0cccb665
...@@ -2632,7 +2632,7 @@ public class Correlation2d { ...@@ -2632,7 +2632,7 @@ public class Correlation2d {
int imax= 0; int imax= 0;
for (int i= 1; i < data.length;i++) { for (int i= 1; i < data.length;i++) {
if (Double.isNaN(data[i])) { if (Double.isNaN(data[i])) {
System.out.println("NaN in getMaxXYCmEig()"); System.out.println("NaN in getMaxXYCmEig() 1");
return null; return null;
} }
if (data[i] > data[imax]) { if (data[i] > data[imax]) {
...@@ -2765,7 +2765,7 @@ public class Correlation2d { ...@@ -2765,7 +2765,7 @@ public class Correlation2d {
int imax= 0; int imax= 0;
for (int i= 1; i < data.length;i++) { for (int i= 1; i < data.length;i++) {
if (Double.isNaN(data[i])) { if (Double.isNaN(data[i])) {
System.out.println("NaN in getMaxXYCmEig()"); System.out.println("NaN in getMaxXYCmEig() 2");
return null; return null;
} }
if (data[i] > data[imax]) { if (data[i] > data[imax]) {
......
...@@ -314,12 +314,19 @@ public class Interscene { ...@@ -314,12 +314,19 @@ public class Interscene {
// set pointers // set pointers
String cent_ts = quadCLTs[cent_index].getImageName(); String cent_ts = quadCLTs[cent_index].getImageName();
quadCLTs[latest_scene2].setRefPointer(cent_ts); // write pointer to center scene to reference scene quadCLTs[latest_scene2].setRefPointer(cent_ts); // write pointer to center scene to reference scene
quadCLTs[latest_scene2].saveInterProperties( // save properties for interscene processing (extrinsics, ers, ...) // null pointer
null, // String path, // full name with extension or w/o path to use x3d directory
debugLevel+1);
if (latest_scene2 != ref_index) { if (latest_scene2 != ref_index) {
System.out.println("*** setInitialOrientationsCenterIms(): assumed that latest_scene2("+latest_scene2+ System.out.println("*** setInitialOrientationsCenterIms(): assumed that latest_scene2("+latest_scene2+
") == ref_index ("+ref_index+"), but they are different. Decide what to do - see EstimateSceneRange.getPrescanRange(). ***"); ") == ref_index ("+ref_index+"), but they are different. Decide what to do - see EstimateSceneRange.getPrescanRange(). ***");
System.out.println("The problem is that the center index will have pointers to the first and last, but the last will not have a pointrer back."); System.out.println("The problem is that the center index will have pointers to the first and last, but the last will not have a pointrer back.");
quadCLTs[ref_index].setRefPointer(cent_ts); // write pointer to center scene to reference scene quadCLTs[ref_index].setRefPointer(cent_ts); // write pointer to center scene to reference scene
quadCLTs[ref_index].saveInterProperties( // save properties for interscene processing (extrinsics, ers, ...) // null pointer
null, // String path, // full name with extension or w/o path to use x3d directory
debugLevel+1);
} }
// Here we a // Here we a
quadCLTs[cent_index].setFirstLastPointers(quadCLTs[earliest_scene2],quadCLTs[latest_scene2]);// set first/last to center scene quadCLTs[cent_index].setFirstLastPointers(quadCLTs[earliest_scene2],quadCLTs[latest_scene2]);// set first/last to center scene
......
...@@ -4972,7 +4972,7 @@ public class OpticalFlow { ...@@ -4972,7 +4972,7 @@ public class OpticalFlow {
QuadCLT center_CLT = null; QuadCLT center_CLT = null; // used for CUAS - rotation center
// See if build_ref_dsi is needed // See if build_ref_dsi is needed
if (!build_ref_dsi) { if (!build_ref_dsi) {
// try reading full // try reading full
...@@ -5144,7 +5144,8 @@ public class OpticalFlow { ...@@ -5144,7 +5144,8 @@ public class OpticalFlow {
false, // boolean all_properties,// null, // Properties properties, // if null - will only save extrinsics) false, // boolean all_properties,// null, // Properties properties, // if null - will only save extrinsics)
debugLevel); debugLevel);
first_last_index = try_ref_scene.getFirstLastIndex(quadCLTs); first_last_index = try_ref_scene.getFirstLastIndex(quadCLTs);
if (first_last_index == null) {
if (first_last_index == null) { // [-1,-1] - OK
// if ((first_last_index == null) ||(first_last_index[0] < 0) || (first_last_index[1] < 0)) { // if ((first_last_index == null) ||(first_last_index[0] < 0) || (first_last_index[1] < 0)) {
force_initial_orientations = true; force_initial_orientations = true;
} }
...@@ -5319,11 +5320,11 @@ public class OpticalFlow { ...@@ -5319,11 +5320,11 @@ public class OpticalFlow {
} }
} else { } else {
if (center_reference) { if (center_reference) { // check if initial orientation is needed. last_index may be the actual "center" as provided by caller
int center_index =quadCLTs[last_index].getReferenceIndex(null); int center_index =quadCLTs[last_index].getReferenceIndex(null);
if (center_index == -1) { if (center_index == -1) {
force_initial_orientations = true; force_initial_orientations = true;
} else { } else { // always -2
QuadCLT try_ref_scene = (QuadCLT) quadCLT_main.spawnNoModelQuadCLT( // will conditionImageSet QuadCLT try_ref_scene = (QuadCLT) quadCLT_main.spawnNoModelQuadCLT( // will conditionImageSet
quadCLTs[last_index].getReferenceTimestamp(), // set_channels[last_index].set_name, quadCLTs[last_index].getReferenceTimestamp(), // set_channels[last_index].set_name,
clt_parameters, clt_parameters,
...@@ -5497,7 +5498,7 @@ public class OpticalFlow { ...@@ -5497,7 +5498,7 @@ public class OpticalFlow {
} else { } else {
System.out.println ("1.no update, spawning only over null"); System.out.println ("1.no update, spawning only over null");
} }
// if (ref_index) // Improve - only read from the earliest to the last
for (int scene_index = last_index; scene_index >= earliest_scene ; scene_index--) { for (int scene_index = last_index; scene_index >= earliest_scene ; scene_index--) {
if (scene_index != ref_index) { if (scene_index != ref_index) {
// to include ref scene photometric calibration // to include ref scene photometric calibration
...@@ -6401,7 +6402,7 @@ public class OpticalFlow { ...@@ -6401,7 +6402,7 @@ public class OpticalFlow {
debugLevel); // int debugLevel) debugLevel); // int debugLevel)
} }
} }
boolean test_ground = false; // true; boolean test_ground = true; // false; // true;
if (test_ground) { if (test_ground) {
final boolean use_lma = clt_parameters.gmap_use_lma ; // true; // ; final boolean use_lma = clt_parameters.gmap_use_lma ; // true; // ;
final double discard_low = clt_parameters.gmap_discard_low ; //0.01; // fraction of all pixels final double discard_low = clt_parameters.gmap_discard_low ; //0.01; // fraction of all pixels
......
...@@ -1818,6 +1818,10 @@ public class QuadCLTCPU { ...@@ -1818,6 +1818,10 @@ public class QuadCLTCPU {
* @return index of the reference scene in the provided scenes array or negative on error * @return index of the reference scene in the provided scenes array or negative on error
*/ */
public int getReferenceIndex(QuadCLTCPU [] scenes) { public int getReferenceIndex(QuadCLTCPU [] scenes) {
// saving existing data by providing a self-reference (is it needed)
// if ((timestamp_reference == null) && (timestamp_first != null) && (timestamp_last != null)) {
// timestamp_reference = getImageName();
// }
if (timestamp_reference != null) { if (timestamp_reference != null) {
if (scenes != null) { if (scenes != null) {
for (int i = 0; i < scenes.length; i++) if (scenes[i] != null){ for (int i = 0; i < scenes.length; i++) if (scenes[i] != null){
...@@ -2613,7 +2617,7 @@ public class QuadCLTCPU { ...@@ -2613,7 +2617,7 @@ public class QuadCLTCPU {
} }
public double [][] getGroundNoIms( public double [][] getGroundNoIms( // return to_ground_xyzatr;
CLTParameters clt_parameters, CLTParameters clt_parameters,
boolean use_lma, boolean use_lma,
boolean use_parallel_proj, boolean use_parallel_proj,
...@@ -2624,7 +2628,7 @@ public class QuadCLTCPU { ...@@ -2624,7 +2628,7 @@ public class QuadCLTCPU {
double discard_rdisp, // discard above/below this fraction of average height double discard_rdisp, // discard above/below this fraction of average height
double pix_size, // in meters double pix_size, // in meters
int max_image_width,// increase pixel size as a power of 2 until image fits int max_image_width,// increase pixel size as a power of 2 until image fits
double [] x0y0, // initialize to double[2] to return width, height double [] x0y0, // initialize to double[2] to return width, height
int [] whs, // initialize to int[3] to return {width, height, scale reduction} int [] whs, // initialize to int[3] to return {width, height, scale reduction}
int debug_level int debug_level
) { ) {
...@@ -2833,7 +2837,7 @@ public class QuadCLTCPU { ...@@ -2833,7 +2837,7 @@ public class QuadCLTCPU {
return to_ground_xyzatr; // from the camera coordinates to in-plane coordiantes return to_ground_xyzatr; // from the camera coordinates to in-plane coordiantes
} }
public double [][] getGroundIms( public double [][] getGroundIms( // return to_ground_xyzatr;
CLTParameters clt_parameters, CLTParameters clt_parameters,
boolean use_lma, boolean use_lma,
boolean use_parallel_proj, boolean use_parallel_proj,
...@@ -2912,7 +2916,7 @@ public class QuadCLTCPU { ...@@ -2912,7 +2916,7 @@ public class QuadCLTCPU {
double min_disparity = 0.2; double min_disparity = 0.2;
double max_disparity = 15; double max_disparity = 15;
double [][] xy_range = new double[3][]; double [][] xy_range = new double[3][];
double agl = getAGL( double agl = getAGL( // not used for the parallel projection
dls[use_lma?1:0].clone(), // double [] ref_disparity, dls[use_lma?1:0].clone(), // double [] ref_disparity,
dls[2], // double [] ref_strength, dls[2], // double [] ref_strength,
scene_abs_atr_enu, // double [] reference_atr, scene_abs_atr_enu, // double [] reference_atr,
......
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