Commit 3a9193c3 authored by Andrey Filippov's avatar Andrey Filippov

tested refactoring

parent 3ead1b3d
This diff is collapsed.
...@@ -6835,23 +6835,11 @@ public class SuperTiles{ ...@@ -6835,23 +6835,11 @@ public class SuperTiles{
/** /**
* Find mutual links between multi-layer planes for supertiles. requires that for each plane there are calculated smalles eigenvalues * Find mutual links between multi-layer planes for supertiles. requires that for each plane there are calculated smalles eigenvalues
* for merging with each plane for each of 8 neighbors * for merging with each plane for each of 8 neighbors
* @param rquality maximal degradation by merging (does not depend on the total weight)
* @param okMergeEigen if result eigenvalue of the merged planes is below, OK to bypass worst worsening
* @param maxWorldSin2 maximal square of the sine of the angle between the planes to allow merge (>= 1.0 - disable)
* @param maxEigen maximal eigenvalue of each of the merged planes
* @param minWeight minimal weight of each of the planes
* @param debugLevel debug level * @param debugLevel debug level
* @param dbg_X debug supertile X coordinate * @param dbg_X debug supertile X coordinate
* @param dbg_Y debug supertile Y coordinate * @param dbg_Y debug supertile Y coordinate
*/ */
public void selectNeighborPlanesMutual( public void selectNeighborPlanesMutual(
// final double rquality,
// final double weakWorsening,
// final double okMergeEigen,
// final double maxWorldSin2,
// final double dispNorm,
// final double maxEigen, // maximal eigenvalue of planes to consider
// final double minWeight, // minimal pain weight to consider
final double eigenFloor, // Add to eigenvalues of each participating plane and result to validate connections final double eigenFloor, // Add to eigenvalues of each participating plane and result to validate connections
final int debugLevel, final int debugLevel,
final int dbg_X, final int dbg_X,
......
...@@ -3343,7 +3343,7 @@ public class TileProcessor { ...@@ -3343,7 +3343,7 @@ public class TileProcessor {
// moved here // moved here
if (clt_parameters.dbg_migrate) { // if (clt_parameters.dbg_migrate) {
// separate each supertile data into clusters, trying both horizontal and perpendicular to view planes // separate each supertile data into clusters, trying both horizontal and perpendicular to view planes
double [] world_hor = {0.0, 1.0, 0.0}; double [] world_hor = {0.0, 1.0, 0.0};
st.processPlanes5( st.processPlanes5(
...@@ -3380,7 +3380,7 @@ public class TileProcessor { ...@@ -3380,7 +3380,7 @@ public class TileProcessor {
0, // -1, // debugLevel, // final int debugLevel) 0, // -1, // debugLevel, // final int debugLevel)
clt_parameters.tileX, clt_parameters.tileX,
clt_parameters.tileY); clt_parameters.tileY);
} else { /* } else {
st.processPlanes4( st.processPlanes4(
clt_parameters.stMeasSel, // = 1 //Select measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert clt_parameters.stMeasSel, // = 1 //Select measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
clt_parameters.plDispNorm, // = 2.0; // Normalize disparities to the average if above clt_parameters.plDispNorm, // = 2.0; // Normalize disparities to the average if above
...@@ -3406,10 +3406,44 @@ public class TileProcessor { ...@@ -3406,10 +3406,44 @@ public class TileProcessor {
clt_parameters.tileX, clt_parameters.tileX,
clt_parameters.tileY); clt_parameters.tileY);
} }
*/
showDoubleFloatArrays sdfa_instance = null; showDoubleFloatArrays sdfa_instance = null;
if (debugLevel > -1) sdfa_instance = new showDoubleFloatArrays(); // just for debugging? if (debugLevel > -1) sdfa_instance = new showDoubleFloatArrays(); // just for debugging?
if (clt_parameters.dbg_migrate) {
// Trying new class
LinkPlanes lp = new LinkPlanes (clt_parameters, st);
lp.matchPlanes(
st.planes, // final TilePlanes.PlaneData [][] planes,
2, // -1, // debugLevel, // final int debugLevel)
clt_parameters.tileX,
clt_parameters.tileY);
lp.filterNeighborPlanes(
st.planes, // final TilePlanes.PlaneData [][] planes,
2, // -1, // debugLevel, // final int debugLevel)
clt_parameters.tileX,
clt_parameters.tileY);
int [][][] merge_candidates = lp.getMergeSameTileCandidates(
st.planes, // final TilePlanes.PlaneData [][] planes,
2, // -1, // debugLevel, // final int debugLevel)
clt_parameters.tileX,
clt_parameters.tileY);
boolean [][] pairs_to_merge = lp.mergeSameTileEvaluate(
st.planes, // final TilePlanes.PlaneData [][] planes,
merge_candidates, // final int [][][] merge_candidates,
2, // -1, // debugLevel, // final int debugLevel)
clt_parameters.tileX,
clt_parameters.tileY);
System.out.println(pairs_to_merge.length);
lp.selectNeighborPlanesMutual(
st.planes, // final TilePlanes.PlaneData [][] planes,
0, // final int debugLevel)
clt_parameters.tileX,
clt_parameters.tileY);
} else {
st.matchPlanes( st.matchPlanes(
clt_parameters.plPreferDisparity, clt_parameters.plPreferDisparity,
0, // debugLevel 0, // debugLevel
...@@ -3431,7 +3465,6 @@ public class TileProcessor { ...@@ -3431,7 +3465,6 @@ public class TileProcessor {
0, // final int debugLevel) 0, // final int debugLevel)
clt_parameters.tileX, clt_parameters.tileX,
clt_parameters.tileY); clt_parameters.tileY);
/* */
int [][][] merge_candidates = st.getMergeSameTileCandidates( int [][][] merge_candidates = st.getMergeSameTileCandidates(
2, // final int debugLevel, 2, // final int debugLevel,
...@@ -3456,28 +3489,12 @@ public class TileProcessor { ...@@ -3456,28 +3489,12 @@ public class TileProcessor {
clt_parameters.tileX, clt_parameters.tileX,
clt_parameters.tileY); clt_parameters.tileY);
st.selectNeighborPlanesMutual( st.selectNeighborPlanesMutual(
clt_parameters.plEigenFloor, // final double eigenFloor, // Add to eigenvalues of each participating plane and result to validate connections clt_parameters.plEigenFloor, // final double eigenFloor, // Add to eigenvalues of each participating plane and result to validate connections
0, // final int debugLevel) 0, // final int debugLevel)
clt_parameters.tileX, clt_parameters.tileX,
clt_parameters.tileY); clt_parameters.tileY);
/* }
st.selectNeighborPlanesMutual_old(
clt_parameters.plWorstWorsening, // final double worst_worsening,
clt_parameters.plWeakWorsening, // final double worst_worsening,
clt_parameters.plOKMergeEigen, // final double okMergeEigen,
clt_parameters.plMaxWorldSin2, // final double maxWorldSin2,
clt_parameters.plDispNorm,
clt_parameters.plMaxEigen,
clt_parameters.plEigenFloor, // final double eigenFloor, // Add to eigenvalues of each participating plane and result to validate connections
clt_parameters.plMinStrength,
0, // final int debugLevel)
clt_parameters.tileX,
clt_parameters.tileY);
*/
st.resolveConflicts( st.resolveConflicts(
clt_parameters.plMaxEigen, clt_parameters.plMaxEigen,
clt_parameters.plConflDualTri, // boolean conflDualTri, // Resolve dual triangles conflict (odoodo) clt_parameters.plConflDualTri, // boolean conflDualTri, // Resolve dual triangles conflict (odoodo)
...@@ -3580,7 +3597,8 @@ public class TileProcessor { ...@@ -3580,7 +3597,8 @@ public class TileProcessor {
clt_parameters.plMaxOutliers, // final int maxOutliers, // = 20; // Maximal number of outliers to remove clt_parameters.plMaxOutliers, // final int maxOutliers, // = 20; // Maximal number of outliers to remove
clt_parameters.stFloor, // final double strength_floor, clt_parameters.stFloor, // final double strength_floor,
clt_parameters.stPow, // final double strength_pow, clt_parameters.stPow, // final double strength_pow,
clt_parameters.dbg_migrate && clt_parameters.stSmplMode , // final boolean smplMode, // = true; // Use sample mode (false - regular tile mode) // clt_parameters.dbg_migrate && clt_parameters.stSmplMode , // final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
clt_parameters.stSmplMode , // final boolean smplMode, // = true; // Use sample mode (false - regular tile mode)
clt_parameters.stSmplSide , // final int smplSide, // = 2; // Sample size (side of a square) clt_parameters.stSmplSide , // final int smplSide, // = 2; // Sample size (side of a square)
clt_parameters.stSmplNum , // final int smplNum, // = 3; // Number after removing worst clt_parameters.stSmplNum , // final int smplNum, // = 3; // Number after removing worst
clt_parameters.stSmplRms , // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample clt_parameters.stSmplRms , // final double smplRms, // = 0.1; // Maximal RMS of the remaining tiles in a sample
......
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