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 {
boolean use_ERS_roll) {
boolean [] param_select = new boolean[DP_NUM_PARS];
// for (int i:DP_ZR_INDICES) param_select[i] = true;
if (use_Z || use_XY) param_select[DP_DSZ] = true;
if (use_R || use_AT) param_select[DP_DSRL] = true;
// if (use_Z || use_XY) param_select[DP_DSZ] = 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_AT) for (int i:DP_AT_INDICES) param_select[i] = true;
if (use_ERS) param_select[DP_DSVAZ] = true;
......
......@@ -1426,11 +1426,13 @@ public class Interscene {
System.out.println();
}
// 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) {
double scale_img = OpticalFlow.getImgImsScale( // correctInfinityFromIMS(
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(
scale_img, // double scale_img,
......@@ -1439,10 +1441,12 @@ public class Interscene {
if (debugLevel > -3) {
System.out.println("Disparity at infinity ="+inf_disp+" in reference scene "+quadCLTs[ref_index].getImageName()+", scale_img="+scale_img);
}
if (apply_disparity_ims) {
// 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 inf_disp)
quadCLTs[ref_index].setDispInfinityRef( // may use incDispInfinityRef() - was 0 before
inf_disp); // double disp)
// correct xyz
OpticalFlow.scaleImgXYZ(
......@@ -1460,8 +1464,11 @@ public class Interscene {
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
......
......@@ -291,7 +291,7 @@ public class QuadCLTCPU {
* 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
*/
public void IncDispInfinityRef(
public void incDispInfinityRef(
double disp) {
disp_infinity_ref += disp;
}
......@@ -6389,12 +6389,49 @@ public class QuadCLTCPU {
for (int nslice:TwoQuadCLT.DSI_DISPARITY) if (dsi[nslice] != null){
double [] slice = dsi[nslice];
for (int i = 0; i < slice.length; i++) {
slice[i] += inf_disp;
slice[i] -= inf_disp;
}
}
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
......
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