Commit 9ca65083 authored by Andrey Filippov's avatar Andrey Filippov

debugging

parent 5c63b739
...@@ -11,6 +11,8 @@ import java.util.ArrayList; ...@@ -11,6 +11,8 @@ import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import java.nio.file.Paths; import java.nio.file.Paths;
...@@ -5632,8 +5634,8 @@ public class CuasMotion { ...@@ -5632,8 +5634,8 @@ public class CuasMotion {
if (dbg_tile >=0) { if (dbg_tile >=0) {
System.out.println("calcMathingTargetsLengths().0 max_mismatch="+max_mismatch+", max_mismatch2="+max_mismatch2); System.out.println("calcMathingTargetsLengths().0 max_mismatch="+max_mismatch+", max_mismatch2="+max_mismatch2);
} }
int num_grp_before = 0;
final double [][][][][] bbox_ba = new double [2][num_seq][num_tiles][][]; // minx, miny, maxx, maxy final double [][][][][] bbox_ba = new double [2][num_seq][num_tiles][][]; // minx, miny, maxx, maxy
for (int aba = 0; aba <=1; aba++) {// first pass - calculating connected keyframes before each current keyframe tile/target alternative for (int aba = 0; aba <=1; aba++) {// first pass - calculating connected keyframes before each current keyframe tile/target alternative
final int ba = aba; final int ba = aba;
for (int nseq = 0; nseq < num_seq; nseq++) { for (int nseq = 0; nseq < num_seq; nseq++) {
...@@ -5758,11 +5760,27 @@ public class CuasMotion { ...@@ -5758,11 +5760,27 @@ public class CuasMotion {
} }
ImageDtt.startAndJoin(threads); ImageDtt.startAndJoin(threads);
} }
System.out.println("calcMatchingTargetsLengths(): ba="+ba+", agrp="+agrp); if (ba == 0) {
num_grp_before = agrp.get();
}
System.out.println("calcMatchingTargetsLengths(): ba="+ba+", agrp="+agrp.get());
} }
/*
// final ArrayList<ConcurrentLinkedQueue<Integer>> cqueue_list = new ArrayList<ConcurrentLinkedQueue<Integer>>();
// final ConcurrentLinkedQueue<ConcurrentLinkedQueue<Integer>> cqueue_list = new ConcurrentLinkedQueue<ConcurrentLinkedQueue<Integer>>();
final ConcurrentLinkedQueue<Integer> [] cqueue_arr = new ConcurrentLinkedQueue<Integer>[num_grp_before];
for (int bgrp = 1; bgrp < num_grp_before; bgrp++) {
cqueue_list.add(new ConcurrentLinkedQueue<Integer>());
}
*/
final int len_grp_before = num_grp_before;
final int len_grp_after = agrp.get()-len_grp_before;
final boolean [] pairs = new boolean [(len_grp_before -1) * len_grp_after];
ai.set(0); ai.set(0);
// combine before/after into a single value // combine before/after into a single value
for (int ithread = 0; ithread < threads.length; ithread++) { for (int ithread = 0; ithread < threads.length; ithread++) {
threads[ithread] = new Thread() { threads[ithread] = new Thread() {
...@@ -5801,6 +5819,16 @@ public class CuasMotion { ...@@ -5801,6 +5819,16 @@ public class CuasMotion {
if (MM_AFTER <= good_mismatch) { if (MM_AFTER <= good_mismatch) {
target[CuasMotionLMA.RSLT_QMATCH] += Math.max(0,(good_mismatch - MM_AFTER)/good_mismatch); // 0 .. 1 target[CuasMotionLMA.RSLT_QMATCH] += Math.max(0,(good_mismatch - MM_AFTER)/good_mismatch); // 0 .. 1
} }
int grp_before = target_grp[0][nSeq][ntile][ntarg]-1;
int grp_after = target_grp[1][nSeq][ntile][ntarg] - len_grp_before;
int indx = grp_after + grp_before * len_grp_after;
pairs[indx] = true;
/*
ConcurrentLinkedQueue<Integer> cqueue = cqueue_list.get(grp_before-1);
if (!cqueue.contains(grp_after)) {
cqueue.add(grp_after);
}
*/
if (ntile == dbg_tile) { if (ntile == dbg_tile) {
System.out.println("calcMathingTargetsLengths().4 nSeq = "+nSeq+", targets["+ntarg+"][CuasMotionLMA.RSLT_MATCH_LENGTH]="+ System.out.println("calcMathingTargetsLengths().4 nSeq = "+nSeq+", targets["+ntarg+"][CuasMotionLMA.RSLT_MATCH_LENGTH]="+
target[CuasMotionLMA.RSLT_MATCH_LENGTH]+", travel="+target[CuasMotionLMA.RSLT_SEQ_TRAVEL]); target[CuasMotionLMA.RSLT_MATCH_LENGTH]+", travel="+target[CuasMotionLMA.RSLT_SEQ_TRAVEL]);
......
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