* Calculate each defined pair x,y expected offset, assuming only disparity, not lazy eye
* @param corrs - pairs 2D correlations (each in scanline order) - just to determine null/non-null
* @param disparity - expected disparity (e.g. from CM)
* @param disp_dist - per camera disparity matrix as a 1d (linescan order))
* @return per pair x,y expected center offset in 2D correlations or nulls for undefined pairs (or null if already set)
*/
publicdouble[][]getPairsOffsets(
double[][]corrs,
boolean[]pair_mask,
doubledisparity,
double[][]disp_dist){//
double[][]xy_offsets=newdouble[corrs.length][];
if(disp_dist!=null){
setMatrices(disp_dist);
}
for(intpair=0;pair<xy_offsets.length;pair++)if((pair<correlation2d.getNumPairs())&&(corrs[pair]!=null)&&((pair_mask==null)||pair_mask[pair])){// OK to calculate for each
corr_wnd,// double [][] corr_wnd, // correlation window to save on re-calculation of the window
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,// corrs, // double [][] corrs,
...
...
@@ -2605,9 +2621,12 @@ public class ImageDtt extends ImageDttCPU {
disp_str,//corr_stat[0], // double xcenter, // preliminary center x in pixels for largest baseline
poly_disp,// double[] poly_ds, // null or pair of disparity/strength
imgdtt_params.ortho_vasw_pwr,// double vasw_pwr, // value as weight to this power,
-2,//0, // tile_lma_debug_level, // +2, // int debug_level,
debug_lma_tile,// double [] debug_lma_tile,
(debugTile0?1:-2),// int debug_level,
// -2, //0, // tile_lma_debug_level, // +2, // int debug_level,
tileX,// int tileX, // just for debug output
tileY);// int tileY
tileY);
// int tileY
if(debugTile0){// should be debugTile
System.out.println("Ran LMA for tileX="+tileX+", tileY="+tileY);
}
...
...
@@ -2659,14 +2678,31 @@ public class ImageDtt extends ImageDttCPU {