Commit c2de0cdf authored by Andrey Filippov's avatar Andrey Filippov

cleanup

parent 695dfdbd
......@@ -5011,39 +5011,47 @@ private Panel panel1,
public boolean getPairImages2() {
if (!prepareRigImages()) return false;
String configPath=getSaveCongigPath();
if (configPath.equals("ABORT")) return false;
String configPath=getSaveCongigPath();
if (configPath.equals("ABORT")) return false;
if (DEBUG_LEVEL > -2){
System.out.println("++++++++++++++ Calculating combined correlations ++++++++++++++");
}
try {
TWO_QUAD_CLT.processCLTQuadCorrPairs(
QUAD_CLT, // QuadCLT quadCLT_main,
QUAD_CLT_AUX, // QuadCLT quadCLT_aux,
CLT_PARAMETERS, // EyesisCorrectionParameters.DCTParameters dct_parameters,
DEBAYER_PARAMETERS, //EyesisCorrectionParameters.DebayerParameters debayerParameters,
COLOR_PROC_PARAMETERS, //EyesisCorrectionParameters.ColorProcParameters colorProcParameters,
// CHANNEL_GAINS_PARAMETERS, //CorrectionColorProc.ColorGainsParameters channelGainParameters,
// CHANNEL_GAINS_PARAMETERS_AUX, //CorrectionColorProc.ColorGainsParameters channelGainParameters_aux,
RGB_PARAMETERS, //EyesisCorrectionParameters.RGBParameters rgbParameters,
THREADS_MAX, //final int threadsMax, // maximal number of threads to launch
UPDATE_STATUS, //final boolean updateStatus,
DEBUG_LEVEL);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
} //final int debugLevel);
QUAD_CLT.tp.clt_3d_passes = null; // resetCLTPasses(); // so running "Ground truth" after would be OK
QUAD_CLT_AUX.tp.clt_3d_passes = null; //.resetCLTPasses();
if (DEBUG_LEVEL > -2){
System.out.println("++++++++++++++ Calculating combined correlations ++++++++++++++");
}
// reset if ran after 3d model to save memory
if (QUAD_CLT.tp != null) {
QUAD_CLT.tp.clt_3d_passes = null; // resetCLTPasses();
}
if (QUAD_CLT_AUX.tp != null) {
QUAD_CLT_AUX.tp.clt_3d_passes = null; // resetCLTPasses();
}
if (configPath!=null) {
saveTimestampedProperties( // save config again
configPath, // full path or null
null, // use as default directory if path==null
true,
PROPERTIES);
}
try {
TWO_QUAD_CLT.processCLTQuadCorrPairs(
QUAD_CLT, // QuadCLT quadCLT_main,
QUAD_CLT_AUX, // QuadCLT quadCLT_aux,
CLT_PARAMETERS, // EyesisCorrectionParameters.DCTParameters dct_parameters,
DEBAYER_PARAMETERS, //EyesisCorrectionParameters.DebayerParameters debayerParameters,
COLOR_PROC_PARAMETERS, //EyesisCorrectionParameters.ColorProcParameters colorProcParameters,
// CHANNEL_GAINS_PARAMETERS, //CorrectionColorProc.ColorGainsParameters channelGainParameters,
// CHANNEL_GAINS_PARAMETERS_AUX, //CorrectionColorProc.ColorGainsParameters channelGainParameters_aux,
RGB_PARAMETERS, //EyesisCorrectionParameters.RGBParameters rgbParameters,
THREADS_MAX, //final int threadsMax, // maximal number of threads to launch
UPDATE_STATUS, //final boolean updateStatus,
DEBUG_LEVEL);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
} //final int debugLevel);
QUAD_CLT.tp.clt_3d_passes = null; // resetCLTPasses(); // so running "Ground truth" after would be OK
QUAD_CLT_AUX.tp.clt_3d_passes = null; //.resetCLTPasses();
if (configPath!=null) {
saveTimestampedProperties( // save config again
configPath, // full path or null
null, // use as default directory if path==null
true,
PROPERTIES);
}
return true;
}
......
......@@ -8915,28 +8915,15 @@ public class QuadCLT {
int image_width = imp.getWidth();
int image_height = imp.getHeight();
double scale_h = 1.0 * correctionsParameters.thumb_width/image_width;
double scale_v = 1.0 * correctionsParameters.thumb_height/image_height;
// double scale = Math.min(scale_h, scale_v) /correctionsParameters.thumb_size;
double scale = scale_h / correctionsParameters.thumb_size;
double scale_h = 1.0 * (correctionsParameters.thumb_width + 1)/image_width;
double scale_v = 1.0 * (correctionsParameters.thumb_height + 1)/image_height;
double scale = ((scale_h > scale_v) ? scale_h : scale_v) / correctionsParameters.thumb_size;
// ImageProcessor ip = imp.getChannelProcessor();
ImageProcessor ip = imp.getProcessor().duplicate();
ip.setInterpolationMethod(ImageProcessor.BICUBIC);
// ip.setInterpolationMethod(ImageProcessor.BILINEAR);
ip.blurGaussian(2.0);
ip.scale(scale, scale);
// Rectangle rs = new Rectangle(
// (int)Math.round(0.5*image_width*(1.0-scale)),
// (int)Math.round(0.5*image_height*(1.0-scale)),
// (int)Math.round(image_width*scale),
// (int)Math.round(image_height*scale));
// int scaled_width = rs.width; // ip.getWidth();
// int scaled_height = rs.height; // ip.getHeight();
// int lm = (int) Math.round ((scaled_width-correctionsParameters.thumb_width)* correctionsParameters.thumb_h_center);
// int tm = (int) Math.round ((scaled_height-correctionsParameters.thumb_height)* correctionsParameters.thumb_v_center);
int lm = (int) Math.round (((image_width*scale)-correctionsParameters.thumb_width)* correctionsParameters.thumb_h_center + (0.5*image_width*(1.0-scale)));
int tm = (int) Math.round (((image_height*scale)-correctionsParameters.thumb_height)* correctionsParameters.thumb_v_center + (0.5*image_height*(1.0-scale)));
Rectangle r = new Rectangle(lm,tm,correctionsParameters.thumb_width,correctionsParameters.thumb_height);
......
......@@ -1535,27 +1535,11 @@ public class SuperTiles{
public double [][][][] getPlaneDispStrengthsST(
final double [] world_plane_norm, // real world normal vector to a suggested plane family (0,1,0) for horizontal planes, (0,0,1) const disparity, null - floating
final int stMeasSel, // = 1; // Select measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
final boolean plPreferDisparity, // Always start with disparity-most axis (false - lowest eigenvalue)
final GeometryCorrection geometryCorrection,
final boolean correct_distortions,
final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
final MeasuredLayersFilterParameters mlfp,
// final int smplSide, // = 2; // Sample size (side of a square)
// final int smplNum, // = 3; // Number after removing worst
// final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// final boolean smplWnd, //
// final double max_abs_tilt, // 2.0; // pix per tile
// final double max_rel_tilt, // 0.2; // (pix / disparity) per tile
// final double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// final double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// final double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// final int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// final double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
final int debugLevel,
final int dbg_X,
final int dbg_Y)
......@@ -1590,7 +1574,6 @@ public class SuperTiles{
double [][][] plane_tilts = null; // used only for world_plane_norm != null
// to get tile disparities needed to calculate tilts
for (int nsTile = ai.getAndIncrement(); nsTile < nStiles; nsTile = ai.getAndIncrement()) {
// int dl = (nsTile == debug_stile) ? 3 : 0;
int dl = ((debugLevel > 1) && (nsTile == debug_stile)) ? 3: debugLevel;
if (dl > 2){
System.out.println("getPlaneDispStrengths(): nsTile="+nsTile);
......@@ -1664,22 +1647,8 @@ public class SuperTiles{
stileX, // int stX,
stileY, // int stY,
null, // boolean [] sel_in,
// ((world_plane_norm == null)? zero_tilts: plane_tilts[ml]), // double [] tiltXY, // null - free with limit on both absolute (2.0?) and relative (0.2) values
(floating? null: plane_tilts[ml]), // double [] tiltXY, // null - free with limit on both absolute (2.0?) and relative (0.2) values
mlfp,
// strength_floor, // double strength_floor,
// strength_pow, // double strength_pow,
// smplSide, // int smplSide, // = 2; // Sample size (side of a square)
// smplNum, //int smplNum, // = 3; // Number after removing worst (should be >1)
// smplRms, //double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // boolean smplWnd, //
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
true, // boolean null_if_none);
dl);
} else {
......@@ -2035,7 +2004,7 @@ public class SuperTiles{
/**
* Use both horizontal and const disparity tiles to create tile clusters
*Add max_diff (maximal disparity difference while extracting initial tile selection) and max_tries (2..3) parameters
* Add max_diff (maximal disparity difference while extracting initial tile selection) and max_tries (2..3) parameters
* Add separate method to create + remove outliers from all planes (2 different ones)?
* TODO later re-assign pixels according to existing plane parameters
* Sort plane data by center (plane or supertile) disparity
......@@ -2077,18 +2046,6 @@ public class SuperTiles{
final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
final MeasuredLayersFilterParameters mlfp,
// final int smplSide, // = 2; // Sample size (side of a square)
// final int smplNum, // = 3; // Number after removing worst
// final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// final boolean smplWnd, // use window functions fro the samples
// final double max_abs_tilt, // 2.0; // pix per tile
// final double max_rel_tilt, // 0.2; // (pix / disparity) per tile
// final double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// final double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// final double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// final int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// final double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
final double bin_blur_hor, // Blur disparity histograms for horizontal clusters by this sigma (in bins)
final double bin_blur_vert, // Blur disparity histograms for constant disparity clusters by this sigma (in bins)
......@@ -2109,18 +2066,14 @@ public class SuperTiles{
final int tilesX = tileProcessor.getTilesX();
final int tilesY = tileProcessor.getTilesY();
final int superTileSize = tileProcessor.getSuperTileSize();
// final int tileSize = tileProcessor.getTileSize();
final int stilesX = (tilesX + superTileSize -1)/superTileSize;
final int stilesY = (tilesY + superTileSize -1)/superTileSize;
final int nStiles = stilesX * stilesY;
// final Thread[] threads = ImageDtt.newThreadArray(tileProcessor.threadsMax);
final Thread[] threads = ImageDtt.newThreadArray((debugLevel > 1)? 1 : tileProcessor.threadsMax);
final AtomicInteger ai = new AtomicInteger(0);
this.planes = new TilePlanes.PlaneData[nStiles][];
final int debug_stile = (debugLevel > -1)? (dbg_Y * stilesX + dbg_X):-1;
// TODO: Remove when promoting PlaneData
// final TilePlanes tpl = new TilePlanes(tileSize,superTileSize, geometryCorrection);
final int num_layers = measuredLayers.getNumLayers();
final int num_tiles = 4 * superTileSize * superTileSize;
boolean [] grown_selection = null;
......@@ -2140,7 +2093,7 @@ public class SuperTiles{
cltPass3d.getStrength(), // double [] strength,
grown_selection); // null); // boolean [] selection) // may be null
if (show_histograms && (debugLevel > 0)) {
String [] titles = {"d0","s0","d1","s1","d2","s2","d3","s3","s","d","selection"};
String [] titles = {"d0","s0","d1","s1","d2","s2","d3","s3","d","s","selection"};
boolean [] dbg_sel= grown_selection; // cltPass3d.getSelected();
double [][] dbg_img = new double [titles.length][];
for (int i = 0; i < measuredLayers.getNumLayers(); i++){
......@@ -2168,19 +2121,6 @@ public class SuperTiles{
correct_distortions, // final boolean correct_distortions,
smplMode, // final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
mlfp,
// smplSide, // final int smplSide, // = 2; // Sample size (side of a square)
// smplNum, // final int smplNum, // = 3; // Number after removing worst
// smplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // final boolean smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
debugLevel,
dbg_X,
dbg_Y);
......@@ -2193,19 +2133,6 @@ public class SuperTiles{
correct_distortions, // final boolean correct_distortions,
smplMode, // final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
mlfp,
// smplSide, // final int smplSide, // = 2; // Sample size (side of a square)
// smplNum, // final int smplNum, // = 3; // Number after removing worst
// smplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // final boolean smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
debugLevel,
dbg_X,
dbg_Y);
......@@ -2292,8 +2219,6 @@ public class SuperTiles{
@Override
public void run() {
for (int nsTile = ai.getAndIncrement(); nsTile < nStiles; nsTile = ai.getAndIncrement()) {
// int dl = ((debugLevel > -1) && (nsTile == debug_stile)) ? 3 : 0;
// int dl = ((debugLevel > 1) && (nsTile == debug_stile)) ? 3: debugLevel;
int dl = ((debugLevel > 0) && (nsTile == debug_stile)) ? 3: debugLevel;
if (dl > 2){
System.out.println("initialDiscriminateTiles() selecting: nsTile="+nsTile);
......@@ -2444,23 +2369,10 @@ public class SuperTiles{
final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
final MeasuredLayersFilterParameters mlfp,
// final int smplSide, // = 2; // Sample size (side of a square)
// final int smplNum, // = 3; // Number after removing worst
// final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// final boolean smplWnd, // use window functions for the samples
// final double max_abs_tilt, // 2.0; // pix per tile
// final double max_rel_tilt, // 0.2; // (pix / disparity) per tile
// final double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// final double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// final double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// final int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// final double far_power, // 1.0; // Raise disparity to this power before averaging for far objects
final double plDiscrTolerance, // = 0.4; // Maximal disparity difference from the plane to consider tile
final double plDiscrDispRange, // = 0.6; // Parallel move known planes around original know value for the best overall fit
final int plDiscrSteps, // = 3; // Number of steps (each direction) for each plane to search for the best fit (0 - single, 1 - 1 each side)
// final int plDiscrVariants, // = 100; // Total number of variants to try (protect from too many planes)
final int plDiscrMode, // = 3; // What plane to use as a hint: 0 - weighted, 1 - equalized, 2 - best, 3 - combined
final double plDiscrVarFloor, // = 0.03; // Squared add to variance to calculate reverse flatness (used mostly for single-cell clusters)
......@@ -2529,18 +2441,6 @@ public class SuperTiles{
plDispNorm, // final double dispNorm, // Normalize disparities to the average if above
smplMode, // final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
mlfp,
// smplSide, // final int smplSide, // = 2; // Sample size (side of a square)
// smplNum, // final int smplNum, // = 3; // Number after removing worst
// smplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // final boolean smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
plDiscrTolerance, // final double disp_tolerance, // maximal disparity difference from the plane to consider tile
plDiscrVarFloor, // final double disp_var_floor, // squared add to variance to calculate reverse flatness (used mostly for single-cell clusters)
......@@ -2649,19 +2549,6 @@ public class SuperTiles{
final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
final MeasuredLayersFilterParameters mlfp,
// final int smplSide, // = 2; // Sample size (side of a square)
// final int smplNum, // = 3; // Number after removing worst
// final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// final boolean smplWnd, // use window functions for the samples
// final double max_abs_tilt, // 2.0; // pix per tile
// final double max_rel_tilt, // 0.2; // (pix / disparity) per tile
// final double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// final double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// final double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// final int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// final double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
final int debugLevel,
final int dbg_X,
final int dbg_Y)
......@@ -2689,20 +2576,15 @@ public class SuperTiles{
@Override
public void run() {
for (int nsTile = ai.getAndIncrement(); nsTile < nStiles; nsTile = ai.getAndIncrement()) {
// int dl = ((debugLevel > 1) && (nsTile == debug_stile)) ? 3: debugLevel;
int dl = ((debugLevel > 1) && (nsTile == debug_stile)) ? 3: debugLevel;
if (dl > 2){
System.out.println("createPlanesFromSelections(): nsTile="+nsTile);
}
if (plane_selections[nsTile] != null) {
int stileY = nsTile / stilesX;
int stileX = nsTile % stilesX;
int [] sTiles = {stileX, stileY};
// int dl = (nsTile == debug_stile) ? 3 : 0;
result_planes[nsTile] = null;
// first make a plane from all tiles
......@@ -2722,26 +2604,9 @@ public class SuperTiles{
plTargetEigen, // double plTargetEigen, // = 0.1; // Remove outliers until main axis eigenvalue (possibly scaled by plDispNorm) gets below
plFractOutliers, // double plFractOutliers, // = 0.3; // Maximal fraction of outliers to remove
plMaxOutliers, // int plMaxOutliers, // = 20; // Maximal number of outliers to remove
// strength_floor, // double strength_floor,
// strength_pow, // double strength_pow,
correct_distortions, // boolean correct_distortions,
smplMode, // boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
mlfp,
// smplSide, // int smplSide, // = 2; // Sample size (side of a square)
// smplNum, // int smplNum, // = 3; // Number after removing worst
// smplRms, // double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // final boolean smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
dl); // int debugLevel);
if ((st_planes != null) && (!st_planes.isEmpty())){
......@@ -2766,8 +2631,6 @@ public class SuperTiles{
sdfa_instance.showArrays(dbg_img, 2 * superTileSize, 2* superTileSize, true, "pre_bridge_world-"+nsTile+"-"+debugLevel,dbg_titles);
}
st_planes = pd0.createTilePlanesFromSelections(
"" + nsTile+" bridges ", // String suffix,
split_sels, // boolean [][][] plane_selections, // = new boolean [nStiles][][][]; // num_tiles
......@@ -2777,24 +2640,9 @@ public class SuperTiles{
plTargetEigen, // double plTargetEigen, // = 0.1; // Remove outliers until main axis eigenvalue (possibly scaled by plDispNorm) gets below
0.0, // double plFractOutliers, // = 0.3; // Maximal fraction of outliers to remove
0, // plMaxOutliers, // int plMaxOutliers, // = 20; // Maximal number of outliers to remove
// strength_floor, // double strength_floor,
// strength_pow, // double strength_pow,
correct_distortions, // boolean correct_distortions,
smplMode, // boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
mlfp,
// smplSide, // int smplSide, // = 2; // Sample size (side of a square)
// smplNum, // int smplNum, // = 3; // Number after removing worst
// smplRms, // double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // final boolean smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
dl - 1); // int debugLevel);
}
......@@ -2873,18 +2721,6 @@ public class SuperTiles{
final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
final MeasuredLayersFilterParameters mlfp,
// final int smplSide, // = 2; // Sample size (side of a square)
// final int smplNum, // = 3; // Number after removing worst
// final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// final boolean smplWnd, // use window functions fro the samples
// final double max_abs_tilt, // 2.0; // pix per tile
// final double max_rel_tilt, // 0.2; // (pix / disparity) per tile
// final double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// final double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// final double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// final int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// final double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
final double bin_blur_hor, // Blur disparity histograms for horizontal clusters by this sigma (in bins)
final double bin_blur_vert, // Blur disparity histograms for constant disparity clusters by this sigma (in bins)
......@@ -2922,19 +2758,6 @@ public class SuperTiles{
smplMode, // final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
mlfp,
// smplSide, // final int smplSide, // = 2; // Sample size (side of a square)
// smplNum, // final int smplNum, // = 3; // Number after removing worst
// smplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // final boolean smplWnd, // use window functions fro the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
bin_blur_hor, // final double bin_blur_hor, // Blur disparity histograms for horizontal clusters by this sigma (in bins)
bin_blur_vert, // final double bin_blur_vert, // Blur disparity histograms for constant disparity clusters by this sigma (in bins)
max_diff_hor, // final double max_diff_hor, // maximal disparity difference (to assign to a cluster (of Double.NaN) at first run for horizontal planes
......@@ -2961,19 +2784,6 @@ public class SuperTiles{
smplMode, // final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
mlfp,
// smplSide, // final int smplSide, // = 2; // Sample size (side of a square)
// smplNum, // final int smplNum, // = 3; // Number after removing worst
// smplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // final boolean smplWnd, // use window functions fro the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
debugLevel, // final int debugLevel,
dbg_X, // final int dbg_X,
dbg_Y); // final int dbg_Y)
......@@ -2994,19 +2804,6 @@ public class SuperTiles{
smplMode, // final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
mlfp,
// smplSide, // final int smplSide, // = 2; // Sample size (side of a square)
// smplNum, // final int smplNum, // = 3; // Number after removing worst
// smplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // final boolean smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
debugLevel + 0, // 1, // + 2, // 1, // final int debugLevel,
dbg_X, // final int dbg_X,
dbg_Y); // final int dbg_Y)
......@@ -3069,23 +2866,10 @@ public class SuperTiles{
final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
final MeasuredLayersFilterParameters mlfp,
// final int smplSide, // = 2; // Sample size (side of a square)
// final int smplNum, // = 3; // Number after removing worst
// final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// final boolean smplWnd, // use window functions for the samples
// final double max_abs_tilt, // 2.0; // pix per tile
// final double max_rel_tilt, // 0.2; // (pix / disparity) per tile
// final double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// final double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// final double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// final int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// final double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
final double plDiscrTolerance, // = 0.4; // Maximal disparity difference from the plane to consider tile
final double plDiscrDispRange, // = 0.6; // Parallel move known planes around original know value for the best overall fit
final int plDiscrSteps, // = 3; // Number of steps (each direction) for each plane to search for the best fit (0 - single, 1 - 1 each side)
// final int plDiscrVariants, // = 100; // Total number of variants to try (protect from too many planes)
final int plDiscrMode, // = 3; // What plane to use as a hint: 0 - weighted, 1 - equalized, 2 - best, 3 - combined
final double plDiscrVarFloor, // = 0.03; // Squared add to variance to calculate reverse flatness (used mostly for single-cell clusters)
......@@ -3121,23 +2905,10 @@ public class SuperTiles{
smplMode, // final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
mlfp,
// smplSide, // final int smplSide, // = 2; // Sample size (side of a square)
// smplNum, // final int smplNum, // = 3; // Number after removing worst
// smplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // final boolean smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
plDiscrTolerance, //final double plDiscrTolerance, // = 0.4; // Maximal disparity difference from the plane to consider tile
plDiscrDispRange, // final double plDiscrDispRange, // = 0.6; // Parallel move known planes around original know value for the best overall fit
plDiscrSteps, // final int plDiscrSteps, // = 3; // Number of steps (each direction) for each plane to search for the best fit (0 - single, 1 - 1 each side)
// plDiscrVariants, // final int plDiscrVariants, // = 100; // Total number of variants to try (protect from too many planes)
plDiscrMode, // final int plDiscrMode, // = 3; // What plane to use as a hint: 0 - weighted, 1 - equalized, 2 - best, 3 - combined
plDiscrVarFloor, // final double plDiscrVarFloor, // = 0.03; // Squared add to variance to calculate reverse flatness (used mostly for single-cell clusters)
......@@ -3169,19 +2940,6 @@ public class SuperTiles{
smplMode, // final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
mlfp,
// smplSide, // final int smplSide, // = 2; // Sample size (side of a square)
// smplNum, // final int smplNum, // = 3; // Number after removing worst
// smplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // final boolean smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
debugLevel, // final int debugLevel,
dbg_X, // final int dbg_X,
dbg_Y); // final int dbg_Y)
......@@ -3202,19 +2960,6 @@ public class SuperTiles{
smplMode, // final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
mlfp,
// smplSide, // final int smplSide, // = 2; // Sample size (side of a square)
// smplNum, // final int smplNum, // = 3; // Number after removing worst
// smplRms, // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // final boolean smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
debugLevel, // + 2, // 1, // final int debugLevel,
dbg_X, // final int dbg_X,
dbg_Y); // final int dbg_Y)
......
......@@ -1225,21 +1225,6 @@ public class TilePlanes {
sTileXY[1], // int stY,
null, // measuredSelection[nl], // boolean [] sel_in,
this.mlfp,
// strength_floor,
// measured_strength_pow, //
// smplSide, // = 2; // Sample size (side of a square)
// smplNum, // = 3; // Number after removing worst
// smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
true, // boolean null_if_none)
debugLevel);
}
......@@ -1250,8 +1235,6 @@ public class TilePlanes {
sTileXY[1], // int stY,
null, // measuredSelection[nl], // boolean [] sel_in,
this.mlfp,
// strength_floor, //
// measured_strength_pow, //
true); // boolean null_if_none)
}
}
......@@ -1259,7 +1242,6 @@ public class TilePlanes {
}
int numRemoved = 0;
boolean no_bugs = true;
// for (; (getValue() > targetEigen) && (numRemoved < maxRemoved); numRemoved++){
for (; (getNormValue() > targetEigen) && (numRemoved < maxRemoved); numRemoved++){
if (debugLevel > 2){
System.out.println("removePlaneOutliers("+sTileXY[0]+":"+sTileXY[1]+"): numRemoved = "+numRemoved+
......@@ -1270,6 +1252,7 @@ public class TilePlanes {
double worst_d2 = 0.0;
int [] worst_layer_index = {-1,-1};
// TODO: Add vertical planes here set v[1] = 0.0;
double [] v = getVector();
double [] zxy0 = getZxy();
for (int nl = 0; nl < measuredSelection.length; nl++){
......@@ -1313,22 +1296,8 @@ public class TilePlanes {
this.dispNorm, // double dispNorm, // Normalize disparities to the average if above
this.min_weight, // double min_weight,
this.min_tiles, // int min_tiles,
// strength_floor,
// measured_strength_pow, // double strength_pow,
this.smplMode,
this.mlfp,
// smplSide,
// smplNum,
// smplRms,
// smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
debugLevel-1) != null);
if (!OK){ // restore last selection, re-run getPlaneFromMeas
......@@ -1341,21 +1310,8 @@ public class TilePlanes {
this.dispNorm, // double dispNorm, // Normalize disparities to the average if above
this.min_weight, // double min_weight,
this.min_tiles, // int min_tiles,
// strength_floor,
// measured_strength_pow, // double strength_pow,
this.smplMode,
this.mlfp,
// smplSide,
// smplNum,
// smplRms,
// smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
debugLevel-1) != null);
if (!OK) {
System.out.println("This is a BUG in removePlaneOutliers() - run with previous selection and failed");
......@@ -1402,24 +1358,8 @@ public class TilePlanes {
double dispNorm, // Normalize disparities to the average if above
double min_weight,
int min_tiles,
// double strength_floor,
// double strength_pow,
boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
MeasuredLayersFilterParameters mlfp,
// int smplSide, // = 2; // Sample size (side of a square)
// int smplNum, // = 3; // Number after removing worst
// double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// boolean smplWnd, // use window functions for the samples
// double max_abs_tilt, // 2.0; // pix per tile
// double max_rel_tilt, // 0.2; // (pix / disparity) per tile
// double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
int debugLevel)
{
double mindet = 1E-15;
......@@ -1432,25 +1372,10 @@ public class TilePlanes {
tile_sel = this.measuredSelection;
}
// this.strength_floor = strength_floor;
// this.measured_strength_pow = strength_pow;
this.min_weight = min_weight;
this.min_tiles = min_tiles;
this.dispNorm = dispNorm;
// this.smplWnd = smplWnd; // use window functions for the samples
this.smplMode = smplMode; // = true; // Use sample mode (false - regular tile mode)
// this.smplSide = smplSide; // = 2; // Sample size (side of a square)
// this.smplNum = smplNum; // = 3; // Number after removing worst
// this.smplRms = smplRms; // = 0.1; // Maximal RMS of the remaining tiles in a sample
// this.max_abs_tilt = max_abs_tilt;
// this.max_rel_tilt = max_rel_tilt;
// this.damp_tilt = damp_tilt;
// this.min_tilt_disp = min_tilt_disp;
// this.transition = transition;
// this.far_mode = far_mode;
// this.far_power = far_power;
this.mlfp = mlfp.clone();
......@@ -1473,19 +1398,6 @@ public class TilePlanes {
((tile_sel[nl].length == 0)? null:tile_sel[nl]), // boolean [] sel_in,
//tile_sel[nl], // boolean [] sel_in,
mlfp,
// strength_floor,
// strength_pow, //
// smplSide, // = 2; // Sample size (side of a square)
// smplNum, // = 3; // Number after removing worst
// smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // final boolean smplWnd, // use window functions fro the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
true, // boolean null_if_none)
debugLevel);
}
......@@ -1580,8 +1492,6 @@ public class TilePlanes {
if (w > 0.0){
double d = disp_str[nl][0][indx];
// referencing samples to centers of pixels
// double x = ((indx % stSize2) - stSize + 0.5) * tileSize + 0.5; // in pixels, not in tiles
// double y = ((indx / stSize2) - stSize + 0.5) * tileSize + 0.5;
double x = ((indx % stSize2) - stSize + 0.5) * tileSize; // in pixels, not in tiles
double y = ((indx / stSize2) - stSize + 0.5) * tileSize;
sw += w;
......@@ -1600,8 +1510,6 @@ public class TilePlanes {
swx /= sw;
swy /= sw;
// double kz = ((dispNorm > 0.0) && (swz > dispNorm)) ? (dispNorm / swz) : 1.0;
if (debugLevel > 0){
System.out.println("getPlaneFromMeas(): num_tiles="+num_tiles+", sw = "+sw +", swz = "+swz +", swx = "+swx +", swy = "+swy); // +", kz="+kz);
}
......@@ -1614,11 +1522,8 @@ public class TilePlanes {
if (tile_sel[nl][indx]) {
double w = disp_str[nl][1][indx] / sw;
if (w > 0.0){
// double d = kz * (disp_str[nl][0][indx] - swz); // Not here!
double d = disp_str[nl][0][indx] - swz;
double wd = w*d;
// double x = ((indx % stSize2) - stSize + 0.5) * tileSize + 0.5 - swx;
// double y = ((indx / stSize2) - stSize + 0.5) * tileSize + 0.5 - swy;
double x = ((indx % stSize2) - stSize + 0.5) * tileSize - swx;
double y = ((indx / stSize2) - stSize + 0.5) * tileSize - swy;
acovar [0][0] += wd * d;
......@@ -1644,7 +1549,6 @@ public class TilePlanes {
}
if (debugLevel > 3){
// if (debugLevel > 0){
System.out.println("getCovar(): sw = "+sw +", swz = "+swz +", swx = "+swx +", swy = "+swy +", covar.det() = "+covar.det());
System.out.println("getCovar(): covarianvce matrix, number of used points:"+num_tiles);
covar.print(10, 6); // w,d
......@@ -1742,27 +1646,8 @@ public class TilePlanes {
double dispNorm, // Normalize disparities to the average if above
double min_weight,
int min_tiles,
// double strength_floor,
// double strength_pow,
boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
MeasuredLayersFilterParameters mlfp,
// int smplSide, // = 2; // Sample size (side of a square)
// int smplNum, // = 3; // Number after removing worst
// double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
///* was not here */boolean smplWnd, // use window functions for the samples
// double max_abs_tilt, // 2.0; // pix per tile
// double max_rel_tilt, // 0.2; // (pix / disparity) per tile
// double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
int debugLevel)
{
double mindet = 1E-15;
......@@ -1775,25 +1660,10 @@ public class TilePlanes {
tile_sel = this.measuredSelection;
}
// this.strength_floor = strength_floor;
// this.measured_strength_pow = strength_pow;
this.min_weight = min_weight;
this.min_tiles = min_tiles;
this.dispNorm = dispNorm;
this.smplMode = smplMode; // = true; // Use sample mode (false - regular tile mode)
// this.smplSide = smplSide; // = 2; // Sample size (side of a square)
// this.smplNum = smplNum; // = 3; // Number after removing worst
// this.smplRms = smplRms; // = 0.1; // Maximal RMS of the remaining tiles in a sample
// this.smplWnd = smplWnd; // was not here !
// this.max_abs_tilt = max_abs_tilt;
// this.max_rel_tilt = max_rel_tilt;
// this.damp_tilt = damp_tilt;
// this.min_tilt_disp = min_tilt_disp;
// this.transition = transition;
// this.far_mode = far_mode;
// this.far_power = far_power;
this.mlfp = mlfp.clone();
if (debugLevel > 2){
......@@ -1816,19 +1686,6 @@ public class TilePlanes {
((tile_sel[nl].length == 0)? null:tile_sel[nl]), // boolean [] sel_in,
//tile_sel[nl], // boolean [] sel_in,
mlfp,
// strength_floor,
// strength_pow, //
// smplSide, // = 2; // Sample size (side of a square)
// smplNum, // = 3; // Number after removing worst
// smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
///*was using this. */ smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
true, // boolean null_if_none)
debugLevel);
}
......@@ -1878,8 +1735,6 @@ public class TilePlanes {
sTileXY[1], // int stY,
tile_sel[nl], // boolean [] sel_in,
mlfp,
// strength_floor,
// strength_pow, //
true); // boolean null_if_none)
sw += MeasuredLayers.getSumStrength(disp_str[nl]);
}
......@@ -1887,7 +1742,6 @@ public class TilePlanes {
if ((debugLevel > 2) && (disp_str[nl] != null)){
// if ((debugLevel > 1) && (disp_str[nl] != null)){
showDoubleFloatArrays sdfa_instance = new showDoubleFloatArrays();
double [][] dbg_img = new double [3][];
dbg_img[0] = disp_str[nl][0];
......@@ -4046,26 +3900,9 @@ public class TilePlanes {
double plTargetEigen, // = 0.1; // Remove outliers until main axis eigenvalue (possibly scaled by plDispNorm) gets below
double plFractOutliers, // = 0.3; // Maximal fraction of outliers to remove
int plMaxOutliers, // = 20; // Maximal number of outliers to remove
// double strength_floor,
// double strength_pow,
boolean correct_distortions,
boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
MeasuredLayersFilterParameters mlfp,
// int smplSide, // = 2; // Sample size (side of a square)
// int smplNum, // = 3; // Number after removing worst
// double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// boolean smplWnd, // use window functions for the samples
// double max_abs_tilt, // 2.0; // pix per tile
// double max_rel_tilt, // 0.2; // (pix / disparity) per tile
// double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
int debugLevel)
{
if (debugLevel > 2) {
......@@ -4089,26 +3926,8 @@ public class TilePlanes {
dispNorm, // 0.0, // plDispNorm, // double dispNorm, // Normalize disparities to the average if above
0.0, // double min_weight,
min_tiles, // int min_tiles,
// strength_floor, //
// strength_pow, // double strength_pow,
// update !
smplMode,
mlfp,
// smplSide,
// smplNum,
// smplRms,
// smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
debugLevel) != null); // int debugLevel)
if (OK) {
if (debugLevel > 0) {
......@@ -4133,7 +3952,6 @@ public class TilePlanes {
targetV *= dd * dd; // > original
}
*/
// if (pd.getValues()[0] > targetV) {
if (pd.getNormValue() > targetV) {
OK = pd.removeOutliers( // getPlaneFromMeas should already have run
disp_strength,
......@@ -4172,27 +3990,8 @@ public class TilePlanes {
dispNorm, // 0.0, // plDispNorm, // double dispNorm, // Normalize disparities to the average if above
0.0, // double min_weight,
min_tiles, // int min_tiles,
// strength_floor, //
// strength_pow, // double strength_pow,
// update !
smplMode,
mlfp,
// smplSide,
// smplNum,
// smplRms,
// smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
debugLevel);
}
}
......@@ -4217,20 +4016,6 @@ public class TilePlanes {
final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
final MeasuredLayersFilterParameters mlfp,
// final int smplSide, // = 2; // Sample size (side of a square)
// final int smplNum, // = 3; // Number after removing worst
// final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// final boolean smplWnd, // use window functions for the samples
// final double max_abs_tilt, // 2.0; // pix per tile
// final double max_rel_tilt, // 0.2; // (pix / disparity) per tile
// final double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// final double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// final double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// final int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// final double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
final double max_disp_diff, // maximal disparity difference from the plane to consider tile
final double disp_range, // parallel move known planes around original know value for the best overall fit
final int amplitude_steps, // number of steps (each direction) for each plane to search for the best fit (0 - single, 1 - 1 each side)
......@@ -4661,19 +4446,6 @@ public class TilePlanes {
final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
final MeasuredLayersFilterParameters mlfp,
// final int smplSide, // = 2; // Sample size (side of a square)
// final int smplNum, // = 3; // Number after removing worst
// final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// final boolean smplWnd, // use window functions for the samples
// final double max_abs_tilt, // 2.0; // pix per tile
// final double max_rel_tilt, // 0.2; // (pix / disparity) per tile
// final double damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// final double min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// final double transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// final int far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// final double far_power, // 3.0; // Raise disparity to this power before averaging for far objects
final double disp_tolerance, // maximal disparity difference from the plane to consider tile
final double disp_var_floor, // squared add to variance to calculate reverse flatness (used mostly for single-cell clusters)
final double disp_sigma, // G.sigma to compare how measured data is attracted to planes
......@@ -4800,19 +4572,6 @@ public class TilePlanes {
getSTileXY()[1], // int stY,
null, // boolean [] sel_in, - use all
mlfp,
// strength_floor,
// measured_strength_pow, //
// smplSide, // = 2; // Sample size (side of a square)
// smplNum, // = 3; // Number after removing worst
// smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
// smplWnd, // use window functions for the samples
// max_abs_tilt, // 2.0; // Maximal absolute tilt in pixels/tile
// max_rel_tilt, // 0.2; // Maximal relative tilt in pixels/tile/disparity
// damp_tilt, // 0.001; // Damp tilt to handle insufficient (co-linear)data
// min_tilt_disp, // 4.0; // Disparity switch between filtering modes - near objects use tilts, far - use max disparity
// transition, // 1.0; // Mode transition range (between tilted and maximal disparity)
// far_mode, // 1; // Far objects filtering mode (0 - off, 1 - power of disparity)
// far_power, // 1.0; // Raise disparity to this power before averaging for far objects
true, // boolean null_if_none)
debugLevel);
} else {
......@@ -4822,8 +4581,6 @@ public class TilePlanes {
getSTileXY()[1], // int stY,
null, // boolean [] sel_in, - use all
mlfp,
// strength_floor, // double strength_floor,
// measured_strength_pow, // double strength_pow,
true); // boolean null_if_none);
}
}
......@@ -4901,13 +4658,11 @@ public class TilePlanes {
num_cells[np][ml] = new int[size2];
for (int indx = 0; indx < size2; indx++) if (disp_strength[ml][1][indx] > 0.0){
double d0 = pds[np][0][indx]; // disp_strength[ml][0][indx];
// double sw = disp_strength[ml][1][indx], sd = 0.0, sd2 = 0.0;
double sw = disp_strength[ml][1][indx]/window[indx], sd = 0.0, sd2 = 0.0;
num_cells[np][ml][indx]++;
for (int dir = 0; dir<8; dir++){
int indx1 = tileNeibs.getNeibIndex(indx, dir);
if (indx1 >= 0){
// double w = disp_strength[ml][1][indx1];
double w = disp_strength[ml][1][indx1]/window[indx1];
if (w > 0.0){
double d = disp_strength[ml][0][indx1] - d0;
......@@ -4925,8 +4680,6 @@ public class TilePlanes {
}
double rms = Math.sqrt(sd2);
flatness[np][ml][indx] = rms; // sd2; // will not be used
// norm_flatness[np][ml][indx] = num_cells[np][ml][indx]/(sd2 + floor2);
// norm_flatness[np][ml][indx] = (num_cells[np][ml][indx] > 1) ? (1.0/sd2): (1.0/floor2);
if (rms < disp_var_floor){
rms = disp_var_floor;
}
......@@ -4951,7 +4704,6 @@ public class TilePlanes {
int bin = (int) Math.round (db);
if ((bin >= 0) && (bin < steps)) {
// combine correlation weight, variance between valid neighbors and number of valid neighbors
// double w = weight /(flatness[np][ml][indx] + floor2) * num_cells[np][ml][indx]; // TODO: tweak?
double w = weight * norm_flatness[np][ml][indx]; // TODO: tweak?
histograms[np][bin] += w;
}
......
......@@ -5377,7 +5377,7 @@ public class TileProcessor {
clt_parameters.batch_run?-1:1, // -1, // debugLevel, // final int debugLevel)
clt_parameters.tileX,
clt_parameters.tileY);
// showDoubleFloatArrays sdfa_instance = null;
// showDoubleFloatArrays sdfa_instance = null; - already no state capitol plane
// if (debugLevel > -1) sdfa_instance = new showDoubleFloatArrays(); // just for debugging?
......
......@@ -4921,7 +4921,6 @@ if (debugLevel > -100) return true; // temporarily !
double disparity_offset,
QuadCLT quadCLT_main, // tiles should be set
QuadCLT quadCLT_aux,
// double [][] src_bimap,
double [] disparity,
double [] strength,
EyesisCorrectionParameters.CLTParameters clt_parameters,
......
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