Commit 65bac413 authored by Andrey Filippov's avatar Andrey Filippov

detecting periodic by a single camera

parent b5f3d42a
...@@ -2892,6 +2892,17 @@ public class EyesisCorrectionParameters { ...@@ -2892,6 +2892,17 @@ public class EyesisCorrectionParameters {
public double fds_abs_tilt = 2.0; // pix per tile public double fds_abs_tilt = 2.0; // pix per tile
public double fds_rel_tilt = 0.2; // (pix / disparity) per tile public double fds_rel_tilt = 0.2; // (pix / disparity) per tile
public boolean per_filter = true; // detect and filter periodic structures
public double per_trustedCorrelation = 2.0;
public double per_initial_diff = 0.8; // initial disparity difference to merge to maximum
public double per_strength_floor = 0.1; //
public double per_strength_max_over = 0.03; //
public double per_min_period = 4.0; //
public int per_min_num_periods = 3; // minimal number of periods
public double per_disp_tolerance = 1.0; // maximal difference between the average of fundamental and
public double per_disp_match = 1.0; // disparity difference to match neighbors
public double per_strong_match_inc = 0.02; // extra strength to treat match as strong (for hysteresis)
// Macro disparity scanning parameters // Macro disparity scanning parameters
public double mc_disp8_step = 2.0; // Macro disparity scan step (actual disparity step is 8x) public double mc_disp8_step = 2.0; // Macro disparity scan step (actual disparity step is 8x)
public double mc_disp8_trust = 2.0; //Trust measured disparity within +/- this value public double mc_disp8_trust = 2.0; //Trust measured disparity within +/- this value
...@@ -2909,9 +2920,6 @@ public class EyesisCorrectionParameters { ...@@ -2909,9 +2920,6 @@ public class EyesisCorrectionParameters {
public double mc_weight_Y = 1.0; // weight of average intensity public double mc_weight_Y = 1.0; // weight of average intensity
public double mc_weight_RBmG = 5.0; // weight of average color difference (0.5*(R+B)-G), shoukld be ~5*weight_Y public double mc_weight_RBmG = 5.0; // weight of average color difference (0.5*(R+B)-G), shoukld be ~5*weight_Y
// 0x1e, // 0x1f, // final int variants_mask, // 0x1e, // 0x1f, // final int variants_mask,
public int gr_min_new = 20; // Discard variant if it requests too few tiles public int gr_min_new = 20; // Discard variant if it requests too few tiles
public boolean gr_var_new_sngl = false;// Expand only unambiguous tiles over previously undefined public boolean gr_var_new_sngl = false;// Expand only unambiguous tiles over previously undefined
...@@ -3594,6 +3602,17 @@ public class EyesisCorrectionParameters { ...@@ -3594,6 +3602,17 @@ public class EyesisCorrectionParameters {
properties.setProperty(prefix+"fds_abs_tilt", this.fds_abs_tilt +""); properties.setProperty(prefix+"fds_abs_tilt", this.fds_abs_tilt +"");
properties.setProperty(prefix+"fds_rel_tilt", this.fds_rel_tilt +""); properties.setProperty(prefix+"fds_rel_tilt", this.fds_rel_tilt +"");
properties.setProperty(prefix+"per_filter", this.per_filter +"");
properties.setProperty(prefix+"per_trustedCorrelation", this.per_trustedCorrelation +"");
properties.setProperty(prefix+"per_initial_diff", this.per_initial_diff +"");
properties.setProperty(prefix+"per_strength_floor", this.per_strength_floor +"");
properties.setProperty(prefix+"per_strength_max_over", this.per_strength_max_over +"");
properties.setProperty(prefix+"per_min_period", this.per_min_period +"");
properties.setProperty(prefix+"per_min_num_periods", this.per_min_num_periods +"");
properties.setProperty(prefix+"per_disp_tolerance", this.per_disp_tolerance +"");
properties.setProperty(prefix+"per_disp_match", this.per_disp_match +"");
properties.setProperty(prefix+"per_strong_match_inc", this.per_strong_match_inc +"");
properties.setProperty(prefix+"mc_disp8_step", this.mc_disp8_step +""); properties.setProperty(prefix+"mc_disp8_step", this.mc_disp8_step +"");
properties.setProperty(prefix+"mc_disp8_trust", this.mc_disp8_trust +""); properties.setProperty(prefix+"mc_disp8_trust", this.mc_disp8_trust +"");
properties.setProperty(prefix+"mc_strength", this.mc_strength +""); properties.setProperty(prefix+"mc_strength", this.mc_strength +"");
...@@ -4282,6 +4301,18 @@ public class EyesisCorrectionParameters { ...@@ -4282,6 +4301,18 @@ public class EyesisCorrectionParameters {
if (properties.getProperty(prefix+"fds_abs_tilt")!=null) this.fds_abs_tilt=Double.parseDouble(properties.getProperty(prefix+"fds_abs_tilt")); if (properties.getProperty(prefix+"fds_abs_tilt")!=null) this.fds_abs_tilt=Double.parseDouble(properties.getProperty(prefix+"fds_abs_tilt"));
if (properties.getProperty(prefix+"fds_rel_tilt")!=null) this.fds_rel_tilt=Double.parseDouble(properties.getProperty(prefix+"fds_rel_tilt")); if (properties.getProperty(prefix+"fds_rel_tilt")!=null) this.fds_rel_tilt=Double.parseDouble(properties.getProperty(prefix+"fds_rel_tilt"));
if (properties.getProperty(prefix+"per_filter")!=null) this.per_filter=Boolean.parseBoolean(properties.getProperty(prefix+"per_filter"));
if (properties.getProperty(prefix+"per_trustedCorrelation")!=null) this.per_trustedCorrelation=Double.parseDouble(properties.getProperty(prefix+"per_trustedCorrelation"));
if (properties.getProperty(prefix+"per_initial_diff")!=null) this.per_initial_diff=Double.parseDouble(properties.getProperty(prefix+"per_initial_diff"));
if (properties.getProperty(prefix+"per_strength_floor")!=null) this.per_strength_floor=Double.parseDouble(properties.getProperty(prefix+"per_strength_floor"));
if (properties.getProperty(prefix+"per_strength_max_over")!=null) this.per_strength_max_over=Double.parseDouble(properties.getProperty(prefix+"per_strength_max_over"));
if (properties.getProperty(prefix+"per_min_period")!=null) this.per_min_period=Double.parseDouble(properties.getProperty(prefix+"per_min_period"));
if (properties.getProperty(prefix+"per_min_num_periods")!=null) this.per_min_num_periods=Integer.parseInt(properties.getProperty(prefix+"per_min_num_periods"));
if (properties.getProperty(prefix+"per_disp_tolerance")!=null) this.per_disp_tolerance=Double.parseDouble(properties.getProperty(prefix+"per_disp_tolerance"));
if (properties.getProperty(prefix+"per_disp_match")!=null) this.per_disp_match=Double.parseDouble(properties.getProperty(prefix+"per_disp_match"));
if (properties.getProperty(prefix+"per_strong_match_inc")!=null) this.per_strong_match_inc=Double.parseDouble(properties.getProperty(prefix+"per_strong_match_inc"));
if (properties.getProperty(prefix+"mc_disp8_step")!=null) this.mc_disp8_step=Double.parseDouble(properties.getProperty(prefix+"mc_disp8_step")); if (properties.getProperty(prefix+"mc_disp8_step")!=null) this.mc_disp8_step=Double.parseDouble(properties.getProperty(prefix+"mc_disp8_step"));
if (properties.getProperty(prefix+"mc_disp8_trust")!=null) this.mc_disp8_trust=Double.parseDouble(properties.getProperty(prefix+"mc_disp8_trust")); if (properties.getProperty(prefix+"mc_disp8_trust")!=null) this.mc_disp8_trust=Double.parseDouble(properties.getProperty(prefix+"mc_disp8_trust"));
if (properties.getProperty(prefix+"mc_strength")!=null) this.mc_strength=Double.parseDouble(properties.getProperty(prefix+"mc_strength")); if (properties.getProperty(prefix+"mc_strength")!=null) this.mc_strength=Double.parseDouble(properties.getProperty(prefix+"mc_strength"));
...@@ -5055,6 +5086,29 @@ public class EyesisCorrectionParameters { ...@@ -5055,6 +5086,29 @@ public class EyesisCorrectionParameters {
gd.addNumericField("Maximal growing plate tilt in disparity pix per tile", this.fds_abs_tilt, 6); gd.addNumericField("Maximal growing plate tilt in disparity pix per tile", this.fds_abs_tilt, 6);
gd.addNumericField("Maximal relative growing plate tilt in disparity pix per tile per disparity pixel", this.fds_rel_tilt, 6); gd.addNumericField("Maximal relative growing plate tilt in disparity pix per tile per disparity pixel", this.fds_rel_tilt, 6);
gd.addTab ("Periodic", "Detect and filter periodic features");
gd.addCheckbox ("Apply filter to remove false correlations of periodic structures", this.per_filter,
"Detect repetitive features (such as windows grid) and remove false matches");
gd.addNumericField("Maximal residual disparity difference to use for periodic features", this.per_trustedCorrelation, 4, 6,"pix",
"do not trust correlation results with larger absolute value of residual disparity");
gd.addNumericField("Initial half-width of the disparity range per cluster", this.per_initial_diff, 4, 6,"pix",
"Select tiles this far from the local maximums");
gd.addNumericField("Strength floor to detect periodic features", this.per_strength_floor, 4, 6,"",
"Only use stronger correlations, subtract this value for weighted averages");
gd.addNumericField("Maximums seeds should have at least this much over strength floor", this.per_strength_max_over, 4, 6,"",
"When growing clusters, only start with the correlations this much stronger than strength floor ");
gd.addNumericField("Minimal feature period", this.per_min_period, 4, 6,"",
"Only detect/filter feature that have period above this value");
gd.addNumericField("Minimal number of periods in periodic structures", this.per_min_num_periods, 0, 2,"",
"Minimal number of full periods to be detected");
gd.addNumericField("Maximal period variations", this.per_disp_tolerance, 4, 6,"pix",
"The detected periods should be higher than this value");
gd.addNumericField("Disparity difference to match neighbors", this.per_disp_match, 0, 2,"",
"Neighbor tiles should have smaller disparity difference from gthe center to qualify");
gd.addNumericField("Extra strength to treat match as strong (for hysteresis)", this.per_strong_match_inc, 0, 2,"",
"The layer that does not have any match in the direction where some other layer has a strong match will be removed");
gd.addTab ("Macro", "Macro tiles correlation parameters"); gd.addTab ("Macro", "Macro tiles correlation parameters");
gd.addMessage ("--- Macro correlation parameters ---"); gd.addMessage ("--- Macro correlation parameters ---");
gd.addNumericField("Macro disparity scan step (actual disparity step is 8x)", this.mc_disp8_step, 6); gd.addNumericField("Macro disparity scan step (actual disparity step is 8x)", this.mc_disp8_step, 6);
...@@ -5771,6 +5825,17 @@ public class EyesisCorrectionParameters { ...@@ -5771,6 +5825,17 @@ public class EyesisCorrectionParameters {
this.fds_abs_tilt= gd.getNextNumber(); this.fds_abs_tilt= gd.getNextNumber();
this.fds_rel_tilt= gd.getNextNumber(); this.fds_rel_tilt= gd.getNextNumber();
this.per_filter= gd.getNextBoolean();
this.per_trustedCorrelation= gd.getNextNumber();
this.per_initial_diff= gd.getNextNumber();
this.per_strength_floor= gd.getNextNumber();
this.per_strength_max_over= gd.getNextNumber();
this.per_min_period= gd.getNextNumber();
this.per_min_num_periods=(int) gd.getNextNumber();
this.per_disp_tolerance= gd.getNextNumber();
this.per_disp_match= gd.getNextNumber();
this.per_strong_match_inc= gd.getNextNumber();
this.mc_disp8_step= gd.getNextNumber(); this.mc_disp8_step= gd.getNextNumber();
this.mc_disp8_trust= gd.getNextNumber(); this.mc_disp8_trust= gd.getNextNumber();
this.mc_strength= gd.getNextNumber(); this.mc_strength= gd.getNextNumber();
......
...@@ -571,6 +571,7 @@ private Panel panel1, ...@@ -571,6 +571,7 @@ private Panel panel1,
addButton("CM Test", panelClt3, color_stop); addButton("CM Test", panelClt3, color_stop);
addButton("Show scan", panelClt3, color_configure); addButton("Show scan", panelClt3, color_configure);
addButton("Show all scans", panelClt3, color_configure); addButton("Show all scans", panelClt3, color_configure);
addButton("Periodic", panelClt3, color_configure);
add(panelClt3); add(panelClt3);
} }
...@@ -4373,6 +4374,23 @@ private Panel panel1, ...@@ -4373,6 +4374,23 @@ private Panel panel1,
UPDATE_STATUS, //final boolean updateStatus, UPDATE_STATUS, //final boolean updateStatus,
DEBUG_LEVEL); //final int debugLevel); DEBUG_LEVEL); //final int debugLevel);
return; return;
} else if (label.equals("Periodic")) {
DEBUG_LEVEL=MASTER_DEBUG_LEVEL;
EYESIS_CORRECTIONS.setDebug(DEBUG_LEVEL);
if (QUAD_CLT == null){
System.out.println("QUAD_CLT is null, nothing to show");
return;
}
QUAD_CLT.showPeriodic(
CLT_PARAMETERS, // EyesisCorrectionParameters.DCTParameters dct_parameters,
THREADS_MAX, //final int threadsMax, // maximal number of threads to launch
UPDATE_STATUS, //final boolean updateStatus,
DEBUG_LEVEL); //final int debugLevel);
return;
} else if (label.equals("CLT ASSIGN")) { } else if (label.equals("CLT ASSIGN")) {
DEBUG_LEVEL=MASTER_DEBUG_LEVEL; DEBUG_LEVEL=MASTER_DEBUG_LEVEL;
EYESIS_CORRECTIONS.setDebug(DEBUG_LEVEL); EYESIS_CORRECTIONS.setDebug(DEBUG_LEVEL);
......
...@@ -83,6 +83,11 @@ public class GeometryCorrection { ...@@ -83,6 +83,11 @@ public class GeometryCorrection {
public CorrVector extrinsic_corr; public CorrVector extrinsic_corr;
public RigOffset rigOffset = null; public RigOffset rigOffset = null;
int [] woi_tops; // used to calculate scanline timing
public int [] getWOITops() {
return woi_tops;
}
public int [] getSensorWH() { public int [] getSensorWH() {
......
...@@ -7589,7 +7589,7 @@ public class ImageDtt { ...@@ -7589,7 +7589,7 @@ public class ImageDtt {
final double [][][][][][] clt_kernels_aux, // [channel_in_quad][color][tileY][tileX][band][pixel] , size should match image (have 1 tile around) final double [][][][][][] clt_kernels_aux, // [channel_in_quad][color][tileY][tileX][band][pixel] , size should match image (have 1 tile around)
final double corr_magic_scale, // still not understood coefficient that reduces reported disparity value. Seems to be around 0.85 final double corr_magic_scale, // still not understood coefficient that reduces reported disparity value. Seems to be around 0.85
final boolean keep_clt_data, final boolean keep_clt_data,
final int [][] woi_tops, // final int [][] woi_tops,
final double [][][] ers_delay, // if not null - fill with tile center acquisition delay final double [][][] ers_delay, // if not null - fill with tile center acquisition delay
final int threadsMax, // maximal number of threads to launch final int threadsMax, // maximal number of threads to launch
final int debugLevel) final int debugLevel)
...@@ -7828,8 +7828,8 @@ public class ImageDtt { ...@@ -7828,8 +7828,8 @@ public class ImageDtt {
disparity_aux); // + disparity_corr); disparity_aux); // + disparity_corr);
// acquisition time of the tiles centers in scanline times // acquisition time of the tiles centers in scanline times
if (ers_delay != null) { if (ers_delay != null) {
for (int i = 0; i < quad_main; i++) ers_delay[0][i][nTile] = centersXY_main[i][1]-woi_tops[0][i]; for (int i = 0; i < quad_main; i++) ers_delay[0][i][nTile] = centersXY_main[i][1]-geometryCorrection_main.woi_tops[i];
for (int i = 0; i < quad_aux; i++) ers_delay[1][i][nTile] = centersXY_aux[i][1]- woi_tops[1][i]; for (int i = 0; i < quad_aux; i++) ers_delay[1][i][nTile] = centersXY_aux[i][1]- geometryCorrection_aux.woi_tops[i];
} }
if ((globalDebugLevel > 0) && (tileX == debug_tileX) && (tileY == debug_tileY)) { if ((globalDebugLevel > 0) && (tileX == debug_tileX) && (tileY == debug_tileY)) {
......
...@@ -80,7 +80,7 @@ public class QuadCLT { ...@@ -80,7 +80,7 @@ public class QuadCLT {
double [][][] image_data = null; double [][][] image_data = null;
boolean [][] saturation_imp = null; // (near) saturated pixels or null boolean [][] saturation_imp = null; // (near) saturated pixels or null
boolean is_aux = false; boolean is_aux = false;
int [] woi_tops; // used to calculate scanline timing // int [] woi_tops; // used to calculate scanline timing
// magic scale should be set before using TileProcessor (calculated disparities depend on it) // magic scale should be set before using TileProcessor (calculated disparities depend on it)
...@@ -2672,7 +2672,7 @@ public class QuadCLT { ...@@ -2672,7 +2672,7 @@ public class QuadCLT {
} }
ImagePlus [] imp_srcs = new ImagePlus[channelFiles.length]; ImagePlus [] imp_srcs = new ImagePlus[channelFiles.length];
this.woi_tops = new int [channelFiles.length]; this.geometryCorrection.woi_tops = new int [channelFiles.length];
double [] scaleExposures = new double[channelFiles.length]; double [] scaleExposures = new double[channelFiles.length];
for (int srcChannel=0; srcChannel<channelFiles.length; srcChannel++){ for (int srcChannel=0; srcChannel<channelFiles.length; srcChannel++){
int nFile=channelFiles[srcChannel]; int nFile=channelFiles[srcChannel];
...@@ -2707,7 +2707,7 @@ public class QuadCLT { ...@@ -2707,7 +2707,7 @@ public class QuadCLT {
imp_srcs[srcChannel], // ImagePlus imp_src, imp_srcs[srcChannel], // ImagePlus imp_src,
eyesisCorrections.pixelMapping.sensors[srcChannel].getSensorWH(), eyesisCorrections.pixelMapping.sensors[srcChannel].getSensorWH(),
true); // boolean replicate); true); // boolean replicate);
woi_tops[srcChannel] = Integer.parseInt((String) imp_srcs[srcChannel].getProperty("WOI_TOP")); this.geometryCorrection.woi_tops[srcChannel] = Integer.parseInt((String) imp_srcs[srcChannel].getProperty("WOI_TOP"));
scaleExposures[srcChannel] = 1.0; scaleExposures[srcChannel] = 1.0;
if (!Double.isNaN(referenceExposures[nFile]) && (imp_srcs[srcChannel].getProperty("EXPOSURE")!=null)){ if (!Double.isNaN(referenceExposures[nFile]) && (imp_srcs[srcChannel].getProperty("EXPOSURE")!=null)){
scaleExposures[srcChannel] = referenceExposures[nFile]/Double.parseDouble((String) imp_srcs[srcChannel].getProperty("EXPOSURE")); scaleExposures[srcChannel] = referenceExposures[nFile]/Double.parseDouble((String) imp_srcs[srcChannel].getProperty("EXPOSURE"));
...@@ -3367,7 +3367,7 @@ public class QuadCLT { ...@@ -3367,7 +3367,7 @@ public class QuadCLT {
int debugLevel) int debugLevel)
{ {
ImagePlus [] imp_srcs = new ImagePlus[channelFiles.length]; ImagePlus [] imp_srcs = new ImagePlus[channelFiles.length];
this.woi_tops = new int [channelFiles.length]; this.geometryCorrection.woi_tops = new int [channelFiles.length];
// double [] scaleExposures = new double[channelFiles.length]; // // double [] scaleExposures = new double[channelFiles.length]; //
double [][] dbg_dpixels = new double [channelFiles.length][]; double [][] dbg_dpixels = new double [channelFiles.length][];
// int [] fullWindowWH = geometryCorrection.getSensorWH(); // int [] fullWindowWH = geometryCorrection.getSensorWH();
...@@ -3404,7 +3404,7 @@ public class QuadCLT { ...@@ -3404,7 +3404,7 @@ public class QuadCLT {
} }
// imp_srcs[srcChannel].show(); // REMOVE ME! // imp_srcs[srcChannel].show(); // REMOVE ME!
woi_tops[srcChannel] = Integer.parseInt((String) imp_srcs[srcChannel].getProperty("WOI_TOP")); this.geometryCorrection.woi_tops[srcChannel] = Integer.parseInt((String) imp_srcs[srcChannel].getProperty("WOI_TOP"));
imp_srcs[srcChannel] = padBayerToFullSize( imp_srcs[srcChannel] = padBayerToFullSize(
imp_srcs[srcChannel], // ImagePlus imp_src, imp_srcs[srcChannel], // ImagePlus imp_src,
eyesisCorrections.pixelMapping.sensors[srcChannel].getSensorWH(), eyesisCorrections.pixelMapping.sensors[srcChannel].getSensorWH(),
...@@ -4869,7 +4869,7 @@ public class QuadCLT { ...@@ -4869,7 +4869,7 @@ public class QuadCLT {
} }
ImagePlus [] imp_srcs = new ImagePlus[channelFiles.length]; ImagePlus [] imp_srcs = new ImagePlus[channelFiles.length];
this.woi_tops = new int [channelFiles.length]; this.geometryCorrection.woi_tops = new int [channelFiles.length];
boolean [][] saturation_imp = (clt_parameters.sat_level > 0.0)? new boolean[channelFiles.length][] : null; boolean [][] saturation_imp = (clt_parameters.sat_level > 0.0)? new boolean[channelFiles.length][] : null;
double [] scaleExposures = new double[channelFiles.length]; double [] scaleExposures = new double[channelFiles.length];
for (int srcChannel=0; srcChannel<channelFiles.length; srcChannel++){ for (int srcChannel=0; srcChannel<channelFiles.length; srcChannel++){
...@@ -4905,7 +4905,7 @@ public class QuadCLT { ...@@ -4905,7 +4905,7 @@ public class QuadCLT {
imp_srcs[srcChannel], // ImagePlus imp_src, imp_srcs[srcChannel], // ImagePlus imp_src,
eyesisCorrections.pixelMapping.sensors[srcChannel].getSensorWH(), eyesisCorrections.pixelMapping.sensors[srcChannel].getSensorWH(),
true); // boolean replicate); true); // boolean replicate);
woi_tops[srcChannel] = Integer.parseInt((String) imp_srcs[srcChannel].getProperty("WOI_TOP")); this.geometryCorrection.woi_tops[srcChannel] = Integer.parseInt((String) imp_srcs[srcChannel].getProperty("WOI_TOP"));
scaleExposures[srcChannel] = 1.0; scaleExposures[srcChannel] = 1.0;
if (!Double.isNaN(referenceExposures[nFile]) && (imp_srcs[srcChannel].getProperty("EXPOSURE")!=null)){ if (!Double.isNaN(referenceExposures[nFile]) && (imp_srcs[srcChannel].getProperty("EXPOSURE")!=null)){
scaleExposures[srcChannel] = referenceExposures[nFile]/Double.parseDouble((String) imp_srcs[srcChannel].getProperty("EXPOSURE")); scaleExposures[srcChannel] = referenceExposures[nFile]/Double.parseDouble((String) imp_srcs[srcChannel].getProperty("EXPOSURE"));
...@@ -7440,6 +7440,50 @@ public class QuadCLT { ...@@ -7440,6 +7440,50 @@ public class QuadCLT {
"after_combo_pass-"+(passes.size() -1)); // (refine_pass)); //String title) "after_combo_pass-"+(passes.size() -1)); // (refine_pass)); //String title)
return num_extended; // [0]; return num_extended; // [0];
} }
// Separate method to detect and remove periodic structures
public boolean showPeriodic(
EyesisCorrectionParameters.CLTParameters clt_parameters,
final int threadsMax, // maximal number of threads to launch
final boolean updateStatus,
final int debugLevel) {
final boolean usePoly = false; // use polynomial method to find max), valid if useCombo == false
double [][] periodics = tp.getPeriodics(
tp.clt_3d_passes, // final ArrayList <CLTPass3d> passes,// List, first, last - to search for the already tried disparity
0, // final int firstPass,
tp.clt_3d_passes.size(), // final int lastPassPlus1,
clt_parameters.per_trustedCorrelation,// final double trustedCorrelation,
clt_parameters.per_initial_diff, // final double initial_diff, // initial disparity difference to merge to maximum
clt_parameters.per_strength_floor, // final double strength_floor,
clt_parameters.per_strength_max_over, // final double strength_max_over, // maximum should have strength by this more than the floor
clt_parameters.per_min_period, // final double min_period,
clt_parameters.per_min_num_periods, // final int min_num_periods, // minimal number of periods
clt_parameters.per_disp_tolerance, // final double disp_tolerance, // maximal difference between the average of fundamental and 2-nd and first
// TODO: replace next parameter
clt_parameters.per_disp_tolerance, // final double disp_tol_center, // tolerance to match this (center) tile ds to that of the merged with neighbors - should be < min_period/2
clt_parameters.per_disp_match, // final double disp_match, // disparity difference to match neighbors
clt_parameters.per_strong_match_inc, // final double strong_match_inc, // extra strength to treat match as strong (for hysteresis)
usePoly, // final boolean usePoly, // use polynomial method to find max), valid if useCombo == false
clt_parameters.tileX, // final int dbg_tileX,
clt_parameters.tileY, // final int dbg_tileY,
threadsMax, // final int threadsMax, // maximal number of threads to launch
updateStatus, // final boolean updateStatus,
debugLevel+3); // final int debugLevel) // update status info
String [] dbg_titles= {"fundamental","period", "strength", "num_layers"};
(new showDoubleFloatArrays()).showArrays(
periodics,
tp.getTilesX(),
periodics[0].length/tp.getTilesX(),
true,
image_name+"-PERIODIC",
dbg_titles);
return true;
}
//***************************************************************** //*****************************************************************
...@@ -8714,7 +8758,7 @@ public class QuadCLT { ...@@ -8714,7 +8758,7 @@ public class QuadCLT {
} }
ImagePlus [] imp_srcs = new ImagePlus[channelFiles.length]; ImagePlus [] imp_srcs = new ImagePlus[channelFiles.length];
this.woi_tops = new int [channelFiles.length]; this.geometryCorrection.woi_tops = new int [channelFiles.length];
double [][] dbg_dpixels = batch_mode? null : (new double [channelFiles.length][]); double [][] dbg_dpixels = batch_mode? null : (new double [channelFiles.length][]);
for (int srcChannel=0; srcChannel<channelFiles.length; srcChannel++){ for (int srcChannel=0; srcChannel<channelFiles.length; srcChannel++){
...@@ -8750,7 +8794,7 @@ public class QuadCLT { ...@@ -8750,7 +8794,7 @@ public class QuadCLT {
imp_srcs[srcChannel], // ImagePlus imp_src, imp_srcs[srcChannel], // ImagePlus imp_src,
eyesisCorrections.pixelMapping.sensors[srcChannel].getSensorWH(), eyesisCorrections.pixelMapping.sensors[srcChannel].getSensorWH(),
true); // boolean replicate); true); // boolean replicate);
woi_tops[srcChannel] = Integer.parseInt((String) imp_srcs[srcChannel].getProperty("WOI_TOP")); this.geometryCorrection.woi_tops[srcChannel] = Integer.parseInt((String) imp_srcs[srcChannel].getProperty("WOI_TOP"));
scaleExposures[srcChannel] = 1.0; scaleExposures[srcChannel] = 1.0;
if (!Double.isNaN(referenceExposures[nFile]) && (imp_srcs[srcChannel].getProperty("EXPOSURE")!=null)){ if (!Double.isNaN(referenceExposures[nFile]) && (imp_srcs[srcChannel].getProperty("EXPOSURE")!=null)){
scaleExposures[srcChannel] = referenceExposures[nFile]/Double.parseDouble((String) imp_srcs[srcChannel].getProperty("EXPOSURE")); scaleExposures[srcChannel] = referenceExposures[nFile]/Double.parseDouble((String) imp_srcs[srcChannel].getProperty("EXPOSURE"));
......
...@@ -25,10 +25,11 @@ ...@@ -25,10 +25,11 @@
import java.awt.Rectangle; import java.awt.Rectangle;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
//import java.util.concurrent.atomic.AtomicInteger; //import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
public class TileProcessor { public class TileProcessor {
public static String [] SCAN_TITLES = { public static String [] SCAN_TITLES = {
"tile_op", // 0 "tile_op", // 0
...@@ -446,6 +447,8 @@ public class TileProcessor { ...@@ -446,6 +447,8 @@ public class TileProcessor {
} }
} }
public void filterOverBackground( public void filterOverBackground(
final double [][] ds, final double [][] ds,
final double [] bg_strength, final double [] bg_strength,
...@@ -461,6 +464,422 @@ public class TileProcessor { ...@@ -461,6 +464,422 @@ public class TileProcessor {
} }
} }
public double [][] getPeriodics(
final ArrayList <CLTPass3d> passes,
final int firstPass,
final int lastPassPlus1,
final double trustedCorrelation,
final double initial_diff, // initial disparity difference to merge to maximum
final double strength_floor,
final double strength_max_over, // maximum should have strength by this more than the floor
final double min_period,
final int min_num_periods, // minimal number of periods
final double disp_tolerance, // maximal difference between the average of fundamental and 2-nd and first
final double disp_tol_center, // tolerance to match this (center) tile ds to that of the merged with neighbors - should be < min_period/2
final double disp_match, // disparity difference to match neighbors
final double strong_match_inc, // extra strength to treat match as strong (for hysteresis)
final boolean usePoly, // use polynomial method to find max), valid if useCombo == false
final int dbg_tileX,
final int dbg_tileY,
final int threadsMax, // maximal number of threads to launch
final boolean updateStatus,
final int debugLevel) // update status info
{
final int tilesX = getTilesX();
final int tilesY = getTilesY();
final int dbg_tile = (debugLevel>0) ? (dbg_tileX + tilesX * (dbg_tileY)): -1;
final int numTiles = tilesX*tilesY;
final TileNeibs tnImage = new TileNeibs(tilesX,tilesY);
final double [][] fund_per = new double[4][numTiles];
final double [][][] layers = new double [numTiles][][];
final double [][][] layers_initial = new double [numTiles][][];
final Thread[] threads = ImageDtt.newThreadArray(threadsMax);
final double [] dir_weights = {0.5, 0.25, 0.5, 0.25, 0.5, 0.25, 0.5, 0.25,1.0};
final AtomicInteger ai = new AtomicInteger(0);
final double strong_match = strength_max_over+ strong_match_inc; // strength_max_over - minimal strength in layers[][1][]
final class DS {
int num_sampes = 0;
boolean not_max = false;
double disparity;
double strength;
double max_strength;
DS(double disparity, double strength){
this.disparity = disparity;
this.strength = strength;
this.max_strength = strength;
this.num_sampes ++;
}
void mergeDS(DS other){
this.disparity = this.disparity*this.strength + other.disparity * other.strength;
this.strength += other.strength;
this.disparity /= this.strength;
this.max_strength = Math.max(this.max_strength, other.strength);
this.num_sampes ++;
}
@Override
protected DS clone()
{
DS ds = new DS(this.disparity,this.strength);
ds.max_strength = this.max_strength;
ds.num_sampes = this.num_sampes;
return ds;
}
@Override
public String toString() {
return String.format("d=%8.4f, s=%8.6f (%8.6f), N=%d %s", disparity, getAvgStrength(), getMaxStrength(), num_sampes, not_max? "NOT max":"");
}
double getAvgStrength() {
return strength/num_sampes;
}
double getMaxStrength() {
return max_strength;
}
}
final int disparity_index = usePoly ? ImageDtt.DISPARITY_INDEX_POLY : ImageDtt.DISPARITY_INDEX_CM;
for (int ithread = 0; ithread < threads.length; ithread++) {
threads[ithread] = new Thread() {
@Override
public void run() {
for (int nTile = ai.getAndIncrement(); nTile < numTiles; nTile = ai.getAndIncrement()) {
int tileX = nTile % tilesX;
int tileY = nTile / tilesX;
boolean dt = nTile == dbg_tile;
if (dt) {
System.out.println("getPeriodics(): nTile="+nTile);
System.out.println();
}
ArrayList <DS> ds_list = new ArrayList<DS>(); // this and neighbors tiles
ArrayList <DS> ds_center_list = new ArrayList<DS>(); // only this tile DS
for (int ipass = firstPass; ipass <lastPassPlus1; ipass++ ){
CLTPass3d pass = passes.get(ipass);
if ( pass.isMeasured()) {
for (int dir = 0; dir < 9; dir++) {
int nTile1 = tnImage.getNeibIndex(nTile, dir);
if (nTile1 >= 0) {
double disp = pass.disparity_map[disparity_index][nTile1]/corr_magic_scale + pass.disparity[tileY][tileX];
double w = pass.disparity_map[ImageDtt.DISPARITY_STRENGTH_INDEX][nTile1] - strength_floor;
if ( (w > 0.0) &&
(Math.abs(pass.disparity_map[disparity_index][nTile1]) <= trustedCorrelation)){
ds_list.add(new DS(
disp,
(pass.disparity_map[ImageDtt.DISPARITY_STRENGTH_INDEX][nTile1] - strength_floor)*dir_weights[dir]));
if (dir == 8) {
// have to be separate (cloned) instances
ds_center_list.add(new DS(
disp,
(pass.disparity_map[ImageDtt.DISPARITY_STRENGTH_INDEX][nTile1] - strength_floor)*dir_weights[dir]));
}
}
}
}
}
}
if (!ds_list.isEmpty()) {
Collections.sort(ds_list, new Comparator<DS>() {
@Override
public int compare(DS lhs, DS rhs) {
// -1 - less than, 1 - greater than, 0 - equal, not inverted for ascending disparity
// return lhs.disparity > rhs.disparity ? -1 : (lhs.disparity < rhs.disparity ) ? 1 : 0;
return lhs.disparity < rhs.disparity ? -1 : (lhs.disparity > rhs.disparity ) ? 1 : 0;
}
});
if (dt) {
for (DS ds:ds_list) {
System.out.println(ds.toString());
}
}
ArrayList <DS> merged_list = new ArrayList<DS>();
while (!ds_list.isEmpty()){
// find max strength
int strongest = -1;
for (int i = 1; i < ds_list.size(); i++) {
double w = ds_list.get(i).strength;
if (w >= strength_max_over ) {
if ((strongest < 0) || (ds_list.get(i).strength > ds_list.get(strongest).strength)) {
if (!ds_list.get(i).not_max) {
strongest = i;
}
}
}
}
if (strongest < 0) {
break; // none of the remaining DS can be a new cluster seed - all are too close to previous
}
DS sds = ds_list.remove(strongest);
merged_list.add(sds);
// scan other elements, join or mark as not max
int indx = 0;
for (; indx < ds_list.size(); indx++) {
double disp = ds_list.get(indx).disparity;
if (disp > (sds.disparity - min_period)) {
ds_list.get(indx).not_max = true;
}
if (disp >= (sds.disparity - initial_diff)) {
break;
}
}
// pointing to the first to merge
for (; indx < ds_list.size(); indx++) {
if (ds_list.get(indx).disparity <= (sds.disparity + initial_diff)) {
sds.mergeDS(ds_list.remove(indx));
indx --;
} else { // disparity is too high to be merged
break;
}
}
for (; indx < ds_list.size(); indx++) {
if (ds_list.get(indx).disparity < (sds.disparity + min_period)) {
ds_list.get(indx).not_max = true;
} else {
break;
}
}
}
// merge ds_center_list elements hinted by merged_list;
DS[] center_ds = new DS[merged_list.size()];
for (DS ds: ds_center_list) {
for (int i = 0; i < merged_list.size();i++) {
if (Math.abs(ds.disparity - merged_list.get(i).disparity) <= disp_tolerance) {
if (center_ds[i] == null) {
center_ds[i] = ds; // .clone();
} else {
center_ds[i].mergeDS(ds);
}
break;
}
}
}
ds_center_list = new ArrayList<DS>();
for (DS ds: center_ds) {
if (ds != null) ds_center_list.add(ds);
}
if (ds_center_list.size() > 0) {
Collections.sort(ds_center_list, new Comparator<DS>() {
@Override
public int compare(DS lhs, DS rhs) {
// -1 - less than, 1 - greater than, 0 - equal, not inverted for ascending disparity
// return lhs.disparity > rhs.disparity ? -1 : (lhs.disparity < rhs.disparity ) ? 1 : 0;
return lhs.disparity < rhs.disparity ? -1 : (lhs.disparity > rhs.disparity ) ? 1 : 0;
}
});
if (dt) {
System.out.println("\n\nds_center_list (ordered by disparity)");
for (DS ds:ds_center_list) {
System.out.println(ds.toString());
}
}
layers[nTile] = new double[ds_center_list.size()][2];
layers_initial[nTile] = new double[ds_center_list.size()][2];
for (int n = 0; n< ds_center_list.size(); n++) {
layers[nTile][n][0] = ds_center_list.get(n).disparity;
layers[nTile][n][1] = ds_center_list.get(n).getMaxStrength();
layers_initial[nTile][n] = layers[nTile][n].clone();
}
if (dt) {
System.out.println("\n\nmerged_list (strongest first)");
for (DS ds:merged_list) {
System.out.println(ds.toString());
}
System.out.println("\n\nremaining ds_list");
for (DS ds:ds_list) {
System.out.println(ds.toString());
}
}
// now merged_list contains cluster centers
/*
if (merged_list.size() > 0) {
Collections.sort(merged_list, new Comparator<DS>() {
@Override
public int compare(DS lhs, DS rhs) {
// -1 - less than, 1 - greater than, 0 - equal, not inverted for ascending disparity
// return lhs.disparity > rhs.disparity ? -1 : (lhs.disparity < rhs.disparity ) ? 1 : 0;
return lhs.disparity < rhs.disparity ? -1 : (lhs.disparity > rhs.disparity ) ? 1 : 0;
}
});
if (dt) {
System.out.println("\n\nmerged_list (ordered by disparity)");
for (DS ds:merged_list) {
System.out.println(ds.toString());
}
}
layers[nTile] = new double[merged_list.size()][2];
layers_initial[nTile] = new double[merged_list.size()][2];
for (int n = 0; n< merged_list.size(); n++) {
layers[nTile][n][0] = merged_list.get(n).disparity;
layers[nTile][n][1] = merged_list.get(n).getMaxStrength();
layers_initial[nTile][n] = layers[nTile][n].clone();
}
}
*/
if (merged_list.size() > min_num_periods) {
Collections.sort(merged_list, new Comparator<DS>() {
@Override
public int compare(DS lhs, DS rhs) {
// -1 - less than, 1 - greater than, 0 - equal, not inverted for ascending disparity
// return lhs.disparity > rhs.disparity ? -1 : (lhs.disparity < rhs.disparity ) ? 1 : 0;
return lhs.disparity < rhs.disparity ? -1 : (lhs.disparity > rhs.disparity ) ? 1 : 0;
}
});
if (dt) {
System.out.println("\n\nmerged_list (ordered by disparity)");
for (DS ds:merged_list) {
System.out.println(ds.toString());
}
}
double period = (merged_list.get(min_num_periods).disparity - merged_list.get(0).disparity)/min_num_periods;
boolean periods_match = true;
for (int i = 1; i < min_num_periods; i++) {
if (Math.abs(merged_list.get(0).disparity + i*period - merged_list.get(i).disparity ) > disp_tolerance) {
periods_match = false;
break;
}
}
if (periods_match) {
fund_per[0][nTile] = merged_list.get(0).disparity;
fund_per[1][nTile] = 0.5*(merged_list.get(2).disparity - merged_list.get(0).disparity);
fund_per[2][nTile] = 0;
for (int i = 0; i <= min_num_periods; i++) {
fund_per[2][nTile] += merged_list.get(i).getMaxStrength();
}
fund_per[2][nTile] /= min_num_periods+1;
fund_per[3][nTile] =ds_center_list.size();
}
// remove later
} else if (merged_list.size() == 1) { // unambiguous - mark with period == 0
fund_per[0][nTile] = merged_list.get(0).disparity;
fund_per[1][nTile] = 0.0;
fund_per[2][nTile] = merged_list.get(0).getMaxStrength();
}
}
}
}
}
};
}
ImageDtt.startAndJoin(threads);
for (int nPass = 0; nPass < 1000; nPass++) {
ai.set(0);
final AtomicInteger mods_ai = new AtomicInteger(0);
final double [][][] new_layers = new double [numTiles][][];
for (int ithread = 0; ithread < threads.length; ithread++) {
threads[ithread] = new Thread() {
@Override
public void run() {
for (int nTile = ai.getAndIncrement(); nTile < numTiles; nTile = ai.getAndIncrement()) { // periodic
new_layers[nTile] = layers[nTile]; // shallow copy
if ((fund_per[1][nTile] > 0.0) &&(layers[nTile] != null)){
int tileX = nTile % tilesX;
int tileY = nTile / tilesX;
boolean dt = nTile == dbg_tile;
if (dt) {
System.out.println("getPeriodics2(): nTile="+nTile+" tileX="+tileX+", tileY="+tileY);
System.out.println();
}
// find directions where at least one layer has a strong match (so those that do not have even weak should be eliminated)
boolean [] dir_strong = new boolean[8];
for (int nLayer = 0; nLayer < layers[nTile].length; nLayer++) {
double disp = layers[nTile][nLayer][0];
for (int dir = 0; dir < 8; dir++) if (!dir_strong[dir]){
int nTile1 = tnImage.getNeibIndex(nTile, dir);
if ((nTile1 >= 0) && (layers[nTile1] != null)){
for (int nl1 = 0; nl1 < layers[nTile1].length; nl1++) {
if ((Math.abs(disp - layers[nTile1][nl1][0]) <= disp_match) && (layers[nTile1][nl1][1] > strong_match)) {
dir_strong[dir] = true;
break;
}
}
}
}
}
boolean [] no_dir_match = new boolean [layers[nTile].length];
for (int nLayer = 0; nLayer < layers[nTile].length; nLayer++) {
double disp = layers[nTile][nLayer][0];
for (int dir = 0; dir < 8; dir++) if (dir_strong[dir]){ // only directions that have some strong matches
int nTile1 = tnImage.getNeibIndex(nTile, dir);
boolean has_match = false;
if ((nTile1 >= 0) && (layers[nTile1] != null)){
for (int nl1 = 0; nl1 < layers[nTile1].length; nl1++) {
if (Math.abs(disp - layers[nTile1][nl1][0]) <= disp_match) { // any strength
has_match = true;
break;
}
}
}
if (!has_match) {
no_dir_match[nLayer] = true; // no matches for this direction,
break;
}
}
}
int num_remove = 0;
for (int i = 0; i < no_dir_match.length; i++) {
if (no_dir_match[i]) {
num_remove++;
}
}
if (num_remove > 0) {
new_layers[nTile] = new double [layers[nTile].length - num_remove][];
int indx = 0;
for (int i = 0; i < layers[nTile].length; i++) if (!no_dir_match[i]) {
new_layers[nTile][indx++] = layers[nTile][i];
mods_ai.getAndIncrement();
}
// update fund_per[3][nTile] = merged_list.size();
// todo: remove later
fund_per[3][nTile] = new_layers[nTile].length; // number of layers
if (new_layers[nTile].length > 0) {
fund_per[0][nTile] = new_layers[nTile][0][0]; // lowest disparity (keep period)
fund_per[2][nTile] = new_layers[nTile][0][1]; // strength
} else {
fund_per[0][nTile] = 0;
fund_per[1][nTile] = 0;
fund_per[2][nTile] = 0;
}
}
}
}
}
};
}
ImageDtt.startAndJoin(threads);
System.arraycopy(new_layers, 0, layers, 0, numTiles);
if (debugLevel > 0) {
System.out.println("Filtering periodics: pass="+nPass+", removed "+mods_ai.get() );
String [] dbg_titles= {"fundamental","period", "strength", "num_layers"};
(new showDoubleFloatArrays()).showArrays(
fund_per,
getTilesX(),
fund_per[0].length/getTilesX(),
true,
"PERIODIC-"+nPass,
dbg_titles);
}
if (mods_ai.get() == 0) {
break;
}
}
return fund_per;
}
/** /**
* Calculates calc_disparity, calc_disparity_hor, calc_disparity_vert, strength, strength_hor, strength_vert, * Calculates calc_disparity, calc_disparity_hor, calc_disparity_vert, strength, strength_hor, strength_vert,
* max_tried_disparity from the subset of a list of measurement passes (skipping non-measured) * max_tried_disparity from the subset of a list of measurement passes (skipping non-measured)
......
...@@ -406,7 +406,7 @@ public class TwoQuadCLT { ...@@ -406,7 +406,7 @@ public class TwoQuadCLT {
ImageDtt image_dtt = new ImageDtt(); ImageDtt image_dtt = new ImageDtt();
double [][] ml_data = null; double [][] ml_data = null;
int [][] woi_tops = {quadCLT_main.woi_tops,quadCLT_aux.woi_tops}; // int [][] woi_tops = {quadCLT_main.woi_tops,quadCLT_aux.woi_tops};
final double [][][] ers_delay = get_ers?(new double [2][][]):null; final double [][][] ers_delay = get_ers?(new double [2][][]):null;
...@@ -439,7 +439,7 @@ public class TwoQuadCLT { ...@@ -439,7 +439,7 @@ public class TwoQuadCLT {
quadCLT_aux.getCLTKernels(), // final double [][][][][][] clt_kernels_aux, // [channel_in_quad][color][tileY][tileX][band][pixel] , size should match image (have 1 tile around) quadCLT_aux.getCLTKernels(), // final double [][][][][][] clt_kernels_aux, // [channel_in_quad][color][tileY][tileX][band][pixel] , size should match image (have 1 tile around)
clt_parameters.corr_magic_scale, // final double corr_magic_scale, // still not understood coefficient that reduces reported disparity value. Seems to be around 0.85 clt_parameters.corr_magic_scale, // final double corr_magic_scale, // still not understood coefficient that reduces reported disparity value. Seems to be around 0.85
true, // final boolean keep_clt_data, true, // final boolean keep_clt_data,
woi_tops, // final int [][] woi_tops, // woi_tops, // final int [][] woi_tops,
ers_delay, // final double [][][] ers_delay, // if not null - fill with tile center acquisition delay ers_delay, // final double [][][] ers_delay, // if not null - fill with tile center acquisition delay
threadsMax, // final int threadsMax, // maximal number of threads to launch threadsMax, // final int threadsMax, // maximal number of threads to launch
debugLevel); // final int globalDebugLevel); debugLevel); // final int globalDebugLevel);
...@@ -1946,7 +1946,7 @@ if (debugLevel > -100) return true; // temporarily ! ...@@ -1946,7 +1946,7 @@ if (debugLevel > -100) return true; // temporarily !
} }
} }
ImageDtt image_dtt = new ImageDtt(); ImageDtt image_dtt = new ImageDtt();
int [][] woi_tops = {quadCLT_main.woi_tops,quadCLT_aux.woi_tops}; // int [][] woi_tops = {quadCLT_main.woi_tops,quadCLT_aux.woi_tops};
image_dtt.clt_bi_quad ( image_dtt.clt_bi_quad (
clt_parameters, // final EyesisCorrectionParameters.CLTParameters clt_parameters, clt_parameters, // final EyesisCorrectionParameters.CLTParameters clt_parameters,
clt_parameters.fat_zero, // final double fatzero, // May use correlation fat zero from 2 different parameters - fat_zero and rig.ml_fatzero clt_parameters.fat_zero, // final double fatzero, // May use correlation fat zero from 2 different parameters - fat_zero and rig.ml_fatzero
...@@ -1974,7 +1974,7 @@ if (debugLevel > -100) return true; // temporarily ! ...@@ -1974,7 +1974,7 @@ if (debugLevel > -100) return true; // temporarily !
quadCLT_aux.getCLTKernels(), // final double [][][][][][] clt_kernels_aux, // [channel_in_quad][color][tileY][tileX][band][pixel] , size should match image (have 1 tile around) quadCLT_aux.getCLTKernels(), // final double [][][][][][] clt_kernels_aux, // [channel_in_quad][color][tileY][tileX][band][pixel] , size should match image (have 1 tile around)
clt_parameters.corr_magic_scale, // final double corr_magic_scale, // still not understood coefficient that reduces reported disparity value. Seems to be around 0.85 clt_parameters.corr_magic_scale, // final double corr_magic_scale, // still not understood coefficient that reduces reported disparity value. Seems to be around 0.85
false, // true, // final boolean keep_clt_data, false, // true, // final boolean keep_clt_data,
woi_tops, // final int [][] woi_tops, // woi_tops, // final int [][] woi_tops,
null, // final double [][][] ers_delay, // if not null - fill with tile center acquisition delay null, // final double [][][] ers_delay, // if not null - fill with tile center acquisition delay
threadsMax, // final int threadsMax, // maximal number of threads to launch threadsMax, // final int threadsMax, // maximal number of threads to launch
debugLevel-2); // final int globalDebugLevel); debugLevel-2); // final int globalDebugLevel);
...@@ -2154,7 +2154,7 @@ if (debugLevel > -100) return true; // temporarily ! ...@@ -2154,7 +2154,7 @@ if (debugLevel > -100) return true; // temporarily !
clt_parameters.rig.ml_show_ml, // boolean show, clt_parameters.rig.ml_show_ml, // boolean show,
debugLevel); // int debugLevel debugLevel); // int debugLevel
Runtime.getRuntime().gc(); Runtime.getRuntime().gc();
System.out.println("Generated ML data, offset = "+disparity_offset+", --- Free memory="+Runtime.getRuntime().freeMemory()+" (of "+Runtime.getRuntime().totalMemory()+")"); System.out.println("Generated ML data, offset = "+String.format("%8.5f",disparity_offset)+", --- Free memory="+Runtime.getRuntime().freeMemory()+" (of "+Runtime.getRuntime().totalMemory()+")");
} }
} }
...@@ -5537,7 +5537,7 @@ if (debugLevel > -100) return true; // temporarily ! ...@@ -5537,7 +5537,7 @@ if (debugLevel > -100) return true; // temporarily !
double [][] disparity_bimap = new double [ImageDtt.BIDISPARITY_TITLES.length][]; //[0] -residual disparity, [1] - orthogonal (just for debugging) last 4 - max pixel differences double [][] disparity_bimap = new double [ImageDtt.BIDISPARITY_TITLES.length][]; //[0] -residual disparity, [1] - orthogonal (just for debugging) last 4 - max pixel differences
int [][] woi_tops = {quadCLT_main.woi_tops,quadCLT_aux.woi_tops}; // int [][] woi_tops = {quadCLT_main.woi_tops,quadCLT_aux.woi_tops};
image_dtt.clt_bi_quad ( image_dtt.clt_bi_quad (
clt_parameters, // final EyesisCorrectionParameters.CLTParameters clt_parameters, clt_parameters, // final EyesisCorrectionParameters.CLTParameters clt_parameters,
fatzero, // final double fatzero, // May use correlation fat zero from 2 different parameters - fat_zero and rig.ml_fatzero fatzero, // final double fatzero, // May use correlation fat zero from 2 different parameters - fat_zero and rig.ml_fatzero
...@@ -5564,7 +5564,7 @@ if (debugLevel > -100) return true; // temporarily ! ...@@ -5564,7 +5564,7 @@ if (debugLevel > -100) return true; // temporarily !
quadCLT_aux.getCLTKernels(), // final double [][][][][][] clt_kernels_aux, // [channel_in_quad][color][tileY][tileX][band][pixel] , size should match image (have 1 tile around) quadCLT_aux.getCLTKernels(), // final double [][][][][][] clt_kernels_aux, // [channel_in_quad][color][tileY][tileX][band][pixel] , size should match image (have 1 tile around)
clt_parameters.corr_magic_scale, // final double corr_magic_scale, // still not understood coefficient that reduces reported disparity value. Seems to be around 0.85 clt_parameters.corr_magic_scale, // final double corr_magic_scale, // still not understood coefficient that reduces reported disparity value. Seems to be around 0.85
false, // true, // final boolean keep_clt_data, false, // true, // final boolean keep_clt_data,
woi_tops, // final int [][] woi_tops, // woi_tops, // final int [][] woi_tops,
null, // final double [][][] ers_delay, // if not null - fill with tile center acquisition delay null, // final double [][][] ers_delay, // if not null - fill with tile center acquisition delay
threadsMax, // final int threadsMax, // maximal number of threads to launch threadsMax, // final int threadsMax, // maximal number of threads to launch
debugLevel-2); // final int globalDebugLevel); debugLevel-2); // final int globalDebugLevel);
......
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