Commit ada2ac85 authored by Andrey Filippov's avatar Andrey Filippov

testing/debugging diagonal swapping

parent 5d6289e3
This diff is collapsed.
......@@ -96,7 +96,7 @@ public class Conflicts {
{
for (int nsTile = 0; nsTile < conflicts.length; nsTile++) if (conflicts[nsTile] != null){
for (int nc = 0; nc < conflicts[nsTile].length; nc++){
Conflict conf = new Conflict(conflicts[nsTile][nc]);
Conflict conf = new Conflict(nsTile, conflicts[nsTile][nc]);
if (conf.getNumOrthoDiagOrthoConflicts() > 0) num_ortho_diag_ortho[conf.getNumOrthoDiagOrthoConflicts() - 1]++;
if (conf.getNumOrthoOrthoDiagConflicts() > 0) num_ortho_ortho_diag[conf.getNumOrthoOrthoDiagConflicts() - 1]++;
if (conf.getNumConflicts() > 0) num_all_conflicts[conf.getNumConflicts() - 1]++;
......@@ -153,14 +153,7 @@ public class Conflicts {
public void printConflict(String prefix, Conflict conf)
{
System.out.println(prefix+
" nl1 = "+ conf.getStartLayer()+
" nl2 = "+ conf.getEndLayer()+
" all = "+ conf.getNumConflicts() + " ("+String.format("%06x", conf.getDirBits())+")" +
" odo = "+ conf.getNumOrthoDiagOrthoConflicts() +
" ood = "+ conf.getNumOrthoOrthoDiagConflicts() +
" number of odo incompatible triangles = "+ conf.getIncompatibleOrthoDiagOrthoConflicts() +
" number of odo dual triangles = "+conf.getDualTriOrthoDiagOrthoConflicts());
System.out.println(prefix+conf.toString());
}
public int numBetterWorse(
......@@ -309,7 +302,7 @@ public class Conflicts {
int dir2 = (dir1 + 3) % 8;
int np3 = neibs2[dir2]; // planes[nsTile2][np2].getNeibBest(dir2);
if ((np3 >= 0) && (np3 != np0)){
Conflict conflict = new Conflict(np0, np3, dir/2);
Conflict conflict = new Conflict(nsTile0, np0, np3, dir/2);
label_apply:
{
for (Conflict conf_old:conflicts_list){
......@@ -335,7 +328,7 @@ public class Conflicts {
int dir2 = (dir1 + 3) % 8;
int np3 = neibs2[dir2]; // planes[nsTile2][np2].getNeibBest(dir2);
if ((np3 >= 0) && (np3 != np0)){
Conflict conflict = new Conflict(np0, np3, dir/2, true); // ood, right
Conflict conflict = new Conflict(nsTile0, np0, np3, dir/2, true); // ood, right
label_apply:
{
for (Conflict conf_old:conflicts_list){
......@@ -361,7 +354,7 @@ public class Conflicts {
int dir2 = (dir1 + 5) % 8;
int np3 = neibs2[dir2]; // planes[nsTile2][np2].getNeibBest(dir2);
if ((np3 >= 0) && (np3 != np0)){
Conflict conflict = new Conflict(np0, np3, dir/2, true); // ood, right
Conflict conflict = new Conflict(nsTile0, np0, np3, dir/2, false); // ood, left
label_apply:
{
for (Conflict conf_old:conflicts_list){
......
This diff is collapsed.
......@@ -3477,7 +3477,6 @@ public class TileProcessor {
int [] conflict_resoultion_results = st.resolveMultiTriangularConflicts(
conflicts0, // int [][][] conflicts,
conflicts0_stats,
clt_parameters.plMaxEigen,
clt_parameters.plStarOrtho, // double orthoWeight,
clt_parameters.plStarDiag, // double diagonalWeight,
clt_parameters.plDblTriLoss, // double diagonalWeight,
......@@ -3486,56 +3485,30 @@ public class TileProcessor {
clt_parameters.tileX,
clt_parameters.tileY);
System.out.println("Pass "+(pass+1)+": multi_tri_results (success/failures) = "+conflict_resoultion_results[0]+" / "+conflict_resoultion_results[1]);
if ((dual_tri_results[0] == 0) &&(conflict_resoultion_results[0] == 0)) break;
}
/*
int [] conflicts1_stats = st.getNumConflicts(
conflicts0,
1); // -1); // debugLevel);
st.printConflictSummary(conflicts1_stats);
*/
Conflicts conflicts1_stats = new Conflicts(
conflicts0,
st,
-1); // debugLevel);
conflicts1_stats.printConflictSummary("Detected conflicts (all):", true,false,false);
conflicts1_stats.printConflictSummary("Detected conflicts (ortho-diag-ortho):", false, true,false);
conflicts1_stats.printConflictSummary("Detected conflicts(ortho-ortho-diag):", false, false, true);
/*
for (int pass = 0; pass < 10; pass ++) {
int [] dual_tri_results = st. resolveDualTriangularConflicts(
int [] diagonal_resoultion_results = st.resolveDiagonalTriangularConflicts(
conflicts0, // int [][][] conflicts,
conflicts0_stats,
clt_parameters.plMaxEigen,
clt_parameters.plStarOrtho, // double orthoWeight,
clt_parameters.plStarDiag, // double diagonalWeight,
clt_parameters.plStarOrtho, // double orthoWeight,
clt_parameters.plStarDiag, // double diagonalWeight,
clt_parameters.plDblTriLoss, // double diagonalWeight,
clt_parameters.plPreferDisparity,
1, // final int debugLevel)
clt_parameters.tileX,
clt_parameters.tileY);
System.out.println("Pass "+(pass+1)+": dual_tri_results (success/failures) = "+dual_tri_results[0]+" / "+dual_tri_results[1]);
if (dual_tri_results[0] == 0) break;
System.out.println("Pass "+(pass+1)+": resolveDiagonalTriangularConflicts (success/failures) = "+diagonal_resoultion_results[0]+" / "+diagonal_resoultion_results[1]);
if ( (dual_tri_results[0] == 0) &&
(conflict_resoultion_results[0] == 0) &&
(diagonal_resoultion_results[0] == 0)) break;
}
conflicts1_stats = st.getNumConflicts(
Conflicts conflicts1_stats = new Conflicts(
conflicts0,
1); // -1); // debugLevel);
st.printConflictSummary(conflicts1_stats);
*/
/*
// re-checking conflicts (make sure update is correct)
int [][][] conflicts1r = st.detectTriangularConflicts(
1); // final int debugLevel)
int [] conflicts1r_stats = st.getNumConflicts(
conflicts1r,
-1); // debugLevel);
st.printConflictSummary(conflicts1r_stats);
*/
st,
1); // -1); // debugLevel);
conflicts1_stats.printConflictSummary("Detected conflicts (all):", true,false,false);
conflicts1_stats.printConflictSummary("Detected conflicts (ortho-diag-ortho):", false, true,false);
conflicts1_stats.printConflictSummary("Detected conflicts(ortho-ortho-diag):", false, false, true);
st.testResoveTriangle(
clt_parameters.plWorstWorsening, // final double worst_worsening,
......@@ -3549,8 +3522,6 @@ public class TileProcessor {
1, // final int debugLevel)
clt_parameters.tileX,
clt_parameters.tileY);
if (clt_parameters.plSplitApply) {
while (true) {
......
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