// corr_wndy, // double [] window_y, // (half) window function in y-direction(perpendicular to disparity: for row0 ==1
// corr_wndx, // double [] window_x, // half of a window function in x (disparity) direction
(tile_lma_debug_level>0));// boolean debug);
}
// proceed only if CM correlation result is non-null // for compatibility with old code we need it to run regardless of the strength of the normal correlation
if(corr_stat[cTile]!=null){
disparity[cTile]=-corr_stat[cTile][0];
disparity_map[DISPARITY_INDEX_CM][tIndex]=disparity[cTile];// disparity is negative X
if(tile_lma_debug_level>0){
System.out.println("Will run getMaxXSOrtho( ) for tileX="+tileX+", tileY="+tileY);
}
// debug new LMA correlations
if(debugTile){
System.out.println("Will run new LMA for tileX="+tileX+", tileY="+tileY);
corr_wnd, // double [][] corr_wnd, // correlation window to save on re-calculation of the window
corr_wnd_inv_limited, // corr_wnd_inv_limited, // correlation window, limited not to be smaller than threshold - used for finding max/convex areas (or null)
corrs[cTile], // double [][] corrs,
disp_dist[cTile],
imgdtt_params.dbg_pair_mask, // int pair_mask, // which pairs to process
false, // boolean run_poly_instead, // true - run LMA, false - run 2d polynomial approximation
corr_stat[cTile][0], // double xcenter, // preliminary center x in pixels for largest baseline
imgdtt_params.ortho_vasw_pwr, // double vasw_pwr, // value as weight to this power,
tile_lma_debug_level+2, // int debug_level,
tileX, // int tileX, // just for debug output
tileY ); // int tileY
*/
}
}// end of if (corr_stat != null)
}// if (disparity_map != null){ // not null - calculate correlations
// only debug is left
}
}
}
}
if(debugCluster){
System.out.println("Will run new LMA for clustX="+clustX+", clustY="+clustY);
corr_wnd,// double [][] corr_wnd, // correlation window to save on re-calculation of the window
corr_wnd_inv_limited,// corr_wnd_inv_limited, // correlation window, limited not to be smaller than threshold - used for finding max/convex areas (or null)
corrs,// [tIndex], // double [][] corrs,
disp_dist,// [tIndex],
imgdtt_params.dbg_pair_mask,// int pair_mask, // which pairs to process
false,// boolean run_poly_instead, // true - run LMA, false - run 2d polynomial approximation
corr_stat,// double[][] xcenter_str, // preliminary center x in pixels for largest baseline
imgdtt_params.ortho_vasw_pwr,// double vasw_pwr, // value as weight to this power,
clust_lma_debug_level+1,// 2, // int debug_level,
clustX,// int tileX, // just for debug output
clustY);// int tileY
}
/*
public Corr2dLMA corrLMA2( // multi-tile
ImageDttParameters imgdtt_params,
int clust_width,
double [][] corr_wnd, // correlation window to save on re-calculation of the window
double [] corr_wnd_inv_limited, // correlation window, limited not to be smaller than threshold - used for finding max/convex areas (or null)
double [][][] corrs, // per tile, per pair, 2 correlation in line-scan order
double [][][] disp_dist, // per tile, per camera disparity matrix as a 1d (linescan order)
int pair_mask, // which pairs to process
boolean run_poly_instead, // true - run LMA, false - run 2d polynomial approximation
double xcenter, // preliminary center x in pixels for largest baseline
double vasw_pwr, // value as weight to this power,
int debug_level,
int tileX, // just for debug output
int tileY
)
*/
}
}
};
}
startAndJoin(threads);
// final double [][] dbg_distort = debug_distort? (new double [4*quad][tilesX*tilesY]) : null;
corr_wnd,// double [][] corr_wnd, // correlation window to save on re-calculation of the window
corr_wnd,// double [][] corr_wnd, // correlation window to save on re-calculation of the window
corr_wnd_limited,// corr_wnd_limited, // correlation window, limited not to be smaller than threshold - used for finding max/convex areas (or null)
corr_wnd_inv_limited,// corr_wnd_limited, // correlation window, limited not to be smaller than threshold - used for finding max/convex areas (or null)
corrs,// double [][] corrs,
corrs,// double [][] corrs,
disp_dist,
disp_dist,
imgdtt_params.dbg_pair_mask,// int pair_mask, // which pairs to process
imgdtt_params.dbg_pair_mask,// int pair_mask, // which pairs to process
false,// boolean run_poly_instead, // true - run LMA, false - run 2d polynomial approximation
false,// boolean run_poly_instead, // true - run LMA, false - run 2d polynomial approximation
0.5,// double sigma, // low-pass sigma to find maximum (and convex too
corr_stat[0],// double xcenter, // preliminary center x in pixels for largest baseline
corr_stat[0],// double xcenter, // preliminary center x in pixels for largest baseline
imgdtt_params.ortho_vasw_pwr,// double vasw_pwr, // value as weight to this power,
imgdtt_params.ortho_vasw_pwr,// double vasw_pwr, // value as weight to this power,
tile_lma_debug_level+2,// int debug_level,
tile_lma_debug_level+2,// int debug_level,
...
@@ -2938,6 +3569,9 @@ public class ImageDtt {
...
@@ -2938,6 +3569,9 @@ public class ImageDtt {
returnclt_data;
returnclt_data;
}
}
publicbooleandmExists(double[][]dm,intindx){// not used in lwir or else
publicbooleandmExists(double[][]dm,intindx){// not used in lwir or else
"Blur correlation before finding maximum and convex region");
gd.addNumericField("Initial/expected half-width of the correlation maximum in both directions",this.lma_half_width,3,6,"pix",
gd.addNumericField("Initial/expected half-width of the correlation maximum in both directions",this.lma_half_width,3,6,"pix",
"With LPF sigma = 0.9 it seems to be ~= 2.0. Used both as initial parameter and the fitted value difference from this may be penalized");
"With LPF sigma = 0.9 it seems to be ~= 2.0. Used both as initial parameter and the fitted value difference from this may be penalized");
...
@@ -287,7 +318,27 @@ public class ImageDttParameters {
...
@@ -287,7 +318,27 @@ public class ImageDttParameters {
gd.addNumericField("Normalization for the CM correlation strength",this.cm_max_normalization,6,8,"",
gd.addNumericField("Normalization for the CM correlation strength",this.cm_max_normalization,6,8,"",
"Fraction of correlation maximum radius, being squared multiplied by maximum to have the same total mass. ~= 0.5, the lower the value, the higher strength reported by the CM");
"Fraction of correlation maximum radius, being squared multiplied by maximum to have the same total mass. ~= 0.5, the lower the value, the higher strength reported by the CM");
// public double cm_max_normalization = 0.55; //
gd.addMessage("Cameras offsets in the disparity direction and orthogonal to disparity (debugging LMA)");
//TODO: Add array of default disparity - use for combining images in force disparity mode (no correlation), when disparity is predicted from other tiles
clt_mismatch=newdouble[12][];// What is 12?// not used in lwir
}
}
// Includes all 3 colors - will have zeros in unused
double[][]disparity_map=newdouble[ImageDtt.DISPARITY_TITLES.length][];//[0] -residual disparity, [1] - orthogonal (just for debugging) last 4 - max pixel differences