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

debugging, started refreshing ground plane

parent 0cccb665
......@@ -2632,7 +2632,7 @@ public class Correlation2d {
int imax= 0;
for (int i= 1; i < data.length;i++) {
if (Double.isNaN(data[i])) {
System.out.println("NaN in getMaxXYCmEig()");
System.out.println("NaN in getMaxXYCmEig() 1");
return null;
}
if (data[i] > data[imax]) {
......@@ -2765,7 +2765,7 @@ public class Correlation2d {
int imax= 0;
for (int i= 1; i < data.length;i++) {
if (Double.isNaN(data[i])) {
System.out.println("NaN in getMaxXYCmEig()");
System.out.println("NaN in getMaxXYCmEig() 2");
return null;
}
if (data[i] > data[imax]) {
......
......@@ -314,12 +314,19 @@ public class Interscene {
// set pointers
String cent_ts = quadCLTs[cent_index].getImageName();
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) {
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(). ***");
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].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
quadCLTs[cent_index].setFirstLastPointers(quadCLTs[earliest_scene2],quadCLTs[latest_scene2]);// set first/last to center scene
......
......@@ -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
if (!build_ref_dsi) {
// try reading full
......@@ -5144,7 +5144,8 @@ public class OpticalFlow {
false, // boolean all_properties,// null, // Properties properties, // if null - will only save extrinsics)
debugLevel);
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)) {
force_initial_orientations = true;
}
......@@ -5319,11 +5320,11 @@ public class OpticalFlow {
}
} 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);
if (center_index == -1) {
force_initial_orientations = true;
} else {
} else { // always -2
QuadCLT try_ref_scene = (QuadCLT) quadCLT_main.spawnNoModelQuadCLT( // will conditionImageSet
quadCLTs[last_index].getReferenceTimestamp(), // set_channels[last_index].set_name,
clt_parameters,
......@@ -5497,7 +5498,7 @@ public class OpticalFlow {
} else {
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--) {
if (scene_index != ref_index) {
// to include ref scene photometric calibration
......@@ -6401,7 +6402,7 @@ public class OpticalFlow {
debugLevel); // int debugLevel)
}
}
boolean test_ground = false; // true;
boolean test_ground = true; // false; // true;
if (test_ground) {
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
......
......@@ -1818,6 +1818,10 @@ public class QuadCLTCPU {
* @return index of the reference scene in the provided scenes array or negative on error
*/
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 (scenes != null) {
for (int i = 0; i < scenes.length; i++) if (scenes[i] != null){
......@@ -2613,7 +2617,7 @@ public class QuadCLTCPU {
}
public double [][] getGroundNoIms(
public double [][] getGroundNoIms( // return to_ground_xyzatr;
CLTParameters clt_parameters,
boolean use_lma,
boolean use_parallel_proj,
......@@ -2833,7 +2837,7 @@ public class QuadCLTCPU {
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,
boolean use_lma,
boolean use_parallel_proj,
......@@ -2912,7 +2916,7 @@ public class QuadCLTCPU {
double min_disparity = 0.2;
double max_disparity = 15;
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[2], // double [] ref_strength,
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