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
eaf09d11
Commit
eaf09d11
authored
Jun 27, 2021
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debugging lwir grids
parent
3cb7b435
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
MatchSimulatedPattern.java
.../com/elphel/imagej/calibration/MatchSimulatedPattern.java
+11
-10
No files found.
src/main/java/com/elphel/imagej/calibration/MatchSimulatedPattern.java
View file @
eaf09d11
...
@@ -4975,7 +4975,7 @@ public class MatchSimulatedPattern {
...
@@ -4975,7 +4975,7 @@ public class MatchSimulatedPattern {
final
int
threadsMax
,
final
int
threadsMax
,
final
boolean
updateStatus
,
final
boolean
updateStatus
,
final
int
debugLevel
)
{
final
int
debugLevel
)
{
final
int
debugThreshold
=
2
;
// -1; // 1; ** Restore 1
final
int
debugThreshold
=
1
;
// -1; // 1; ** Restore 1
if
((
debugThreshold
<
0
)
||
(
debugLevel
<
-
10000
))
{
if
((
debugThreshold
<
0
)
||
(
debugLevel
<
-
10000
))
{
System
.
out
.
println
(
"findPatternCandidates(): debugThreshold < 0 - restore when done"
);
System
.
out
.
println
(
"findPatternCandidates(): debugThreshold < 0 - restore when done"
);
}
}
...
@@ -5006,7 +5006,7 @@ public class MatchSimulatedPattern {
...
@@ -5006,7 +5006,7 @@ public class MatchSimulatedPattern {
.
getAndIncrement
())
.
getAndIncrement
())
if
(!
triedIndices
[
n
])
{
if
(!
triedIndices
[
n
])
{
if
(!
nodeQueue
.
isEmpty
())
if
(!
nodeQueue
.
isEmpty
())
break
;
// already set at least one element - does it work?
break
;
// already set at least one element - does it work?
Here - one per thread
nbh
=
tryHor
-
1
;
nbh
=
tryHor
-
1
;
nbv
=
tryVert
-
1
;
nbv
=
tryVert
-
1
;
nh
=
0
;
nh
=
0
;
...
@@ -5031,10 +5031,10 @@ public class MatchSimulatedPattern {
...
@@ -5031,10 +5031,10 @@ public class MatchSimulatedPattern {
if
((
nv
>
0
)
&&
(
nh
>
0
))
{
if
((
nv
>
0
)
&&
(
nh
>
0
))
{
point
[
0
]
=
(
selection
.
x
+
nh
*
selection
.
width
/
(
1
<<
tryHor
))
&
~
1
;
point
[
0
]
=
(
selection
.
x
+
nh
*
selection
.
width
/
(
1
<<
tryHor
))
&
~
1
;
point
[
1
]
=
(
selection
.
y
+
nv
*
selection
.
height
/
(
1
<<
tryVert
))
&
~
1
;
point
[
1
]
=
(
selection
.
y
+
nv
*
selection
.
height
/
(
1
<<
tryVert
))
&
~
1
;
if
(
debugLevel
>
2
)
if
(
debugLevel
>
1
)
// was 2
System
.
out
.
println
(
"trying xc="
+
point
[
0
]
+
", yc="
+
point
[
1
]
+
"(nv="
+
nv
System
.
out
.
println
(
"trying xc="
+
point
[
0
]
+
", yc="
+
point
[
1
]
+
"(nv="
+
nv
+
", nh="
+
nh
+
")"
);
+
", nh="
+
nh
+
")"
);
if
(
debugLevel
>
2
)
if
(
debugLevel
>
1
)
// was 2
System
.
out
.
println
(
debugNumThread
+
":"
+
n
+
" >> "
);
System
.
out
.
println
(
debugNumThread
+
":"
+
n
+
" >> "
);
double
[][]
node
=
tryPattern
(
double
[][]
node
=
tryPattern
(
lwirReaderParameters
,
// LwirReaderParameters lwirReaderParameters, null is OK
lwirReaderParameters
,
// LwirReaderParameters lwirReaderParameters, null is OK
...
@@ -6830,10 +6830,10 @@ public class MatchSimulatedPattern {
...
@@ -6830,10 +6830,10 @@ public class MatchSimulatedPattern {
}
}
}
}
this
.
debugLevel
=
global_debug_level
;
this
.
debugLevel
=
global_debug_level
;
int
patternCells
=
0
;
int
patternCells
=
0
+
0
;
// save initial distortionParameters.correlationMinInitialContrast
// save initial distortionParameters.correlationMinInitialContrast
double
savedCorrelationMinInitialContrast
=
distortionParameters
.
correlationMinInitialContrast
;
double
savedCorrelationMinInitialContrast
=
distortionParameters
.
correlationMinInitialContrast
;
int
reTries
=
1
0
;
// bail out after these attempts
int
reTries
=
5
0
;
// bail out after these attempts
boolean
foundGoodCluster
=
false
;
boolean
foundGoodCluster
=
false
;
int
tryHor
=
0
,
tryVert
=
0
;
int
tryHor
=
0
,
tryVert
=
0
;
...
@@ -6981,16 +6981,17 @@ public class MatchSimulatedPattern {
...
@@ -6981,16 +6981,17 @@ public class MatchSimulatedPattern {
}
}
// Test number of cells with contrast > (~10.0) and fail if number Of over threshold is below minimal_pattern_cluster?
// Test number of cells with contrast > (~10.0) and fail if number Of over threshold is below minimal_pattern_cluster?
patternCells
=
numDefinedCells
();
patternCells
=
numDefinedCells
();
if
((
roi
!=
null
)
&&
(
patternCells
<
minimal_pattern_cluster
)
&&
!(
roi
instanceof
PointRoi
))
{
// if ((roi != null) && (patternCells < minimal_pattern_cluster) && !(roi instanceof PointRoi)) {
if
(
global_debug_level
>
(
debugThreshold
+
0
))
if
(
patternCells
<
minimal_pattern_cluster
)
{
// retry regardless of ROI
if
(
global_debug_level
>
(
debugThreshold
-
1
))
System
.
out
.
println
(
"Detected pattern is too small: "
+
patternCells
+
", minimum is set to "
System
.
out
.
println
(
"Detected pattern is too small: "
+
patternCells
+
", minimum is set to "
+
minimal_pattern_cluster
+
". Will try again search for a new start point."
);
+
minimal_pattern_cluster
+
". Will try again search for a new start point."
);
//return distortionParameters.errTooFewCells; // -10
//return distortionParameters.errTooFewCells; // -10
continue
;
continue
;
}
}
patternCells
=
numStrongCells
(
threshold_contrast
);
patternCells
=
numStrongCells
(
threshold_contrast
);
if
(
(
roi
!=
null
)
&&
(
patternCells
<
threshold_number
)
&&
!(
roi
instanceof
PointRoi
))
{
if
(
patternCells
<
threshold_number
)
{
// retry regardless of ROI
if
(
global_debug_level
>
(
debugThreshold
+
0
))
if
(
global_debug_level
>
(
debugThreshold
-
1
))
System
.
out
.
println
(
"Detected pattern has too few strong cells (with contrast > "
+
threshold_contrast
+
System
.
out
.
println
(
"Detected pattern has too few strong cells (with contrast > "
+
threshold_contrast
+
"): "
+
patternCells
+
", minimum number is set to "
"): "
+
patternCells
+
", minimum number is set to "
+
threshold_number
+
". Will try again search for a new start point."
);
+
threshold_number
+
". Will try again search for a new start point."
);
...
...
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