Commit 8c2ea7ed authored by Andrey Filippov's avatar Andrey Filippov

debugging batch dsi

parent e12c624a
...@@ -585,7 +585,16 @@ public class CLTParameters { ...@@ -585,7 +585,16 @@ public class CLTParameters {
public double gr_fin_diff = 0.01; // Maximal change to finish smoothing iterations public double gr_fin_diff = 0.01; // Maximal change to finish smoothing iterations
public double gr_unique_tol = 0.15; // Do not re-measure correlation if target disparity differs from some previous by this public double gr_unique_tol = 0.15; // Do not re-measure correlation if target disparity differs from some previous by this
public double gr_unique_pretol = 0.5; // Larger tolerance for expanding (not refining) public double gr_unique_pretol = 0.5; // Larger tolerance for expanding (not refining)
public int gr_max_clust_radius = 4; // 7x7
public int gr_num_refines = 4;
public boolean gr_exp_certain = false;
public boolean gr_reduce_sngl = true;
public boolean gr_reduce_multi = true;
public boolean gr_all_last = true;
public boolean gr_nan_bg = true;
public boolean ft_mod_strength = true; // When set, multiply each tile strength by the number of selected neighbors public boolean ft_mod_strength = true; // When set, multiply each tile strength by the number of selected neighbors
public boolean ft_clusterize_by_highest = true; // Clusterize using disparity horizontal maximums for fronto planes and minimums - for horizontal. False - use histograms public boolean ft_clusterize_by_highest = true; // Clusterize using disparity horizontal maximums for fronto planes and minimums - for horizontal. False - use histograms
...@@ -1468,6 +1477,13 @@ public class CLTParameters { ...@@ -1468,6 +1477,13 @@ public class CLTParameters {
properties.setProperty(prefix+"gr_fin_diff", this.gr_fin_diff +""); properties.setProperty(prefix+"gr_fin_diff", this.gr_fin_diff +"");
properties.setProperty(prefix+"gr_unique_tol", this.gr_unique_tol +""); properties.setProperty(prefix+"gr_unique_tol", this.gr_unique_tol +"");
properties.setProperty(prefix+"gr_unique_pretol", this.gr_unique_pretol +""); properties.setProperty(prefix+"gr_unique_pretol", this.gr_unique_pretol +"");
properties.setProperty(prefix+"gr_max_clust_radius", this.gr_max_clust_radius +"");
properties.setProperty(prefix+"gr_num_refines", this.gr_num_refines +"");
properties.setProperty(prefix+"gr_exp_certain", this.gr_exp_certain +"");
properties.setProperty(prefix+"gr_reduce_sngl", this.gr_reduce_sngl +"");
properties.setProperty(prefix+"gr_reduce_multi", this.gr_reduce_multi +"");
properties.setProperty(prefix+"gr_all_last", this.gr_all_last +"");
properties.setProperty(prefix+"gr_nan_bg", this.gr_nan_bg +"");
properties.setProperty(prefix+"ft_mod_strength", this.ft_mod_strength +""); properties.setProperty(prefix+"ft_mod_strength", this.ft_mod_strength +"");
properties.setProperty(prefix+"ft_clusterize_by_highest", this.ft_clusterize_by_highest +""); properties.setProperty(prefix+"ft_clusterize_by_highest", this.ft_clusterize_by_highest +"");
...@@ -2298,8 +2314,14 @@ public class CLTParameters { ...@@ -2298,8 +2314,14 @@ public class CLTParameters {
if (properties.getProperty(prefix+"gr_fin_diff")!=null) this.gr_fin_diff=Double.parseDouble(properties.getProperty(prefix+"gr_fin_diff")); if (properties.getProperty(prefix+"gr_fin_diff")!=null) this.gr_fin_diff=Double.parseDouble(properties.getProperty(prefix+"gr_fin_diff"));
if (properties.getProperty(prefix+"gr_unique_tol")!=null) this.gr_unique_tol=Double.parseDouble(properties.getProperty(prefix+"gr_unique_tol")); if (properties.getProperty(prefix+"gr_unique_tol")!=null) this.gr_unique_tol=Double.parseDouble(properties.getProperty(prefix+"gr_unique_tol"));
if (properties.getProperty(prefix+"gr_unique_pretol")!=null) this.gr_unique_pretol=Double.parseDouble(properties.getProperty(prefix+"gr_unique_pretol")); if (properties.getProperty(prefix+"gr_unique_pretol")!=null) this.gr_unique_pretol=Double.parseDouble(properties.getProperty(prefix+"gr_unique_pretol"));
if (properties.getProperty(prefix+"gr_max_clust_radius")!=null) this.gr_max_clust_radius=Integer.parseInt(properties.getProperty(prefix+"gr_max_clust_radius"));
if (properties.getProperty(prefix+"gr_num_refines")!=null) this.gr_num_refines=Integer.parseInt(properties.getProperty(prefix+"gr_num_refines"));
if (properties.getProperty(prefix+"gr_exp_certain")!=null) this.gr_exp_certain=Boolean.parseBoolean(properties.getProperty(prefix+"gr_exp_certain"));
if (properties.getProperty(prefix+"gr_reduce_sngl")!=null) this.gr_reduce_sngl=Boolean.parseBoolean(properties.getProperty(prefix+"gr_reduce_sngl"));
if (properties.getProperty(prefix+"gr_reduce_multi")!=null) this.gr_reduce_multi=Boolean.parseBoolean(properties.getProperty(prefix+"gr_reduce_multi"));
if (properties.getProperty(prefix+"gr_all_last")!=null) this.gr_all_last=Boolean.parseBoolean(properties.getProperty(prefix+"gr_all_last"));
if (properties.getProperty(prefix+"gr_nan_bg")!=null) this.gr_nan_bg=Boolean.parseBoolean(properties.getProperty(prefix+"gr_nan_bg"));
if (properties.getProperty(prefix+"ft_mod_strength")!=null) this.ft_mod_strength=Boolean.parseBoolean(properties.getProperty(prefix+"ft_mod_strength")); if (properties.getProperty(prefix+"ft_mod_strength")!=null) this.ft_mod_strength=Boolean.parseBoolean(properties.getProperty(prefix+"ft_mod_strength"));
if (properties.getProperty(prefix+"ft_clusterize_by_highest")!=null) this.ft_clusterize_by_highest=Boolean.parseBoolean(properties.getProperty(prefix+"ft_clusterize_by_highest")); if (properties.getProperty(prefix+"ft_clusterize_by_highest")!=null) this.ft_clusterize_by_highest=Boolean.parseBoolean(properties.getProperty(prefix+"ft_clusterize_by_highest"));
if (properties.getProperty(prefix+"ft_clust_sigma")!=null) this.ft_clust_sigma=Double.parseDouble(properties.getProperty(prefix+"ft_clust_sigma")); if (properties.getProperty(prefix+"ft_clust_sigma")!=null) this.ft_clust_sigma=Double.parseDouble(properties.getProperty(prefix+"ft_clust_sigma"));
...@@ -2315,8 +2337,6 @@ public class CLTParameters { ...@@ -2315,8 +2337,6 @@ public class CLTParameters {
if (properties.getProperty(prefix+"ft_used_companions")!=null) this.ft_used_companions=Integer.parseInt(properties.getProperty(prefix+"ft_used_companions")); if (properties.getProperty(prefix+"ft_used_companions")!=null) this.ft_used_companions=Integer.parseInt(properties.getProperty(prefix+"ft_used_companions"));
if (properties.getProperty(prefix+"ft_used_true_companions")!=null) this.ft_used_true_companions=Integer.parseInt(properties.getProperty(prefix+"ft_used_true_companions")); if (properties.getProperty(prefix+"ft_used_true_companions")!=null) this.ft_used_true_companions=Integer.parseInt(properties.getProperty(prefix+"ft_used_true_companions"));
if (properties.getProperty(prefix+"plPreferDisparity")!=null) this.plPreferDisparity=Boolean.parseBoolean(properties.getProperty(prefix+"plPreferDisparity")); if (properties.getProperty(prefix+"plPreferDisparity")!=null) this.plPreferDisparity=Boolean.parseBoolean(properties.getProperty(prefix+"plPreferDisparity"));
if (properties.getProperty(prefix+"plDispNorm")!=null) this.plDispNorm=Double.parseDouble(properties.getProperty(prefix+"plDispNorm")); if (properties.getProperty(prefix+"plDispNorm")!=null) this.plDispNorm=Double.parseDouble(properties.getProperty(prefix+"plDispNorm"));
if (properties.getProperty(prefix+"plFrontoTol")!=null) this.plFrontoTol=Double.parseDouble(properties.getProperty(prefix+"plFrontoTol")); if (properties.getProperty(prefix+"plFrontoTol")!=null) this.plFrontoTol=Double.parseDouble(properties.getProperty(prefix+"plFrontoTol"));
...@@ -3289,7 +3309,25 @@ public class CLTParameters { ...@@ -3289,7 +3309,25 @@ public class CLTParameters {
gd.addNumericField("Maximal change to finish smoothing iterations", this.gr_fin_diff, 6); gd.addNumericField("Maximal change to finish smoothing iterations", this.gr_fin_diff, 6);
gd.addNumericField("Do not re-measure correlation if target disparity differs from some previous less", this.gr_unique_tol, 6); gd.addNumericField("Do not re-measure correlation if target disparity differs from some previous less", this.gr_unique_tol, 6);
gd.addNumericField("Larger tolerance for expanding (not refining)", this.gr_unique_pretol, 6); gd.addNumericField("Larger tolerance for expanding (not refining)", this.gr_unique_pretol, 6);
gd.addMessage ("--- Mukti-tile DSI expansion ---");
gd.addNumericField("Maximal cluster radius", this.gr_max_clust_radius, 0,6,"",
"2 - 3x3, 3 - 5x5, 4 - 7x7 tiles");
gd.addNumericField("Number of refines for each cluster radius", this.gr_num_refines, 0,6,"",
"Each tile will be processed until change fallls below gr_unique_tol ('Do not re-measure...' above), buit hard-limited by this value");
gd.addCheckbox ("Expand DSI over weak tiles", this.gr_exp_certain,
"Has problems (produces dips), disable");
gd.addCheckbox ("Reduce number of pairs when refining single-tile DSI", this.gr_reduce_sngl,
"Currently to 40 pairs: neigbors, squares, diameters");
gd.addCheckbox ("Reduce number of pairs when refining single-tile DSI", this.gr_reduce_multi,
"Currently to 40 pairs: neigbors, squares, diameters");
gd.addCheckbox ("Restore to all configured pairs for the last refine cycles", this.gr_all_last,
"Use configured (ImageDtt tab) pairs for the last refine cycles (both single and multi-tile");
gd.addCheckbox ("Undefine disparity for the background tiles", this.gr_nan_bg,
"Set DSI disparity to NaN for the BG tiles");
gd.addTab ("Alt CLusterize", "Alternative initial tiles clusterization"); gd.addTab ("Alt CLusterize", "Alternative initial tiles clusterization");
gd.addCheckbox ("Modify cluster strengths", this.ft_mod_strength, gd.addCheckbox ("Modify cluster strengths", this.ft_mod_strength,
...@@ -4170,6 +4208,13 @@ public class CLTParameters { ...@@ -4170,6 +4208,13 @@ public class CLTParameters {
this.gr_fin_diff= gd.getNextNumber(); this.gr_fin_diff= gd.getNextNumber();
this.gr_unique_tol= gd.getNextNumber(); this.gr_unique_tol= gd.getNextNumber();
this.gr_unique_pretol= gd.getNextNumber(); this.gr_unique_pretol= gd.getNextNumber();
this.gr_max_clust_radius= (int) gd.getNextNumber();
this.gr_num_refines= (int) gd.getNextNumber();
this.gr_exp_certain= gd.getNextBoolean();
this.gr_reduce_sngl= gd.getNextBoolean();
this.gr_reduce_multi= gd.getNextBoolean();
this.gr_all_last= gd.getNextBoolean();
this.gr_nan_bg= gd.getNextBoolean();
this.ft_mod_strength= gd.getNextBoolean(); this.ft_mod_strength= gd.getNextBoolean();
this.ft_clusterize_by_highest= gd.getNextBoolean(); this.ft_clusterize_by_highest= gd.getNextBoolean();
......
...@@ -1019,7 +1019,7 @@ public class EyesisCorrectionParameters { ...@@ -1019,7 +1019,7 @@ public class EyesisCorrectionParameters {
gd.addCheckbox ("Include/genarate separate aux camera DSI data in the combo DSI", this.clt_batch_dsi_aux, gd.addCheckbox ("Include/genarate separate aux camera DSI data in the combo DSI", this.clt_batch_dsi_aux,
"8-rig: DSI for the AUX camera is offset (by the rig baseline) from the main and rig DSI. Aux DSI requires extra processing time."+ "8-rig: DSI for the AUX camera is offset (by the rig baseline) from the main and rig DSI. Aux DSI requires extra processing time."+
" EO+LWIR - generate a separate GT+AUX file"); " EO+LWIR - generate a separate GT+AUX file");
gd.addCheckbox ("Additional steps to calculate Auf DSI (more than for LY adjustment)", this.clt_batch_dsi_aux_full, gd.addCheckbox ("Additional steps to calculate Aux DSI (more than for LY adjustment)", this.clt_batch_dsi_aux_full,
"(Not yet tested)"); "(Not yet tested)");
......
...@@ -2468,7 +2468,7 @@ public class ImageDtt extends ImageDttCPU { ...@@ -2468,7 +2468,7 @@ public class ImageDtt extends ImageDttCPU {
} }
nTile = tileY * tilesX + tileX; nTile = tileY * tilesX + tileX;
if (tp_tasks[iTile].getTask() == 0) continue; // nothing to do for this tile if (tp_tasks[iTile].getTask() == 0) continue; // nothing to do for this tile
boolean debugTile0 =(tileX == debug_tileX) && (tileY == debug_tileY) && (globalDebugLevel > -6); boolean debugTile0 =(tileX == debug_tileX) && (tileY == debug_tileY) && (globalDebugLevel > 0);
if (debugTile0) { if (debugTile0) {
System.out.println("clt_process_tl_correlations(): tileX="+tileX+", tileY="+tileY+", iTile="+iTile+", nTile="+nTile); System.out.println("clt_process_tl_correlations(): tileX="+tileX+", tileY="+tileY+", iTile="+iTile+", nTile="+nTile);
} }
...@@ -2517,7 +2517,9 @@ public class ImageDtt extends ImageDttCPU { ...@@ -2517,7 +2517,9 @@ public class ImageDtt extends ImageDttCPU {
corrs[npair] , //double [] corr_tile, corrs[npair] , //double [] corr_tile,
npair); // int num_pair) npair); // int num_pair)
if (pair_width < 0.1) { if (pair_width < 0.1) {
System.out.println("pair_width["+npair+"]="+pair_width); if (globalDebugLevel > 0) {
System.out.println("pair_width["+npair+"]="+pair_width);
}
} else { } else {
weights[npair] /= Math.pow(pair_width, imgdtt_params.mcorr_weights_power); weights[npair] /= Math.pow(pair_width, imgdtt_params.mcorr_weights_power);
} }
......
...@@ -15970,7 +15970,7 @@ public class ImageDttCPU { ...@@ -15970,7 +15970,7 @@ public class ImageDttCPU {
} }
} }
} }
boolean debugTile0 =(tileX == debug_tileX) && (tileY == debug_tileY) && (globalDebugLevel > -6); boolean debugTile0 =(tileX == debug_tileX) && (tileY == debug_tileY) && (globalDebugLevel > 0);
if (debugTile0) { if (debugTile0) {
System.out.println("clt_process_tl_correlations(): tileX="+tileX+", tileY="+tileY); System.out.println("clt_process_tl_correlations(): tileX="+tileX+", tileY="+tileY);
} }
...@@ -16027,7 +16027,9 @@ public class ImageDttCPU { ...@@ -16027,7 +16027,9 @@ public class ImageDttCPU {
corrs[npair] , //double [] corr_tile, corrs[npair] , //double [] corr_tile,
npair); // int num_pair) npair); // int num_pair)
if (pair_width < 0.1) { if (pair_width < 0.1) {
System.out.println("pair_width["+npair+"]="+pair_width); if (globalDebugLevel > 0) {
System.out.println("pair_width["+npair+"]="+pair_width);
}
} else { } else {
weights[npair] /= Math.pow(pair_width, imgdtt_params.mcorr_weights_power); weights[npair] /= Math.pow(pair_width, imgdtt_params.mcorr_weights_power);
} }
...@@ -16884,7 +16886,7 @@ public class ImageDttCPU { ...@@ -16884,7 +16886,7 @@ public class ImageDttCPU {
tileYC = tp_tasks[iTileC].getTileY(); // /tilesX; tileYC = tp_tasks[iTileC].getTileY(); // /tilesX;
tileXC = tp_tasks[iTileC].getTileX(); //nTile % tilesX; tileXC = tp_tasks[iTileC].getTileX(); //nTile % tilesX;
nTileC = tileYC * tilesX + tileXC; nTileC = tileYC * tilesX + tileXC;
if ((tileXC == debug_tileX) && (tileYC == debug_tileY)) { if ((globalDebugLevel > -2) && (tileXC == debug_tileX) && (tileYC == debug_tileY)) {
System.out.println("quadCorrTD_tilted(): tileXC="+tileXC+", tileYC="+tileYC+", iTileC="+iTileC); System.out.println("quadCorrTD_tilted(): tileXC="+tileXC+", tileYC="+tileYC+", iTileC="+iTileC);
} }
//quadCorrTD_tilted //quadCorrTD_tilted
...@@ -16963,7 +16965,7 @@ public class ImageDttCPU { ...@@ -16963,7 +16965,7 @@ public class ImageDttCPU {
} else { } else {
tp_index_multi[offset_index][cindex] = iTileC; tp_index_multi[offset_index][cindex] = iTileC;
} }
if ((globalDebugLevel > 0) && (tileXC == debug_tileX) && (tileYC == debug_tileY)) { if ((globalDebugLevel > -2) && (tileXC == debug_tileX) && (tileYC == debug_tileY)) {
System.out.println("mindx="+mindx+", cindex="+cindex+", disparity_target="+disparity_target+ System.out.println("mindx="+mindx+", cindex="+cindex+", disparity_target="+disparity_target+
", offset_index="+offset_index+", cindex="+cindex+", tileX="+tileX+", tileY="+tileY ); ", offset_index="+offset_index+", cindex="+cindex+", tileX="+tileX+", tileY="+tileY );
} }
...@@ -17037,7 +17039,7 @@ public class ImageDttCPU { ...@@ -17037,7 +17039,7 @@ public class ImageDttCPU {
globalDebugLevel); globalDebugLevel);
if (globalDebugLevel > 0) { if (globalDebugLevel > 0) {
for (TpTask tt: tp_tasks_pass) { for (TpTask tt: tp_tasks_pass) {
if ((globalDebugLevel > 0) && ((tt.getTileY() - idy) == debug_tileY) && ((tt.getTileX()-idx) == debug_tileX)) { if ((globalDebugLevel > -2) && ((tt.getTileY() - idy) == debug_tileY) && ((tt.getTileX()-idx) == debug_tileX)) {
System.out.println(" +++ neib_index="+neib_index+" tX="+tt.getTileX()+" tY="+tt.getTileY() System.out.println(" +++ neib_index="+neib_index+" tX="+tt.getTileX()+" tY="+tt.getTileY()
+ " target_disparity="+tt.getTargetDisparity()+" idx="+idx+" idy="+idy); + " target_disparity="+tt.getTargetDisparity()+" idx="+idx+" idy="+idy);
} }
...@@ -17064,7 +17066,7 @@ public class ImageDttCPU { ...@@ -17064,7 +17066,7 @@ public class ImageDttCPU {
float [][] src_corrs = fcorr_td_part[tY_src][tX_src]; float [][] src_corrs = fcorr_td_part[tY_src][tX_src];
if (src_corrs != null) { if (src_corrs != null) {
// TODO: finish checking correct fcorr_td_part // TODO: finish checking correct fcorr_td_part
if ((globalDebugLevel > 0) && (tX_dst == debug_tileX) && (tY_dst == debug_tileY)) { if ((globalDebugLevel > -2) && (tX_dst == debug_tileX) && (tY_dst == debug_tileY)) {
System.out.println("*** quadCorrTD_tilted_sum(): neib_index="+fneib_index+", tX_dst="+tX_dst+", tY_dst="+tY_dst+ System.out.println("*** quadCorrTD_tilted_sum(): neib_index="+fneib_index+", tX_dst="+tX_dst+", tY_dst="+tY_dst+
", iTileC="+iTileC+", tX_src="+tX_src+", tY_src="+tY_src+", w="+w); ", iTileC="+iTileC+", tX_src="+tX_src+", tY_src="+tY_src+", w="+w);
} }
......
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