Commit 48429931 authored by Andrey Filippov's avatar Andrey Filippov

before implementing interscene ERS correction

parent ba6fb0e3
......@@ -5010,6 +5010,9 @@ private Panel panel1,
} else if (label.equals("LIST extrinsics")) {
DEBUG_LEVEL=MASTER_DEBUG_LEVEL;
EYESIS_CORRECTIONS.setDebug(DEBUG_LEVEL);
if (EYESIS_CORRECTIONS_AUX == null) {
EYESIS_CORRECTIONS_AUX = new EyesisCorrections(SYNC_COMMAND.stopRequested,CORRECTION_PARAMETERS.getAux());
}
listExtrinsics();
return;
/* ======================================================================== */
......@@ -6531,7 +6534,10 @@ private Panel panel1,
if (dir!=null) {
System.out.println("top directory = "+dir);
}
return MLStats.listExtrinsics(dir); // , mask);
return MLStats.listExtrinsics(
dir, // ); // , mask);
EYESIS_CORRECTIONS,
EYESIS_CORRECTIONS_AUX);
}
public boolean mlRecalc() {
......
......@@ -1461,7 +1461,7 @@ public class Corr2dLMA {
}
public double [][] lmaDisparityStrength( // restored from git
public double [][] lmaDisparityStrength1( // restored from git
double lma_max_rel_rms, // maximal relative (to average max/min amplitude LMA RMS) // May be up to 0.3)
double lma_min_strength, // minimal composite strength (sqrt(average amp squared over absolute RMS)
double lma_min_ac, // minimal of A and C coefficients maximum (measures sharpest point/line)
......@@ -1510,7 +1510,7 @@ public class Corr2dLMA {
public double [][] lmaDisparityStrength0(
public double [][] lmaDisparityStrength(
double lma_max_rel_rms, // maximal relative (to average max/min amplitude LMA RMS) // May be up to 0.3)
double lma_min_strength, // minimal composite strength (sqrt(average amp squared over absolute RMS)
double lma_min_max_ac, // minimal of A and C coefficients maximum (measures sharpest point/line)
......@@ -1554,7 +1554,7 @@ public class Corr2dLMA {
if ((strength < lma_min_strength) || Double.isNaN(disparity)) {
continue;
}
// strength = Math.sqrt(strength * Math.sqrt(abc[tile][0] * abc[tile][2])); // / area ); // new strength
strength = Math.sqrt(strength * Math.sqrt(abc[tile][0] * abc[tile][2])); // / area ); // new strength
ds[tile][0] = disparity;
ds[tile][1] = (strength * lma_str_scale) + lma_str_offset;
}
......
......@@ -386,14 +386,60 @@ public class TileNeibs{
}
public int [] distanceFromEdge(
boolean [] tiles) {
int [] dfe = new int [tiles.length];
for (int i = 0; i < tiles.length; i++) dfe[i] = tiles[i] ? -1 : 0;
ArrayList<Integer> front = new ArrayList<Integer>();
int dist = 0;
for (boolean has_empty = true; has_empty;) {
has_empty = false;
for (int start_indx = 0; start_indx < tiles.length; start_indx++) if (dfe[start_indx] < 0){
has_empty = true;
// see if it has wave front around
boolean has_front_near = false;
for (int d = 0; (d < dirs) && !has_front_near; d++){
int ipx1 = getNeibIndex(start_indx, d);
if ((ipx1 >= 0) && (dfe[ipx1] == dist)) {
has_front_near = true;
}
}
if (has_front_near) {
dfe[start_indx] = dist+1;
front.add(start_indx);
// build wave front (may be several)
while (!front.isEmpty()) {
int ipx = front.remove(0);// get oldest element
for (int d = 0; (d < dirs) && !has_front_near; d++){
int ipx1 = getNeibIndex(ipx, d);
if ((ipx1 >= 0) && (dfe[ipx1] < 0)) { // fresh cell
// does it has front neighbor?
for (int d1 = 0; (d1 < dirs) && !has_front_near; d1++){
int ipx2 = getNeibIndex(ipx1, d1);
if ((ipx2 >= 0) && (dfe[ipx2] == dist)) { // old front cell
dfe[ipx1] = dist+1;
front.add(ipx1);
break;
}
}
}
}
}
}
}
dist++;
}
return dfe;
}
/**
* Enumerate clusters on rectangular area
* @param tiles selected tiles, size should be sizeX * sizeY
* @param ordered if true, order tiles from largest to smallest5
* @return integer array, where 0 is unused, 1+ cluster it belongs to
*/
public int [] enumerateClusters(
boolean [] tiles,
boolean ordered)
......
......@@ -8325,11 +8325,14 @@ if (debugLevel > -100) return true; // temporarily !
"pre-adjust-extrinsic-scan-"+s); //String title)
}
}
double inf_min = -1.0;
double inf_max = 1.0;
if (num_adjust_main >= (adjust_main/2)) {
inf_min = -0.2;
inf_max = 0.05;
double inf_min = clt_parameters.ly_inf_min_broad; // -0.5;
double inf_max = clt_parameters.ly_inf_max_broad; // 0.5;
if (clt_parameters.ly_inf_force_fine || (num_adjust_main >= (adjust_main/2))) {
inf_min = clt_parameters.ly_inf_min_narrow; // -0.2;
inf_max = clt_parameters.ly_inf_max_narrow; // 0.05;
System.out.println("Late adjustment, using narrow band infinity detection, inf_min="+inf_min+", inf_max="+inf_max);
} else {
System.out.println("Early adjustment, using wide band infinity detection, inf_min="+inf_min+", inf_max="+inf_max);
}
boolean ok = quadCLT_main.extrinsicsCLT(
clt_parameters, // EyesisCorrectionParameters.CLTParameters clt_parameters,
......@@ -8407,7 +8410,7 @@ if (debugLevel > -100) return true; // temporarily !
quadCLT_main.tp.clt_3d_passes.get( quadCLT_main.tp.clt_3d_passes.size() -1),
false); // boolean force_final);
if (debugLevel > -5){
if (debugLevel > -1) { //-5){
int scan_index = quadCLT_main.tp.clt_3d_passes.size() -1;
quadCLT_main.tp.showScan(
quadCLT_main.tp.clt_3d_passes.get(scan_index), // CLTPass3d scan,
......@@ -8508,6 +8511,18 @@ if (debugLevel > -100) return true; // temporarily !
}
if (num_restored < 2) {
System.out.println("No DSI from the main camera is available. Please re-run with 'clt_batch_explore' enabled to generate it");
if (quadCLT_main.correctionsParameters.clt_batch_save_extrinsics) {
saveProperties(
null, // String path, // full name with extension or w/o path to use x3d directory
null, // Properties properties, // if null - will only save extrinsics)
debugLevel);
}
if (quadCLT_main.correctionsParameters.clt_batch_save_all) {
saveProperties(
null, // String path, // full name with extension or w/o path to use x3d directory
properties, // Properties properties, // if null - will only save extrinsics)
debugLevel);
}
continue; // skipping to the next file
}
}
......@@ -8681,6 +8696,8 @@ if (debugLevel > -100) return true; // temporarily !
updateStatus, // final boolean updateStatus,
debugLevel); // final int debugLevel)
}
if (quadCLT_main.correctionsParameters.clt_batch_save_extrinsics) {
saveProperties(
......
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