Commit 369937de authored by Andrey Filippov's avatar Andrey Filippov

debugging ndew code

parent b569637d
......@@ -2210,6 +2210,10 @@ public class EyesisCorrectionParameters {
public double plSnapDispWeight = .5; // Maximal disparity diff. by weight product to snap to plane
public int plSnapZeroMode = 1; // Zero strength snap mode: 0: no special treatment, 1 - strongest, 2 - farthest
public boolean msUseSel = true; // Use planes selection masks (generated when splitting to intersecting pairs
public boolean msDivideByArea = true; // Divide plane strengths by ellipsoid area
public double msScaleProj = 1.5; // Scale projection of the plane ellkipsoid
public boolean replaceWeakOutlayers = true; // false;
public boolean dbg_migrate = true;
......@@ -2509,6 +2513,10 @@ public class EyesisCorrectionParameters {
properties.setProperty(prefix+"plSnapDispWeight", this.plSnapDispWeight +"");
properties.setProperty(prefix+"plSnapZeroMode", this.plSnapZeroMode+"");
properties.setProperty(prefix+"msUseSel", this.msUseSel+"");
properties.setProperty(prefix+"msDivideByArea", this.msDivideByArea+"");
properties.setProperty(prefix+"msScaleProj", this.msScaleProj +"");
properties.setProperty(prefix+"dbg_migrate", this.dbg_migrate+"");
properties.setProperty(prefix+"show_ortho_combine", this.show_ortho_combine+"");
......@@ -2800,7 +2808,12 @@ public class EyesisCorrectionParameters {
if (properties.getProperty(prefix+"plSnapDispMax")!=null) this.plSnapDispMax=Double.parseDouble(properties.getProperty(prefix+"plSnapDispMax"));
if (properties.getProperty(prefix+"plSnapDispWeight")!=null) this.plSnapDispWeight=Double.parseDouble(properties.getProperty(prefix+"plSnapDispWeight"));
if (properties.getProperty(prefix+"plSnapZeroMode")!=null) this.plPrecision=Integer.parseInt(properties.getProperty(prefix+"plSnapZeroMode"));
if (properties.getProperty(prefix+"msUseSel")!=null) this.msUseSel=Boolean.parseBoolean(properties.getProperty(prefix+"msUseSel"));
if (properties.getProperty(prefix+"msDivideByArea")!=null) this.msDivideByArea=Boolean.parseBoolean(properties.getProperty(prefix+"msDivideByArea"));
if (properties.getProperty(prefix+"msScaleProj")!=null) this.msScaleProj=Double.parseDouble(properties.getProperty(prefix+"msScaleProj"));
if (properties.getProperty(prefix+"dbg_migrate")!=null) this.dbg_migrate=Boolean.parseBoolean(properties.getProperty(prefix+"dbg_migrate"));
if (properties.getProperty(prefix+"show_ortho_combine")!=null) this.show_ortho_combine=Boolean.parseBoolean(properties.getProperty(prefix+"show_ortho_combine"));
......@@ -3117,6 +3130,10 @@ public class EyesisCorrectionParameters {
gd.addNumericField("Maximal (scaled by plDispNorm) disparity difference to snap to plane at low strength", this.plSnapDispMax, 6);
gd.addNumericField("Maximal disparity diff. by weight product to snap to plane", this.plSnapDispWeight, 6);
gd.addNumericField("Zero strength snap mode: 0: no special treatment, 1 - strongest, 2 - farthest",this.plSnapZeroMode, 0);
gd.addCheckbox ("Use planes selection masks (generated when splitting to intersecting pairs", this.msUseSel);
gd.addCheckbox ("Divide plane strengths by ellipsoid area", this.msDivideByArea);
gd.addNumericField("Scale projection of the plane ellipsoid", this.msScaleProj, 6);
gd.addCheckbox ("Test new mode after migration", this.dbg_migrate);
......@@ -3417,6 +3434,10 @@ public class EyesisCorrectionParameters {
this.plSnapDispWeight= gd.getNextNumber();
this.plSnapZeroMode= (int) gd.getNextNumber();
this.msUseSel= gd.getNextBoolean();
this.msDivideByArea= gd.getNextBoolean();
this.msScaleProj= gd.getNextNumber();
this.dbg_migrate= gd.getNextBoolean();
this.show_ortho_combine= gd.getNextBoolean();
......
......@@ -21,12 +21,12 @@
** -----------------------------------------------------------------------------**
**
*/
import java.awt.Point;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.concurrent.atomic.AtomicInteger;
//import java.awt.Point;
//import java.util.ArrayList;
......@@ -124,8 +124,8 @@ public class SuperTiles{
for (bin = 0; bin < numBins; bin ++){
bin_centers[bin] = binToDisparity(bin);
}
initFuseCoeff(0.5, true); // true);
// initFuseCoeff(0.5, false); // true);
// initFuseCoeff(0.5, true); // true);
initFuseCoeff(0.5, false); // true);
// Set up MeasuredLayers
measuredLayers = new MeasuredLayers(
......@@ -1566,7 +1566,7 @@ public class SuperTiles{
data [nd] = new double [4* superTileSize*superTileSize];
for (int i = 0; i < data[nd].length; i++){
data [nd][i] = Double.NaN;
for (int np = 0; np < num_p; np++) if ((selections [np] != null) && selections [np][ml][i]){
for (int np = 0; np < num_p; np++) if ((selections [np] != null) && (selections [np][ml] != null) && selections [np][ml][i]){
data [nd][i] = np + 1;
break;
}
......@@ -1972,7 +1972,7 @@ public class SuperTiles{
}
}
if (dl > 2) {
if (dl > 3) {
String [] dbg_titles = showSupertileSeparationTitles( disp_strength, plane_sels);
double [][] dbg_img = showSupertileSeparation(disp_strength, plane_sels);
showDoubleFloatArrays sdfa_instance = new showDoubleFloatArrays();
......@@ -2451,6 +2451,10 @@ public class SuperTiles{
final double max_diff_vert, // maximal disparity difference (to assign to a cluster (of Double.NaN) at first run for vertical plane
final int max_tries, // on last run - assign all rfemaining pixels to some cluster (disregard max_diff)
final boolean msUseSel, // final boolean use_sel,
final boolean msDivideByArea, // final boolean divide_by_area,
final double msScaleProj, // final double scale_projection,
final double smallDiff, // = 0.4; // Consider merging initial planes if disparity difference below
final double highMix, //stHighMix = 0.4; // Consider merging initial planes if jumps between ratio above
final double [] world_hor, // horizontal plane normal (default [0.0, 1.0, 0.0])
......@@ -2531,7 +2535,27 @@ public class SuperTiles{
debugLevel, // final int debugLevel,
dbg_X, // final int dbg_X,
dbg_Y); // final int dbg_Y)
this.planes = new_planes; // save as "measured" (as opposed to "smoothed" by neighbors) planes
this.planes = new_planes; // save as "measured" (as opposed to "smoothed" by neighbors) planes
/*
TileSurface tileSurface = new TileSurface(
tileProcessor.getTileSize(), // int tileSize,
tileProcessor.getSuperTileSize(), // int superTileSize,
tileProcessor.getTilesX(), // int tilesX,
tileProcessor.getTilesY(), // int tilesY,
geometryCorrection, // GeometryCorrection geometryCorrection,
tileProcessor.threadsMax); // int threadsMax);
TileSurface.TileData [][] tileData = tileSurface.createTileShells (
msUseSel, // final boolean use_sel,
msDivideByArea, // final boolean divide_by_area,
msScaleProj, // final double scale_projection,
this.planes, // final TilePlanes.PlaneData [][] planes,
debugLevel, // final int debugLevel,
dbg_X, // final int dbg_X,
dbg_Y); // final int dbg_Y)
*/
}
......
......@@ -1487,7 +1487,7 @@ public class TilePlanes {
double scale_projection,
int debugLevel)
{
double [][] disp_strength = new double[2][superTileSize*superTileSize];
double [][] disp_strength = new double[2][4*superTileSize*superTileSize];
double [] normal = getVector();
double [] zxy = getZxy(); // {disparity, x center in pixels, y center in pixels (relative to a supertile center)
double weight = getWeight();
......@@ -1533,10 +1533,12 @@ public class TilePlanes {
{ss2, ss4, 0, ss2, -ss2, ss2 }, // NE
{ 0, ss4, 0, ss2, 0, ss2 }, // E
{ 0, ss2, 0, ss2, ss2, ss2 }, // SE
{ 0, ss2, 0, ss2, ss2, 0 }, // S
// { 0, ss2, 0, ss2, ss2, 0 }, // S
{ 0, ss2, 0, ss4, ss2, 0 }, // S
{ 0, ss2, ss2, ss4, ss2, -ss2 }, // SW
{ 0, ss4, ss2, ss4, 0, -ss2 }, // W
{ss2, ss4, 0, ss4, -ss2, -ss2 }}; // NW
// {ss2, ss4, 0, ss4, -ss2, -ss2 }}; // NW
{ss2, ss4, ss2, ss4, -ss2, -ss2 }}; // NW
int dir1 = dir + 1;
// for (int sy = -superTileSize; sy < superTileSize; sy++){
......
......@@ -3066,6 +3066,11 @@ public class TileProcessor {
clt_parameters.plMaxDiffVert, // final double max_diff_vert, // maximal disparity difference (to assign to a cluster (of Double.NaN) at first run for vertical plane
clt_parameters.plInitPasses, // final int max_tries, // on last run - assign all rfemaining pixels to some cluster (disregard max_diff)
clt_parameters.msUseSel, // final boolean msUseSel, // final boolean use_sel,
clt_parameters.msDivideByArea, // final boolean msDivideByArea, // final boolean divide_by_area,
clt_parameters.msScaleProj, //final double msScaleProj, // final double scale_projection,
clt_parameters.stSmallDiff, // = 0.4; // Consider merging initial planes if disparity difference below
clt_parameters.stHighMix, // stHighMix = 0.4; // Consider merging initial planes if jumps between ratio above
world_hor, // final double [] world_hor, // horizontal plane normal (default [0.0, 1.0, 0.0])
......@@ -3154,7 +3159,38 @@ public class TileProcessor {
}
if (num_added == 0) break;
}
}
}
TileSurface tileSurface = new TileSurface(
st.tileProcessor.getTileSize(), // int tileSize,
st.tileProcessor.getSuperTileSize(), // int superTileSize,
st.tileProcessor.getTilesX(), // int tilesX,
st.tileProcessor.getTilesY(), // int tilesY,
geometryCorrection, // GeometryCorrection geometryCorrection,
st.tileProcessor.threadsMax); // int threadsMax);
TileSurface.TileData [][] tileData = tileSurface.createTileShells (
clt_parameters.msUseSel, // final boolean use_sel,
clt_parameters.msDivideByArea, // final boolean divide_by_area,
clt_parameters.msScaleProj, // final double scale_projection,
st.planes, // final TilePlanes.PlaneData [][] planes,
0, // -1, // debugLevel, // final int debugLevel)
clt_parameters.tileX,
clt_parameters.tileY);
/*
clt_parameters.msUseSel, // final boolean msUseSel, // final boolean use_sel,
clt_parameters.msDivideByArea, // final boolean msDivideByArea, // final boolean divide_by_area,
clt_parameters.msScaleProj, //final double msScaleProj, // final double scale_projection,
*/
TilePlanes.PlaneData[][][] split_planes = // use original (measured planes. See if smoothed are needed here)
st.breakPlanesToPairs(
......
This diff is collapsed.
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