Commit 97ff248f authored by Andrey Filippov's avatar Andrey Filippov

Merge branch 'foliage-gpu' working on the airplane mode

parent e635a5a1
...@@ -231,8 +231,10 @@ public class ErsCorrection extends GeometryCorrection { ...@@ -231,8 +231,10 @@ public class ErsCorrection extends GeometryCorrection {
boolean use_ERS_roll) { boolean use_ERS_roll) {
boolean [] param_select = new boolean[DP_NUM_PARS]; boolean [] param_select = new boolean[DP_NUM_PARS];
// for (int i:DP_ZR_INDICES) param_select[i] = true; // for (int i:DP_ZR_INDICES) param_select[i] = true;
if (use_Z || use_XY) param_select[DP_DSZ] = true; // if (use_Z || use_XY) param_select[DP_DSZ] = true;
if (use_R || use_AT) param_select[DP_DSRL] = true; // if (use_R || use_AT) param_select[DP_DSRL] = true;
if (use_Z) param_select[DP_DSZ] = true; // 12/12/2025 - removed ||
if (use_R) param_select[DP_DSRL] = true; // 12/12/2025 - removed ||
if (use_XY) for (int i:DP_XY_INDICES) param_select[i] = true; if (use_XY) for (int i:DP_XY_INDICES) param_select[i] = true;
if (use_AT) for (int i:DP_AT_INDICES) param_select[i] = true; if (use_AT) for (int i:DP_AT_INDICES) param_select[i] = true;
if (use_ERS) param_select[DP_DSVAZ] = true; if (use_ERS) param_select[DP_DSVAZ] = true;
......
...@@ -1426,11 +1426,13 @@ public class Interscene { ...@@ -1426,11 +1426,13 @@ public class Interscene {
System.out.println(); System.out.println();
} }
// Now always, then - conditional // Now always, then - conditional
boolean adjust_disparity_ims = (debugLevel < 1000); boolean adjust_disparity_ims = clt_parameters.imp.air_mode_en;
boolean apply_disparity_ims = clt_parameters.imp.air_disp_corr;
if (adjust_disparity_ims) { if (adjust_disparity_ims) {
double scale_img = OpticalFlow.getImgImsScale( // correctInfinityFromIMS( double scale_img = OpticalFlow.getImgImsScale( // correctInfinityFromIMS(
quadCLTs, // QuadCLT [] quadCLTs, quadCLTs, // QuadCLT [] quadCLTs,
quadCLTs[ref_index]) ; // QuadCLT master_CLT) quadCLTs[ref_index], // QuadCLT master_CLT)
earliest_scene); // int earliest_scene)
double inf_disp = OpticalFlow.getImsDisparityCorrection( double inf_disp = OpticalFlow.getImsDisparityCorrection(
scale_img, // double scale_img, scale_img, // double scale_img,
...@@ -1439,29 +1441,34 @@ public class Interscene { ...@@ -1439,29 +1441,34 @@ public class Interscene {
if (debugLevel > -3) { if (debugLevel > -3) {
System.out.println("Disparity at infinity ="+inf_disp+" in reference scene "+quadCLTs[ref_index].getImageName()+", scale_img="+scale_img); System.out.println("Disparity at infinity ="+inf_disp+" in reference scene "+quadCLTs[ref_index].getImageName()+", scale_img="+scale_img);
} }
// Update DSI_MAIN with disparity at infinity. Store it somewhere in quadCLTs[ref_index]
quadCLTs[ref_index].offsetDSI(
-inf_disp); // double inf_disp)
quadCLTs[ref_index].setDispInfinityRef(
inf_disp); // double disp)
// correct xyz
OpticalFlow.scaleImgXYZ(
1.0/scale_img, // double scale_xyz,
quadCLTs, //, // QuadCLT [] quadCLTs,
quadCLTs[ref_index]); //QuadCLT master_CLT)
quadCLTs[ref_index].saveInterProperties( // save properties for interscene processing (extrinsics, ers, ...)
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 (debugLevel > -3) { if (apply_disparity_ims) {
System.out.println("Updating DSI-MAIN with updated disparity at infinity for reference scene "+quadCLTs[ref_index].getImageName()); // Update DSI_MAIN with disparity at infinity. Store it somewhere in quadCLTs[ref_index]
} quadCLTs[ref_index].offsetDSI(
quadCLTs[ref_index].saveDSIAll ( inf_disp); // double inf_disp)
"-DSI_MAIN", // String suffix, // "-DSI_MAIN" quadCLTs[ref_index].setDispInfinityRef( // may use incDispInfinityRef() - was 0 before
quadCLTs[ref_index].dsi); inf_disp); // double disp)
// correct xyz
OpticalFlow.scaleImgXYZ(
1.0/scale_img, // double scale_xyz,
quadCLTs, //, // QuadCLT [] quadCLTs,
quadCLTs[ref_index]); //QuadCLT master_CLT)
quadCLTs[ref_index].saveInterProperties( // save properties for interscene processing (extrinsics, ers, ...)
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 (debugLevel > -3) {
System.out.println("Updating DSI-MAIN with updated disparity at infinity for reference scene "+quadCLTs[ref_index].getImageName());
}
quadCLTs[ref_index].saveDSIAll (
"-DSI_MAIN", // String suffix, // "-DSI_MAIN"
quadCLTs[ref_index].dsi);
} else {
if (debugLevel > -3) {
System.out.println("Skipping application of disparity adjustment in reference scene "+quadCLTs[ref_index].getImageName()+", scale_img="+scale_img);
}
}
} }
quadCLTs[ref_index].set_orient(1); // first orientation quadCLTs[ref_index].set_orient(1); // first orientation
...@@ -6878,7 +6885,7 @@ public class Interscene { ...@@ -6878,7 +6885,7 @@ public class Interscene {
return; return;
} }
/** /**
* Calculates data availability in 4 corners (excluding center gap) * Calculates data availability in 4 corners (excluding center gap)
* To disable ERS calculation in LMA * To disable ERS calculation in LMA
* @param coord_motion interCorrPair() output - here only defined (non-null) * @param coord_motion interCorrPair() output - here only defined (non-null)
......
...@@ -291,7 +291,7 @@ public class QuadCLTCPU { ...@@ -291,7 +291,7 @@ public class QuadCLTCPU {
* Increment disparity at infinity for this scene when it is a reference one. * Increment disparity at infinity for this scene when it is a reference one.
* @param disp disparity at infinity value to add to the previous one. Will be used when calculating INTER-INTRA * @param disp disparity at infinity value to add to the previous one. Will be used when calculating INTER-INTRA
*/ */
public void IncDispInfinityRef( public void incDispInfinityRef(
double disp) { double disp) {
disp_infinity_ref += disp; disp_infinity_ref += disp;
} }
...@@ -6389,12 +6389,49 @@ public class QuadCLTCPU { ...@@ -6389,12 +6389,49 @@ public class QuadCLTCPU {
for (int nslice:TwoQuadCLT.DSI_DISPARITY) if (dsi[nslice] != null){ for (int nslice:TwoQuadCLT.DSI_DISPARITY) if (dsi[nslice] != null){
double [] slice = dsi[nslice]; double [] slice = dsi[nslice];
for (int i = 0; i < slice.length; i++) { for (int i = 0; i < slice.length; i++) {
slice[i] += inf_disp; slice[i] -= inf_disp;
} }
} }
return; return;
} }
public boolean offsetComboDSI(
CLTParameters clt_parameters,
double inf_disp,
boolean silent) {
double [][] combo_dsi = restoreComboDSI ( silent);
if (combo_dsi==null) {
return false;
}
offsetComboDSI(
inf_disp, // double inf_disp,
combo_dsi); // double [][] dsi)
String rslt_suffix = "-INTER-INTRA";
rslt_suffix += (clt_parameters.correlate_lma?"-LMA":"-NOLMA");
saveDoubleArrayInModelDirectory( // error
rslt_suffix, // String suffix,
OpticalFlow.COMBO_DSN_TITLES, // combo_dsn_titles_full, // null, // String [] labels, // or null
combo_dsi, // dbg_data, // double [][] data,
getTilesX(), // int width,
getTilesY()); // int height)
return true;
}
public static void offsetComboDSI(
double inf_disp,
double [][] combo_dsi) {
if (combo_dsi == null) {
throw new IllegalArgumentException ("offsetDSI(): can not apply as dsi==null");
}
for (int nslice:OpticalFlow.COMBO_DSN_DISPARITY) if (combo_dsi[nslice] != null){
double [] slice = combo_dsi[nslice];
for (int i = 0; i < slice.length; i++) {
slice[i] -= inf_disp;
}
}
return;
}
// Save GT from main and AUX calculated DS // Save GT from main and AUX calculated DS
......
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