Commit 6c2fb8a0 authored by Andrey Filippov's avatar Andrey Filippov

refactoring, alignment with LWIR sensors

parent 04a6a7dd
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -1247,7 +1247,9 @@ public class EyesisCorrectionParameters {
String [] extensions = getSourceSuffixes();// ={this.sourceSuffix};
String [] prefixes = getSourcePrefixes();
int num_chn_files = numSubCameras + ((aux_camera != null)?aux_camera.numSubCameras : 0);
int num_chn_main = numSubCameras;
int num_chn_aux = ((aux_camera != null)?aux_camera.numSubCameras : 0);
int num_chn_files = num_chn_main + num_chn_aux;
extensions[0] = sourceSuffix;
prefixes[0] = sourcePrefix;
MultipleExtensionsFileFilter setFilter = new MultipleExtensionsFileFilter(prefixes,extensions,"Image sets");
......@@ -1281,7 +1283,10 @@ public class EyesisCorrectionParameters {
// String [] setChnFiles = files[nFile].list(setFilter);
File [] setChnFiles = files[nFile].listFiles(setFilter);
int num_match = setChnFiles.length;
if (num_match == num_chn_files) { // only use sets of exact number of files
if ( (num_match == num_chn_files) || // all files for main and aux
(num_match == num_chn_main) || // only main camera files
(num_match == num_chn_aux)) // only aux camera files
{ // only use sets of exact number of files
setDirList.add(files[nFile]);
for (File f: setChnFiles) {
setFilesList.add(f);
......
......@@ -1220,7 +1220,7 @@ public class EyesisDCT {
}
if (this.correctionsParameters.deconvolve) { // process with DCT, otherwise use simple debayer
ImageDtt image_dtt = new ImageDtt(false); // Bayer, not monochrome
ImageDtt image_dtt = new ImageDtt(false, 1.0); // Bayer( not monochrome), scale correlation strengths
double [][][][] dct_data = image_dtt.mdctStack(
stack,
channel,
......
......@@ -3064,7 +3064,7 @@ private Panel panel1,
}
}
ImageDtt image_dtt = new ImageDtt(false); // Bayer, not monochrome
ImageDtt image_dtt = new ImageDtt(false, 1.0); // Bayer( not monochrome), scale correlation strengths
double [][][][] dctdc_data = image_dtt.mdctScale(
DBG_IMP.getStack(),
DCT_PARAMETERS.kernel_chn,
......@@ -3162,7 +3162,7 @@ private Panel panel1,
}
}
ImageDtt image_dtt = new ImageDtt(false); // Bayer, not monochrome
ImageDtt image_dtt = new ImageDtt(false, 1.0); // Bayer( not monochrome), scale correlation strengths
double [][][][] dctdc_data = image_dtt.mdctStack(
DBG_IMP.getStack(),
DCT_PARAMETERS.kernel_chn,
......@@ -4631,7 +4631,6 @@ private Panel panel1,
QUAD_CLT.cltDisparityScans(
CLT_PARAMETERS, // EyesisCorrectionParameters.DCTParameters dct_parameters,
DEBAYER_PARAMETERS, //EyesisCorrectionParameters.DebayerParameters debayerParameters,
// NONLIN_PARAMETERS, //EyesisCorrectionParameters.NonlinParameters nonlinParameters,
COLOR_PROC_PARAMETERS, //EyesisCorrectionParameters.ColorProcParameters colorProcParameters,
CHANNEL_GAINS_PARAMETERS, //CorrectionColorProc.ColorGainsParameters channelGainParameters,
RGB_PARAMETERS, //EyesisCorrectionParameters.RGBParameters rgbParameters,
......@@ -4678,82 +4677,12 @@ private Panel panel1,
clt3d(adjust_extrinsics, adjust_poly, dry_run);
return;
} else if (label.equals("AUX extrinsics") || label.equals("AUX Poly corr")) {
} else if (label.equals("AUX 3D") || label.equals("AUX extrinsics") || label.equals("AUX Poly corr")) {
boolean adjust_extrinsics = label.equals("AUX extrinsics") || label.equals("AUX Poly corr");
boolean adjust_poly = label.equals("AUX Poly corr");
DEBUG_LEVEL=MASTER_DEBUG_LEVEL;
EYESIS_CORRECTIONS.setDebug(DEBUG_LEVEL);
clt3d_aux(adjust_extrinsics, adjust_poly);
/*
if (QUAD_CLT_AUX == null){
if (EYESIS_CORRECTIONS_AUX == null) {
EYESIS_CORRECTIONS_AUX = new EyesisCorrections(SYNC_COMMAND.stopRequested,CORRECTION_PARAMETERS.getAux());
}
QUAD_CLT_AUX = new QuadCLT (
QuadCLT.PREFIX_AUX,
PROPERTIES,
EYESIS_CORRECTIONS_AUX,
CORRECTION_PARAMETERS.getAux());
if (DEBUG_LEVEL > 0){
System.out.println("Created new QuadCLT instance for AUX camera, will need to read CLT kernels for aux camera");
}
}
String configPath=getSaveCongigPath();
if (configPath.equals("ABORT")) return;
EYESIS_CORRECTIONS_AUX.initSensorFiles(DEBUG_LEVEL);
int numChannelsAux=EYESIS_CORRECTIONS_AUX.getNumChannels();
CHANNEL_GAINS_PARAMETERS_AUX.modifyNumChannels(numChannelsAux);
if (!QUAD_CLT_AUX.CLTKernelsAvailable()){
if (DEBUG_LEVEL > 0){
System.out.println("Reading AUX CLT kernels");
}
QUAD_CLT_AUX.readCLTKernels(
CLT_PARAMETERS,
THREADS_MAX,
UPDATE_STATUS, // update status info
DEBUG_LEVEL);
if (DEBUG_LEVEL > 1){
QUAD_CLT_AUX.showCLTKernels(
THREADS_MAX,
UPDATE_STATUS, // update status info
DEBUG_LEVEL);
}
}
if (!QUAD_CLT_AUX.geometryCorrectionAvailable()){
if (DEBUG_LEVEL > 0){
System.out.println("Calculating geometryCorrection for AUX camera");
}
if (!QUAD_CLT_AUX.initGeometryCorrection(DEBUG_LEVEL+2)){
return;
}
}
QUAD_CLT_AUX.processCLTQuads3d(
adjust_extrinsics, // boolean adjust_extrinsics,
adjust_poly, // boolean adjust_poly,
CLT_PARAMETERS, // EyesisCorrectionParameters.DCTParameters dct_parameters,
DEBAYER_PARAMETERS, //EyesisCorrectionParameters.DebayerParameters debayerParameters,
COLOR_PROC_PARAMETERS, //EyesisCorrectionParameters.ColorProcParameters colorProcParameters,
CHANNEL_GAINS_PARAMETERS_AUX, //CorrectionColorProc.ColorGainsParameters channelGainParameters,
RGB_PARAMETERS, //EyesisCorrectionParameters.RGBParameters rgbParameters,
EQUIRECTANGULAR_PARAMETERS, // EyesisCorrectionParameters.EquirectangularParameters equirectangularParameters,
THREADS_MAX, //final int threadsMax, // maximal number of threads to launch
UPDATE_STATUS, //final boolean updateStatus,
DEBUG_LEVEL); //final int debugLevel);
if (configPath!=null) {
saveTimestampedProperties( // save config again
configPath, // full path or null
null, // use as default directory if path==null
true,
PROPERTIES);
}
*/
return;
} else if (label.equals("CLT planes")) {
......@@ -5825,14 +5754,14 @@ private Panel panel1,
adjust_poly, // boolean adjust_poly,
TWO_QUAD_CLT, // TwoQuadCLT twoQuadCLT, //maybe null in no-rig mode, otherwise may contain rig measurements to be used as infinity ground truth
CLT_PARAMETERS, // EyesisCorrectionParameters.DCTParameters dct_parameters,
DEBAYER_PARAMETERS, //EyesisCorrectionParameters.DebayerParameters debayerParameters,
COLOR_PROC_PARAMETERS, //EyesisCorrectionParameters.ColorProcParameters colorProcParameters,
CHANNEL_GAINS_PARAMETERS_AUX, //CorrectionColorProc.ColorGainsParameters channelGainParameters,
RGB_PARAMETERS, //EyesisCorrectionParameters.RGBParameters rgbParameters,
DEBAYER_PARAMETERS, // EyesisCorrectionParameters.DebayerParameters debayerParameters,
COLOR_PROC_PARAMETERS_AUX, // EyesisCorrectionParameters.ColorProcParameters colorProcParameters,
CHANNEL_GAINS_PARAMETERS_AUX, // CorrectionColorProc.ColorGainsParameters channelGainParameters,
RGB_PARAMETERS, // EyesisCorrectionParameters.RGBParameters rgbParameters,
EQUIRECTANGULAR_PARAMETERS, // EyesisCorrectionParameters.EquirectangularParameters equirectangularParameters,
THREADS_MAX, //final int threadsMax, // maximal number of threads to launch
UPDATE_STATUS, //final boolean updateStatus,
DEBUG_LEVEL); //final int debugLevel);
THREADS_MAX, // final int threadsMax, // maximal number of threads to launch
UPDATE_STATUS, // final boolean updateStatus,
DEBUG_LEVEL); // final int debugLevel);
if (configPath!=null) {
......@@ -6840,7 +6769,7 @@ private Panel panel1,
}
}
ImageDtt image_dtt = new ImageDtt(false); // Bayer, not monochrome
ImageDtt image_dtt = new ImageDtt(false, 1.0); // Bayer( not monochrome), scale correlation strengths
double [][][][][] clt_data = image_dtt.cltStack(
DBG_IMP.getStack(),
0, // CLT_PARAMETERS.kernel_chn,
......@@ -6970,7 +6899,7 @@ private Panel panel1,
}
String suffix = "-dx_"+(CLT_PARAMETERS.ishift_x+CLT_PARAMETERS.shift_x)+"_dy_"+(CLT_PARAMETERS.ishift_y+CLT_PARAMETERS.shift_y);
ImageDtt image_dtt = new ImageDtt(COLOR_PROC_PARAMETERS.isMonochrome()); // Bayer, not monochrome
ImageDtt image_dtt = new ImageDtt(COLOR_PROC_PARAMETERS.isMonochrome(), CLT_PARAMETERS.getScaleStrength(false)); // Bayer, not monochrome
String [] titles = {
"redCC", "redSC", "redCS", "redSS",
"blueCC", "blueSC", "blueCS", "blueSS",
......@@ -7059,7 +6988,7 @@ private Panel panel1,
clt_data[chn], // final double [][][][] data1, // array [tilesY][tilesX][4][dct_size*dct_size]
clt_data2[chn], // final double [][][][] data2, // array [tilesY][tilesX][4][dct_size*dct_size]
CLT_PARAMETERS.transform_size, // final int dct_size,
CLT_PARAMETERS.fat_zero, // final double fat_zero, // add to denominator to modify phase correlation (same units as data1, data2)
CLT_PARAMETERS.getFatZero(image_dtt.isMonochrome()), // final double fat_zero, // add to denominator to modify phase correlation (same units as data1, data2)
CLT_PARAMETERS.tileX, //final int debug_tileX
CLT_PARAMETERS.tileY, //final int debug_tileY
......
......@@ -1775,6 +1775,7 @@ B = |+dy0 -dy1 -2*dy3 |
final int hist_min_samples,
final boolean hist_norm_center, // if there are more tiles that fit than min_samples, replace with
final double inf_fraction, // fraction of the weight for the infinity tiles
final boolean right_left, // equalize weights of right/left FoV (use with horizon in both halves and gross infinity correction)
CLTParameters clt_parameters,
double [][] scans_14,
double [][] target_disparity, // null or programmed disparity (1 per each 14 entries of scans_14)
......@@ -1878,7 +1879,8 @@ B = |+dy0 -dy1 -2*dy3 |
}
if (debugLevel > -2) {
System.out.println("lazyEyeCorrection() 1: removing tiles with residual disparity absoulte value > "+lazyEyeCompDiff);
System.out.println("lazyEyeCorrection().a 1: removing tiles with residual disparity absolute value > "+lazyEyeCompDiff);
// System.out.println("lazyEyeCorrection().a 1: removing tiles with residual disparity absolute value > "+(2*lazyEyeCompDiff));
}
double [][] combo_mismatch = new double [NUM_SLICES][num_tiles];
......@@ -1891,6 +1893,7 @@ B = |+dy0 -dy1 -2*dy3 |
double w = filtered_scans[ns * NUM_SLICES + 1][nTile];
if (w > 0.0){
double disp = filtered_scans[ns * NUM_SLICES + 0][nTile];
// if (Math.abs(disp) <= 2.0*lazyEyeCompDiff) {
if (Math.abs(disp) <= lazyEyeCompDiff) {
for (int i = 2; i < NUM_SLICES; i++) if (i != 1){
combo_mismatch[i][nTile] += filtered_scans[ns * NUM_SLICES + i][nTile] * w;
......@@ -2214,6 +2217,29 @@ B = |+dy0 -dy1 -2*dy3 |
System.out.println("lazyEyeCorrection(): number of all samples="+inf_samples_list.size()+", total weight = "+inf_weight);
}
if (right_left) {
System.out.println("Balancing right/left part of FoV weights, width = "+tilesX+" tiles");
double [] right_left_weights = {0.0, 0.0};
for (Sample s: inf_samples_list) {
int rl = (s.tile % tilesX) / (tilesX/2);
right_left_weights[rl] += s.weight;
}
System.out.println("Weights: left:"+ right_left_weights[0]+", right:"+ right_left_weights[1]);
for (Sample s: inf_samples_list) {
int rl = (s.tile % tilesX) / (tilesX/2);
s.weight *= right_left_weights[1 - rl];
}
// just verifying
right_left_weights[0] = 0.0;
right_left_weights[1] = 0.0;
for (Sample s: inf_samples_list) {
int rl = (s.tile % tilesX) / (tilesX/2);
right_left_weights[rl] += s.weight;
}
System.out.println("Weights after balancing: left:"+ right_left_weights[0]+", right:"+ right_left_weights[1]);
}
if (debugLevel > 0) {
String [] prefixes = {"disparity", "strength", "dx0", "dy0", "dx1", "dy1", "dx2", "dy2", "dx3", "dy3"};
......@@ -3369,6 +3395,11 @@ B = |+dy0 -dy1 -2*dy3 |
int dbg_height = qc.tp.getTilesY()*qc.tp.getTileSize();
int dbg_owidth = dbg_width/dbg_decimate;
int dbg_oheight = dbg_height/dbg_decimate;
while (dbg_owidth < 40) {
dbg_decimate /= 2;
dbg_owidth = dbg_width/dbg_decimate;
dbg_oheight = dbg_height/dbg_decimate;
}
int dbg_length = dbg_owidth*dbg_oheight;
String [] dbg_titles_sym= {"sym0","sym1","sym2","sym3","sym4","sym5","sroll0","sroll1","sroll2","sroll3", "zoom0", "zoom1", "zoom2"};
String [] dbg_titles_xy= {"dx0","dy0","dx1","dy1","dx2","dy2","dx3","y3"};
......
......@@ -244,6 +244,7 @@ public class Correlation2d {
* @param clt_data1 [3][4][transform_len] first operand data. First index - RBG color
* @param clt_data2 [3][4][transform_len] first operand data. First index - RBG color
* @param lpf optional [transform_len] LPF filter data
* @param scale_value scale correlation results to compensate for lpf changes and other factors
* @param col_weights [3] - color weights {R, B, G} - green is last, normalized to sum =1.0
* @param fat_zero fat zero for phase correlation (0 seems to be OK)
* @return correlation result [(2*transform_size-1) * (2*transform_size-1)]
......@@ -252,6 +253,7 @@ public class Correlation2d {
double [][][] clt_data1,
double [][][] clt_data2,
double [] lpf,
double scale_value, // scale correlation value
double [] col_weights_in, // should have the same dimension as clt_data1 and clt_data2
double fat_zero) {
......@@ -266,13 +268,18 @@ public class Correlation2d {
s+=col_weights[i];
}
for (int i = 0; i < col_weights.length; i++) {
if (col_weights[i] != 0.0) col_weights[i]/=s; // will have 1.0 for the single color
if (col_weights[i] != 0.0) col_weights[i] *= scale_value;
}
if (clt_data1.length == 1) { // monochrome
col_weights = new double[1];
col_weights[0] = 1.0;
}
for (int i = 0; i < col_weights.length; i++) {
if (col_weights[i] != 0.0) col_weights[i]/=s; // will have 1.0 for the single color
}
double [][][]tcorr = new double [clt_data1.length][4][transform_len];
int first_col = -1;
for (int col = 0; col < tcorr.length; col++) if (col_weights[col] > 0.0 ) {
......@@ -280,7 +287,7 @@ public class Correlation2d {
clt_data1[col],
clt_data2[col],
tcorr[col],
fat_zero);
fat_zero/scale_value);
if (first_col < 0) {// accummulate all channels in frst non-null color ( 0 for color, 2 for mono?)
first_col = col; // first non-empty color (2, green) or 0 for color images
......@@ -320,6 +327,7 @@ public class Correlation2d {
* @param tileY tile to extract Y index
* @param pairs_mask bimask of required pairs
* @param lpf optional low-pass filter
* @param scale_value scale correlation results to compensate for lpf changes and other factors
* @param col_weights RBG color weights
* @param fat_zero fat zero for phase correlations
* @return [pair][corr_index]
......@@ -330,6 +338,7 @@ public class Correlation2d {
int tileY,
int pairs_mask,
double [] lpf,
double scale_value, // scale correlation value
double [] col_weights,
double fat_zero) {
double [][][][] clt_data_tile = new double[clt_data.length][][][];
......@@ -343,6 +352,7 @@ public class Correlation2d {
clt_data_tile,
pairs_mask, // already decoded so bit 0 - pair 0
lpf,
scale_value,
col_weights,
fat_zero);
}
......@@ -352,6 +362,7 @@ public class Correlation2d {
* @param clt_data aberration-corrected FD CLT data for one tile [camera][color][quadrant][index]
* @param pairs_mask bimask of required pairs
* @param lpf optional low-pass filter
* @param scale_value scale correlation results to compensate for lpf changes and other factors
* @param col_weights RBG color weights
* @param fat_zero fat zero for phase correlations
* @return [pair][corr_index]
......@@ -360,6 +371,7 @@ public class Correlation2d {
double [][][][] clt_data_tile,
int pairs_mask, // already decoded so bit 0 - pair 0
double [] lpf,
double scale_value, // scale correlation value
double [] col_weights,
double fat_zero) {
if (clt_data_tile == null) return null;
......@@ -372,6 +384,7 @@ public class Correlation2d {
clt_data_tile[ncam1], // double [][][] clt_data1,
clt_data_tile[ncam2], // double [][][] clt_data2,
lpf, // double [] lpf,
scale_value,
col_weights, // double [] col_weights,
fat_zero); // double fat_zero)
}
......@@ -385,6 +398,7 @@ public class Correlation2d {
* @param clt_data_tile_main aberration-corrected FD CLT data for one tile of the main quad camera [sub-camera][color][quadrant][index]
* @param clt_data_tile_aux aberration-corrected FD CLT data for one tile of the auxiliary quad camera [sub-camera][color][quadrant][index]
* @param lpf optional low-pass filter
* @param scale_value scale correlation results to compensate for lpf changes and other factors
* @param col_weights RBG color weights
* @param fat_zero fat zero for phase correlations
* @return 2-d correlation array in line scan order
......@@ -393,6 +407,7 @@ public class Correlation2d {
double [][][][] clt_data_tile_main,
double [][][][] clt_data_tile_aux,
double [] lpf,
double scale_value, // scale correlation value
double [] col_weights,
double fat_zero) {
if ((clt_data_tile_main == null) || (clt_data_tile_aux == null)) return null;
......@@ -402,6 +417,7 @@ public class Correlation2d {
clt_mix_main, // double [][][] clt_data1,
clt_mix_aux, // double [][][] clt_data2,
lpf, // double [] lpf,
scale_value, // scale correlation value
col_weights, // double [] col_weights,
fat_zero); // double fat_zero)
return inter_cam_corr;
......
......@@ -1340,8 +1340,8 @@ public class GeometryCorrection {
sv[i] = sym_vect[i]*1000.0*distortionRadius/pixelSize; // zooms
}
s = String.format("tilt (up): %8.5fpx %8.5fpx %8.5fpx %8.5fpx (shift of he image center)\n" , v[0], v[1], v[2], -(v[0] + v[1] + v[2]) );
s += String.format("azimuth (right): %8.5fpx %8.5fpx %8.5fpx %8.5fpx (shift of he image center)\n" , v[3], v[4], v[5], -(v[3] + v[4] + v[5]) );
s = String.format("tilt (up): %8.5fpx %8.5fpx %8.5fpx %8.5fpx (shift of the image center)\n" , v[0], v[1], v[2], -(v[0] + v[1] + v[2]) );
s += String.format("azimuth (right): %8.5fpx %8.5fpx %8.5fpx %8.5fpx (shift of the image center)\n" , v[3], v[4], v[5], -(v[3] + v[4] + v[5]) );
s += String.format("roll (CW): %8.5fpx %8.5fpx %8.5fpx %8.5fpx (shift at the image half-width from the center)\n" , v[6], v[7], v[8], v[9] );
s += String.format("diff zoom (in): %8.5fpx %8.5fpx %8.5fpx %8.5fpx (shift at the image half-width from the center)\n" , v[10], v[11], v[12], -(v[10] + v[11] + v[12]) );
s += "Symmetrical vector:\n";
......
......@@ -202,6 +202,7 @@ public class ImageDtt {
static String [] TCORR_TITLES = {"combo","sum","hor","vert"};
private final boolean monochrome;
private final double scale_strengths; // scale all correlation strengths (to compensate for LPF sigma changes)
public static int getImgMask (int data){ return (data & 0xf);} // which images to use
......@@ -213,8 +214,11 @@ public class ImageDtt {
public static boolean getOrthoLines (int data){return (data & 0x200) != 0;}
public static int setOrthoLines (int data, boolean force) {return (data & ~0x200) | (force?0x200:0);}
public ImageDtt(boolean mono){
monochrome = mono;
public ImageDtt(
boolean mono,
double scale_strengths){
this.monochrome = mono;
this.scale_strengths = scale_strengths;
}
public boolean isMonochrome() {
......@@ -2110,12 +2114,14 @@ public class ImageDtt {
// calculate all selected pairs correlations
int all_pairs = imgdtt_params.dbg_pair_mask; //TODO: use tile tasks
double [][] corrs = corr2d.correlateCompositeFD( // now works with nulls for some clt_data colors
clt_data, // double [][][][][][] clt_data,
tileX, // int tileX,
tileY, // int tileY,
all_pairs, // int pairs_mask,
filter, // double [] lpf,
scale_strengths, // double scale_value, // scale correlation value
col_weights, // double [] col_weights,
corr_fat_zero); // double fat_zero)
......@@ -6208,7 +6214,7 @@ public class ImageDtt {
// Create window to select center correlation strip using
// ortho_height - full width of non-zero elements
// ortho_eff_height - effective height (ration of the weighted column sum to the center value)
// ortho_eff_height - effective height (ratio of the weighted column sum to the center value)
int wcenter = transform_size - 1;
final double [] ortho_weights = new double [corr_size]; // [15]
for (int i = 0; i < corr_size; i++){
......@@ -7372,6 +7378,7 @@ public class ImageDtt {
clt_data_tile_main, // double [][][][] clt_data_tile_main,
clt_data_tile_aux, // double [][][][] clt_data_tile_aux,
filter, // double [] lpf,
scale_strengths,
col_weights, // double [] col_weights,
fatzero); // double fat_zero)
......@@ -7627,6 +7634,7 @@ public class ImageDtt {
clt_data, // double [][][][] clt_data, // aberration-corrected FD CLT data for one tile [camera][color][quadrant][index]
all_pairs, // int pairs_mask,
filter, // double [] lpf,
scale_strengths,
col_weights, // double [] col_weights,
fatzero); // double fat_zero)
......@@ -8466,6 +8474,7 @@ public class ImageDtt {
clt_data_main, // double [][][][] clt_data_tile_main,
clt_data_aux, // double [][][][] clt_data_tile_aux,
filter, // double [] lpf,
scale_strengths,
col_weights, // double [] col_weights,
fatzero); // double fat_zero)
......@@ -9242,6 +9251,7 @@ public class ImageDtt {
clt_data_main, // double [][][][] clt_data_tile_main,
clt_data_aux, // double [][][][] clt_data_tile_aux,
filter, // double [] lpf,
scale_strengths,
col_weights, // double [] col_weights,
fatzero); // double fat_zero)
......@@ -9630,7 +9640,7 @@ public class ImageDtt {
System.out.println("max_corr_radius= "+clt_parameters.max_corr_radius);
System.out.println("max_search_radius= "+max_search_radius);
System.out.println("max_search_radius_poly="+max_search_radius_poly);
System.out.println("corr_fat_zero= "+clt_parameters.fat_zero);
System.out.println("corr_fat_zero= "+clt_parameters.getFatZero(isMonochrome()));
System.out.println("disparity_array[0][0]= "+disparity_array[0][0]);
......
......@@ -63,6 +63,7 @@ public class MacroCorrelation {
tileSize, // int tileSize,
tp.superTileSize, // int superTileSize,
tp.isMonochrome(),
tp.isAux(),
tp.getMagicScale(), // double scale,
trusted_correlation, // double trustedCorrelation,
0.0, // double maxOverexposure,
......@@ -305,7 +306,9 @@ public class MacroCorrelation {
// double [][][][] texture_tiles = save_textures ? new double [tilesY][tilesX][][] : null; // ["RGBA".length()][];
ImageDtt image_dtt = new ImageDtt(this.mtp.isMonochrome());
ImageDtt image_dtt = new ImageDtt(
this.mtp.isMonochrome(),
clt_parameters.getScaleStrength(this.mtp.isAux()));
image_dtt.clt_aberrations_quad_corr(
clt_parameters.img_dtt, // final ImageDttParameters imgdtt_params, // Now just extra correlation parameters, later will include, most others
8, // final int macro_scale, // to correlate tile data instead of the pixel data: 1 - pixels, 8 - tiles
......@@ -321,7 +324,7 @@ public class MacroCorrelation {
disparity_map, // [12][tp.tilesY * tp.tilesX]
null, // [tp.tilesY][tp.tilesX]["RGBA".length()][];
mTilesX * clt_parameters.transform_size, // imp_quad[0].getWidth(), // final int width,
clt_parameters.fat_zero, // add to denominator to modify phase correlation (same units as data1, data2). <0 - pure sum
clt_parameters.getFatZero(image_dtt.isMonochrome()), // add to denominator to modify phase correlation (same units as data1, data2). <0 - pure sum
clt_parameters.corr_sym,
clt_parameters.corr_offset,
clt_parameters.corr_red,
......
......@@ -2723,7 +2723,7 @@ public class PoleProcessor {
disparity_array, // double [][] disparity_array,
null, // double [][] ml_data, // data for ML - 10 layers - 4 center areas (3x3, 5x5,..) per camera-per direction, 1 - composite, and 1 with just 1 data (target disparity)
clt_parameters, // EyesisCorrectionParameters.CLTParameters clt_parameters,
clt_parameters.fat_zero, // double fatzero,
clt_parameters.getFatZero(quadCLT_main.isMonochrome()), // double fatzero,
notch_mode, // final boolean notch_mode, // use notch filter for inter-camera correlation to detect poles
lt_rad, // final int // low texture mode - inter-correlation is averaged between the neighbors before argmax-ing, using
true, // boolean no_int_x0, // do not offset window to integer maximum - used when averaging low textures to avoid "jumps" for very wide
......
......@@ -75,6 +75,7 @@ public class TileProcessor {
public double [][] main_ds_ml = null; // main camera DSI restored from the COMBO-DSI file to generate ML test files
public boolean monochrome = false; // these are monochrome images
private boolean is_aux = false; // this camera is aux
public int clt_3d_passes_size = 0; //clt_3d_passes size after initial processing
public int clt_3d_passes_rig_size = 0; //clt_3d_passes size after initial processing and rig processing
private int tilesX;
......@@ -104,6 +105,7 @@ public class TileProcessor {
int tileSize,
int superTileSize,
boolean monochrome,
boolean is_aux,
double scale,
double trustedCorrelation,
double maxOverexposure,
......@@ -114,12 +116,15 @@ public class TileProcessor {
this.tileSize = tileSize;
this.superTileSize = superTileSize;
this.monochrome = monochrome;
this.is_aux = is_aux;
this.corr_magic_scale = scale;
this.trustedCorrelation = trustedCorrelation;
this.maxOverexposure = maxOverexposure;
this.threadsMax = threadsMax;
}
public boolean isMonochrome() {return monochrome;}
public boolean isAux() {return is_aux;}
public int getTilesX() {return tilesX;}
public int getTilesY() {return tilesY;}
public int getTileSize() {return tileSize;}
......@@ -3055,7 +3060,7 @@ public class TileProcessor {
dbg_img[3][i] = disparity_map[ImageDtt.DISPARITY_STRENGTH_INDEX][i];
dbg_img[4][i] = disparity_map[disparity_index][i];
}
sdfa_instance.showArrays(dbg_img, tilesX, tilesY, true, "bgnd_nonbgnd",titles);
sdfa_instance.showArrays(dbg_img, tilesX, tilesY, true, "bgnd_nonbgnd_new",titles);
}
for (int gain = 1; gain > 0;){
......@@ -4062,19 +4067,53 @@ public class TileProcessor {
}
public int [][] setSameTileOp(
int op){
return setSameTileOp(
0,
tilesX,
0,
tilesY,
op,
-1);
}
public int [][] setSameTileOp(
CLTParameters clt_parameters,
int op,
int debugLevel
)
{
int [][] tile_op = new int [tilesY][tilesX]; // all zero
int debugLevel){
int txl = clt_parameters.tile_task_wl;
int txr = txl + clt_parameters.tile_task_ww;
int tyt = clt_parameters.tile_task_wt;
int tyb = tyt + clt_parameters.tile_task_wh;
if (debugLevel > -1){
System.out.println("clt_parameters.tile_task_wl="+clt_parameters.tile_task_wl );
System.out.println("clt_parameters.tile_task_wt="+clt_parameters.tile_task_wt );
System.out.println("clt_parameters.tile_task_ww="+clt_parameters.tile_task_ww );
System.out.println("clt_parameters.tile_task_wh="+clt_parameters.tile_task_wh );
}
return setSameTileOp(
txl,
txr,
tyt,
tyb,
op,
debugLevel);
}
public int [][] setSameTileOp(
// CLTParameters clt_parameters,
int txl, // = clt_parameters.tile_task_wl;
int txr, // = txl + clt_parameters.tile_task_ww;
int tyt, // = clt_parameters.tile_task_wt;
int tyb, // = tyt + clt_parameters.tile_task_wh;
int op,
int debugLevel
)
{
int [][] tile_op = new int [tilesY][tilesX]; // all zero
if (txl < 0) txl = 0;
else if (txl >= tilesX) txl = tilesX - 1;
......@@ -4093,10 +4132,6 @@ public class TileProcessor {
}
}
if (debugLevel > -1){
System.out.println("clt_parameters.tile_task_wl="+clt_parameters.tile_task_wl );
System.out.println("clt_parameters.tile_task_wt="+clt_parameters.tile_task_wt );
System.out.println("clt_parameters.tile_task_ww="+clt_parameters.tile_task_ww );
System.out.println("clt_parameters.tile_task_wh="+clt_parameters.tile_task_wh );
System.out.println("getImgMask("+op+")="+ImageDtt.getImgMask(op) );
System.out.println("getPairMask("+op+")="+ImageDtt.getPairMask(op) );
System.out.println("getForcedDisparity("+op+")="+ImageDtt.getForcedDisparity(op) );
......@@ -5169,7 +5204,6 @@ public class TileProcessor {
GeometryCorrection geometryCorrection,
final int threadsMax, // maximal number of threads to launch
final boolean updateStatus,
// final boolean batch_mode,
final int debugLevel)
{
final boolean batch_mode = clt_parameters.batch_run;
......@@ -5185,7 +5219,7 @@ public class TileProcessor {
// show testure_tiles
double [][][][] texture_tiles = scan_prev.getTextureTiles();
ImageDtt image_dtt = new ImageDtt(isMonochrome());
ImageDtt image_dtt = new ImageDtt(isMonochrome(), clt_parameters.getScaleStrength(is_aux));
double [][][] dispStrength = st.getDisparityStrengths(
clt_parameters.stMeasSel); // int stMeasSel) // = 1; // Select measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert)
......
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