Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
imagej-elphel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
imagej-elphel
Commits
a2023862
Commit
a2023862
authored
Nov 20, 2014
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more debugging grid detection
parent
105ebd82
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
MatchSimulatedPattern.java
src/main/java/MatchSimulatedPattern.java
+9
-4
No files found.
src/main/java/MatchSimulatedPattern.java
View file @
a2023862
...
...
@@ -3154,7 +3154,7 @@ public class MatchSimulatedPattern {
// double [][][] nodes=null;
Queue<GridNode> nodeQueue = new ConcurrentLinkedQueue<GridNode>();
boolean fromVeryBeginning=true;
for
(
int
i
=
3
;
i
<
triedIndices
.
length
;
i
++)
if
(
triedIndices
[
i
]){
// do not count f
o
rst three
for (int i=3;i<triedIndices.length;i++) if (triedIndices[i]){ // do not count f
i
rst three
fromVeryBeginning=false;
break;
}
...
...
@@ -3283,7 +3283,7 @@ public class MatchSimulatedPattern {
System.out.println("All start points tried");
int numLeft=0;
for (boolean b:triedIndices) if (!b) numLeft++;
System
.
out
.
println
(
"startScanIndex="
+
startScanIndex
+
" numTries="
+
numTries
+
" numLeft="
+
numLeft
);
System.out.println("
nodeQueue.isEmpty(),
startScanIndex="+startScanIndex+" numTries="+numTries+" numLeft="+numLeft);
}
triedIndices[numTries]=true; // all tried
} else {
...
...
@@ -4040,7 +4040,7 @@ public class MatchSimulatedPattern {
int nbh, nbv, nh, nv, nb;
double [] point = new double[2];
for (int n=seqNumber.getAndIncrement(); n<(triedIndices.length-1); n=seqNumber.getAndIncrement()) if (!triedIndices[n]){
if
(!
nodeQueue
.
isEmpty
())
break
;
// already set at least one element
if (!nodeQueue.isEmpty()) break; // already set at least one element
- does it work?
nbh=tryHor-1;
nbv=tryVert-1;
nh=0;
...
...
@@ -4083,7 +4083,8 @@ public class MatchSimulatedPattern {
);
if ((node!=null) && (node[0]!=null)) {
nodeQueue.add(new GridNode(node));
if
(
debugLevel
>
1
)
System
.
out
.
println
(
"adding candidate "
+
n
+
" x0="
+
point
[
0
]+
" y0="
+
point
[
1
]+
" -> "
+
node
[
0
][
0
]+
"/"
+
node
[
0
][
1
]);
// if (debugLevel>1) System.out.println("adding candidate "+n+" x0="+point[0]+" y0="+point[1]+" -> "+ node[0][0]+"/"+node[0][1]);
if (debugLevel>0) System.out.println("adding candidate "+n+" x0="+point[0]+" y0="+point[1]+" -> "+ node[0][0]+"/"+node[0][1]+" seqNumber.get()="+seqNumber.get()+" n="+n);
}
}
triedIndices[n]=true; // regardless - good or bad
...
...
@@ -4093,6 +4094,10 @@ public class MatchSimulatedPattern {
}
startAndJoin(threads);
// if (nodeQueue.isEmpty()) return null;
if (debugLevel>0){
System.out.println("seqNumber after join is "+seqNumber.get());
}
if (seqNumber.get()>=(triedIndices.length-1) ) triedIndices[triedIndices.length-1]=true; // all tried
return nodeQueue; // never null, may be empty
// double [][][] nodes = new double [nodeQueue.size()][][];
// for (int i=0;i<nodes.length;i++) nodes[i]=nodeQueue.poll().getNode();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment