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
7a4f9f53
Commit
7a4f9f53
authored
May 25, 2026
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enforcing phase 1 long exposure for slow targets
parent
643c20b0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
17 deletions
+39
-17
CuasMotion.java
src/main/java/com/elphel/imagej/cuas/CuasMotion.java
+19
-7
CuasMotionLMA.java
src/main/java/com/elphel/imagej/cuas/CuasMotionLMA.java
+8
-7
IntersceneMatchParameters.java
...lphel/imagej/tileprocessor/IntersceneMatchParameters.java
+12
-3
No files found.
src/main/java/com/elphel/imagej/cuas/CuasMotion.java
View file @
7a4f9f53
...
...
@@ -1031,7 +1031,7 @@ public class CuasMotion {
if
(
npar
>=
0
&&
npar
<
multi_targets
[
nseq
][
ntile
][
ntarg
].
length
)
{
double
val
=
multi_targets
[
nseq
][
ntile
][
ntarg
][
npar
];
targObj
.
put
(
CuasMotionLMA
.
LMA_TITLES
[
npar
],
val
);
// By Claude on 05/08/2026
if
(!
Double
.
isNaN
(
val
))
{
if
(!
Double
.
isNaN
(
val
)
&&
!
Double
.
isInfinite
(
val
)
)
{
if
(!(
val
>=
minMax
[
pi
][
0
]))
minMax
[
pi
][
0
]
=
val
;
if
(!(
val
<=
minMax
[
pi
][
1
]))
minMax
[
pi
][
1
]
=
val
;
}
...
...
@@ -1290,7 +1290,8 @@ public class CuasMotion {
//
default
:
System
.
out
.
print
(
String
.
format
(
"%"
+
fw
+
"f"
,
multi_targets
[
nseq
][
ntile
][
ntarg
][
npar
]));
if
(!
Double
.
isNaN
(
multi_targets
[
nseq
][
ntile
][
ntarg
][
npar
]))
{
if
(!
Double
.
isNaN
(
multi_targets
[
nseq
][
ntile
][
ntarg
][
npar
])
&&
!
Double
.
isInfinite
(
multi_targets
[
nseq
][
ntile
][
ntarg
][
npar
]))
{
if
(!(
multi_targets
[
nseq
][
ntile
][
ntarg
][
npar
]
>=
min_max
[
0
]))
{
min_max
[
0
]
=
multi_targets
[
nseq
][
ntile
][
ntarg
][
npar
];
}
...
...
@@ -6711,6 +6712,7 @@ public class CuasMotion {
* @param target_multi target data to be modified [nseq][ntile][ntarget][nparam]
* @param niter current iteration number, will be applied to [RSLT_WHEN]
* @param min_mscore minimal value for [RSLT_MSCORE]
* @param early_boosts enforce boosted exposure for boosted motion
* @param min_vstr minimal value for [RSLT_VSTR]
* @param min_score minimal value for [RSLT_QSCORE]
* @param min_amp minimal value for [RSLT_A]
...
...
@@ -6719,6 +6721,7 @@ public class CuasMotion {
public
static
int
[]
earlyFail
(
// Fail after Phase 1
final
double
[][][][]
target_multi
,
final
int
niter
,
final
boolean
early_boosts
,
final
double
min_mscore
,
final
double
min_vstr
,
final
double
min_score
,
...
...
@@ -6727,7 +6730,8 @@ public class CuasMotion {
final
int
num_tiles
=
target_multi
[
0
].
length
;
final
Thread
[]
threads
=
ImageDtt
.
newThreadArray
();
final
AtomicInteger
ai
=
new
AtomicInteger
(
0
);
final
AtomicInteger
afail
=
new
AtomicInteger
(
0
);
final
AtomicInteger
afail
=
new
AtomicInteger
(
0
);
final
AtomicInteger
aboosts
=
new
AtomicInteger
(
0
);
final
AtomicInteger
amscore
=
new
AtomicInteger
(
0
);
final
AtomicInteger
avstr
=
new
AtomicInteger
(
0
);
final
AtomicInteger
ascore
=
new
AtomicInteger
(
0
);
...
...
@@ -6743,6 +6747,10 @@ public class CuasMotion {
for
(
int
ntarg
=
0
;
ntarg
<
targets
.
length
;
ntarg
++)
if
(
targets
[
ntarg
]
!=
null
){
if
(
Double
.
isNaN
(
targets
[
ntarg
][
CuasMotionLMA
.
RSLT_FAIL
])
||
(
targets
[
ntarg
][
CuasMotionLMA
.
RSLT_FAIL
]==
CuasMotionLMA
.
FAIL_NONE
))
{
int
fail_type
=
0
;
if
(
early_boosts
&&
(
targets
[
ntarg
][
CuasMotionLMA
.
RSLT_VBOOST
]
>
1
)
&&
(
targets
[
ntarg
][
CuasMotionLMA
.
RSLT_EBOOST
]
<=
1
))
{
if
(
fail_type
==
0
)
fail_type
=
CuasMotionLMA
.
FAIL_BOOSTS
;
aboosts
.
getAndIncrement
();
}
if
(!
Double
.
isNaN
(
min_mscore
)
&&
!(
targets
[
ntarg
][
CuasMotionLMA
.
RSLT_MSCORE
]
>=
min_mscore
))
{
if
(
fail_type
==
0
)
fail_type
=
CuasMotionLMA
.
FAIL_MOTION
;
amscore
.
getAndIncrement
();
...
...
@@ -6775,6 +6783,7 @@ public class CuasMotion {
ImageDtt
.
startAndJoin
(
threads
);
return
new
int
[]
{
afail
.
get
(),
aboosts
.
get
(),
amscore
.
get
(),
avstr
.
get
(),
ascore
.
get
(),
...
...
@@ -8041,6 +8050,7 @@ public class CuasMotion {
boolean
accum_base
=
clt_parameters
.
imp
.
cuas_accum_base
||
!
accum_boosted
;
// By AF on 05/12/2026
boolean
early_en
=
clt_parameters
.
imp
.
cuas_early_en
;
// Apply early fail filter after phase 1
boolean
early_boosts
=
clt_parameters
.
imp
.
cuas_early_boosts
;
// Apply early fail filter after phase 1
double
early_mscore
=
clt_parameters
.
imp
.
cuas_early_mscore
;
// Minimal motion score (RSLT_MSCORE)
double
early_vstr
=
clt_parameters
.
imp
.
cuas_early_vstr
;
// Minimal MV confidence (RSLT_VSTR)
double
early_score
=
clt_parameters
.
imp
.
cuas_early_score
;
// Minimal score (RSLT_QSCORE)
...
...
@@ -8575,6 +8585,7 @@ public class CuasMotion {
int
[]
early_fail
=
earlyFail
(
// Fail after Phase 1
target_sequence_multi
,
// final double [][][][] target_multi,
niter
,
// final int niter,
early_boosts
,
// final boolean early_boosts,
early_mscore
,
// final double min_mscore,
early_vstr
,
// final double min_vstr,
early_score
,
// final double min_score,
...
...
@@ -8582,10 +8593,11 @@ public class CuasMotion {
if
(
debugLevel
>
-
4
)
{
System
.
out
.
println
(
"Early failed:"
);
System
.
out
.
println
(
String
.
format
(
" total: %5d"
,
early_fail
[
0
]));
System
.
out
.
println
(
String
.
format
(
" mscore: %5d (<%f)"
,
early_fail
[
1
],
early_mscore
));
System
.
out
.
println
(
String
.
format
(
" vstr: %5d (<%f)"
,
early_fail
[
2
],
early_vstr
));
System
.
out
.
println
(
String
.
format
(
" score: %5d (<%f)"
,
early_fail
[
3
],
early_score
));
System
.
out
.
println
(
String
.
format
(
" amplitude: %5d (<%f)"
,
early_fail
[
4
],
early_amp
));
System
.
out
.
println
(
String
.
format
(
" boosts: %5d, enforced=%b"
,
early_fail
[
1
],
early_boosts
));
System
.
out
.
println
(
String
.
format
(
" mscore: %5d (<%f)"
,
early_fail
[
2
],
early_mscore
));
System
.
out
.
println
(
String
.
format
(
" vstr: %5d (<%f)"
,
early_fail
[
3
],
early_vstr
));
System
.
out
.
println
(
String
.
format
(
" score: %5d (<%f)"
,
early_fail
[
4
],
early_score
));
System
.
out
.
println
(
String
.
format
(
" amplitude: %5d (<%f)"
,
early_fail
[
5
],
early_amp
));
}
}
else
{
if
(
debugLevel
>
-
4
)
{
...
...
src/main/java/com/elphel/imagej/cuas/CuasMotionLMA.java
View file @
7a4f9f53
...
...
@@ -176,13 +176,14 @@ public class CuasMotionLMA {
public
static
final
int
FAIL_K_LOW
=
14
;
// Overshoot is too low (not used, it can be down to 0)
public
static
final
int
FAIL_K_HIGH
=
15
;
// Overshoot is too high
public
static
final
int
FAIL_FAR
=
16
;
// Peak is too far from the center
public
static
final
int
FAIL_VCORR
=
17
;
// MV refinement (fine pass) resulted in a too high correction (not yet checked)
public
static
final
int
FAIL_HORIZON
=
18
;
// Peak is below horizon
public
static
final
int
FAIL_MISMATCH
=
19
;
// Mismatch on both ends is too high
public
static
final
int
FAIL_NEIGHBOR
=
20
;
// failed because some neighbor is stronger
public
static
final
int
FAIL_DUPLICATE
=
21
;
// coordinate are (almost) the same as those of a stronger tile
public
static
final
int
FAIL_USED
=
22
;
// non-centered used to generate centered, remove this
public
static
final
int
FAIL_FL_ONLY
=
23
;
// Flight log data only, no target detected here
public
static
final
int
FAIL_BOOSTS
=
17
;
// Tried to use short exposure for slow motion
public
static
final
int
FAIL_VCORR
=
18
;
// MV refinement (fine pass) resulted in a too high correction (not yet checked)
public
static
final
int
FAIL_HORIZON
=
19
;
// Peak is below horizon
public
static
final
int
FAIL_MISMATCH
=
20
;
// Mismatch on both ends is too high
public
static
final
int
FAIL_NEIGHBOR
=
21
;
// failed because some neighbor is stronger
public
static
final
int
FAIL_DUPLICATE
=
22
;
// coordinate are (almost) the same as those of a stronger tile
public
static
final
int
FAIL_USED
=
23
;
// non-centered used to generate centered, remove this
public
static
final
int
FAIL_FL_ONLY
=
24
;
// Flight log data only, no target detected here
public
static
final
int
CENTERED_NO
=
0
;
public
static
final
int
CENTERED_YES
=
1
;
...
...
src/main/java/com/elphel/imagej/tileprocessor/IntersceneMatchParameters.java
View file @
7a4f9f53
...
...
@@ -824,6 +824,9 @@ min_str_neib_fpn 0.35
public
int
cuas_trim_first
=
5
;
// Trim targets after first (non-centered) pass (if > 0)
public
boolean
cuas_early_en
=
true
;
// Apply early fail filter after phase 1
// for debugging this parameter will be applied together with other cuas_early_* filtering,
// for efficiency it may be enforced when adding new targets
public
boolean
cuas_early_boosts
=
true
;
// require boosted exposure for slow (boosted) movements
public
double
cuas_early_mscore
=
0.0015
;
// Minimal motion score (RSLT_MSCORE)
public
double
cuas_early_vstr
=
0.007
;
// Minimal MV confidence (RSLT_VSTR)
public
double
cuas_early_score
=
0.32
;
// Minimal score (RSLT_QSCORE)
...
...
@@ -2735,12 +2738,12 @@ min_str_neib_fpn 0.35
"Do not boost if motion vector faster than this (before in code equiv 1.8 pix)."
);
gd
.
addNumericField
(
"Increase tracking camera exposure"
,
this
.
cuas_boost_accum
,
5
,
8
,
""
,
"If >1 increase tracking camera exposure (later - conditional)."
);
gd
.
addNumericField
(
"Exposure boost RSLT_A exponent"
,
this
.
cuas_exposure_boost_factor
,
5
,
8
,
""
,
gd
.
addNumericField
(
"Exposure boost RSLT_A exponent"
,
this
.
cuas_exposure_boost_factor
,
5
,
8
,
""
,
"RSLT_A *= pow(boost_exposure, factor). 0.5=sqrt (default), 0=no scale, 1=linear."
);
// By Claude on 05/24/2026
gd
.
addCheckbox
(
"Accumulate phas
ae 1 base exposure"
,
this
.
cuas_phase1_base
,
gd
.
addCheckbox
(
"Accumulate phas
e 1 base exposure"
,
this
.
cuas_phase1_base
,
"Accumulate non-centered targets (phase 1) with base \"exposure\"."
);
gd
.
addCheckbox
(
"Accumulate phase 1 boosted exposure"
,
this
.
cuas_phase1_boosted
,
gd
.
addCheckbox
(
"Accumulate phase 1 boosted exposure"
,
this
.
cuas_phase1_boosted
,
"Accumulate non-centered targets (phASE 1) with boosted \"exposure\"."
);
gd
.
addCheckbox
(
"Accumulate tracking base exposure"
,
this
.
cuas_accum_base
,
"Accumulate centered targets with base \"exposure\"."
);
...
...
@@ -2783,6 +2786,8 @@ min_str_neib_fpn 0.35
gd
.
addMessage
(
"=== Early Fail Filters (after phase 1) ==="
);
gd
.
addCheckbox
(
"Apply early fail filters"
,
this
.
cuas_early_en
,
"Reduce number of target candidates after phase 1."
);
gd
.
addCheckbox
(
"Enforce bosted exposure for slow targets"
,
this
.
cuas_early_boosts
,
"Require boosted exposure for slow (boosted) movements."
);
gd
.
addNumericField
(
"Motion score (RSLT_MSCORE)"
,
this
.
cuas_early_mscore
,
5
,
8
,
""
,
"Minimal motion score (RSLT_MSCORE)."
);
gd
.
addNumericField
(
"Motion confidence (RSLT_VSTR)"
,
this
.
cuas_early_vstr
,
5
,
8
,
""
,
...
...
@@ -4480,6 +4485,7 @@ min_str_neib_fpn 0.35
this
.
cuas_trim_first
=
(
int
)
gd
.
getNextNumber
();
this
.
cuas_early_en
=
gd
.
getNextBoolean
();
this
.
cuas_early_boosts
=
gd
.
getNextBoolean
();
this
.
cuas_early_mscore
=
gd
.
getNextNumber
();
this
.
cuas_early_vstr
=
gd
.
getNextNumber
();
this
.
cuas_early_score
=
gd
.
getNextNumber
();
...
...
@@ -5810,6 +5816,7 @@ min_str_neib_fpn 0.35
properties
.
setProperty
(
prefix
+
"cuas_trim_first"
,
this
.
cuas_trim_first
+
""
);
// int
properties
.
setProperty
(
prefix
+
"cuas_early_en"
,
this
.
cuas_early_en
+
""
);
// boolean
properties
.
setProperty
(
prefix
+
"cuas_early_boosts"
,
this
.
cuas_early_boosts
+
""
);
// boolean
properties
.
setProperty
(
prefix
+
"cuas_early_mscore"
,
this
.
cuas_early_mscore
+
""
);
// double
properties
.
setProperty
(
prefix
+
"cuas_early_vstr"
,
this
.
cuas_early_vstr
+
""
);
// double
properties
.
setProperty
(
prefix
+
"cuas_early_score"
,
this
.
cuas_early_score
+
""
);
// double
...
...
@@ -7075,6 +7082,7 @@ min_str_neib_fpn 0.35
if
(
properties
.
getProperty
(
prefix
+
"cuas_trim_first"
)!=
null
)
this
.
cuas_trim_first
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"cuas_trim_first"
));
if
(
properties
.
getProperty
(
prefix
+
"cuas_early_en"
)!=
null
)
this
.
cuas_early_en
=
Boolean
.
parseBoolean
(
properties
.
getProperty
(
prefix
+
"cuas_early_en"
));
if
(
properties
.
getProperty
(
prefix
+
"cuas_early_boosts"
)!=
null
)
this
.
cuas_early_boosts
=
Boolean
.
parseBoolean
(
properties
.
getProperty
(
prefix
+
"cuas_early_boosts"
));
if
(
properties
.
getProperty
(
prefix
+
"cuas_early_mscore"
)!=
null
)
this
.
cuas_early_mscore
=
Double
.
parseDouble
(
properties
.
getProperty
(
prefix
+
"cuas_early_mscore"
));
if
(
properties
.
getProperty
(
prefix
+
"cuas_early_vstr"
)!=
null
)
this
.
cuas_early_vstr
=
Double
.
parseDouble
(
properties
.
getProperty
(
prefix
+
"cuas_early_vstr"
));
if
(
properties
.
getProperty
(
prefix
+
"cuas_early_score"
)!=
null
)
this
.
cuas_early_score
=
Double
.
parseDouble
(
properties
.
getProperty
(
prefix
+
"cuas_early_score"
));
...
...
@@ -8357,6 +8365,7 @@ min_str_neib_fpn 0.35
imp
.
cuas_trim_first
=
this
.
cuas_trim_first
;
imp
.
cuas_early_en
=
this
.
cuas_early_en
;
imp
.
cuas_early_boosts
=
this
.
cuas_early_boosts
;
imp
.
cuas_early_mscore
=
this
.
cuas_early_mscore
;
imp
.
cuas_early_vstr
=
this
.
cuas_early_vstr
;
imp
.
cuas_early_score
=
this
.
cuas_early_score
;
...
...
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