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
dd7e6ced
Commit
dd7e6ced
authored
Feb 25, 2026
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented multiple-reference (center and 1/4 and 3/4) global LMA pose
refining.
parent
6da5747a
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
2504 additions
and
74 deletions
+2504
-74
IntersceneGlobalLmaParameters.java
...l/imagej/tileprocessor/IntersceneGlobalLmaParameters.java
+24
-12
IntersceneGlobalLmaRefine.java
...lphel/imagej/tileprocessor/IntersceneGlobalLmaRefine.java
+1843
-47
IntersceneGlobalRefine.java
...m/elphel/imagej/tileprocessor/IntersceneGlobalRefine.java
+283
-15
OpticalFlow.java
...ain/java/com/elphel/imagej/tileprocessor/OpticalFlow.java
+340
-0
QuadCLTCPU.java
...main/java/com/elphel/imagej/tileprocessor/QuadCLTCPU.java
+14
-0
No files found.
src/main/java/com/elphel/imagej/tileprocessor/IntersceneGlobalLmaParameters.java
View file @
dd7e6ced
...
...
@@ -26,6 +26,8 @@ public class IntersceneGlobalLmaParameters {
public
boolean
glob_en
;
public
boolean
glob_exit_after_test
;
// exit OpticalFlow.buildSeries() immediately after running, do not increment num_orient
public
boolean
glob_recalculate_quarter_refs
;
// force regeneration of quarter-reference DSI/INTER-INTRA-LMA files
public
boolean
glob_quarter_refs_sfm_only
;
// generate quarter-reference INTER-INTRA-LMA using SfM-only (no pose LMA updates)
public
int
glob_solver_mode
;
// 0 - current sparse global refine, 1 - classic LMA-structure implementation
public
boolean
[]
param_sel
;
public
double
[]
param_regweights
;
...
...
@@ -53,9 +55,11 @@ public class IntersceneGlobalLmaParameters {
public
int
glob_center_pair_weight_mode
;
public
IntersceneGlobalLmaParameters
()
{
glob_en
=
true
;
glob_exit_after_test
=
true
;
// TODO: change default to false when debugging is over
glob_solver_mode
=
GLOB_SOLVER_SPARSE_BANDED
;
glob_en
=
true
;
glob_exit_after_test
=
true
;
// TODO: change default to false when debugging is over
glob_recalculate_quarter_refs
=
false
;
glob_quarter_refs_sfm_only
=
true
;
glob_solver_mode
=
GLOB_SOLVER_SPARSE_BANDED
;
param_sel
=
new
boolean
[
ErsCorrection
.
DP_XYZATR
.
length
];
param_regweights
=
new
double
[
ErsCorrection
.
DP_XYZATR
.
length
];
param_lpf
=
new
double
[
ErsCorrection
.
DP_XYZATR
.
length
];
...
...
@@ -93,6 +97,10 @@ public class IntersceneGlobalLmaParameters {
"Use global LMA for adjusting scenes poses."
);
gd
.
addCheckbox
(
"Exit after Global LMA (debug mode)"
,
this
.
glob_exit_after_test
,
"exit OpticalFlow.buildSeries() immediately after running, do not increment num_orient enabling re-running next time"
);
gd
.
addCheckbox
(
"Recalculate quarter refs each run (debug)"
,
this
.
glob_recalculate_quarter_refs
,
"Force regeneration of quarter-reference -DSI_MAIN and -INTER-INTRA-LMA before Global LMA."
);
gd
.
addCheckbox
(
"Quarter refs use SfM-only generation"
,
this
.
glob_quarter_refs_sfm_only
,
"For quarter references, run scanSfmIMS disparity refinement without per-scene pose LMA adjustment."
);
gd
.
addNumericField
(
"Global LMA solver mode (0/1)"
,
this
.
glob_solver_mode
,
0
,
3
,
""
,
"0: current sparse/banded global solver, 1: classic LMA-structure global solver."
);
gd
.
addStringField
(
"Select XYZATR parameters to fit"
,
IntersceneMatchParameters
.
booleansToString
(
this
.
param_sel
,
2
),
40
,
...
...
@@ -142,13 +150,15 @@ public class IntersceneGlobalLmaParameters {
"Display debug hyperstack in ImageJ UI."
);
gd
.
addCheckbox
(
"Save only initial+final CSV"
,
this
.
glob_save_initial_final_only
,
"Do not save intermediate outer-loop TIFF/CSV, save only combined initial+final CSV."
);
gd
.
addNumericField
(
"Center pair weight mode (
0/1/2)"
,
this
.
glob_center_pair_weight_mode
,
0
,
3
,
""
,
"0: all pairs enabled,
1: disable center +/-1 pairs, 2: disable center +/-1,+/-2 pairs
."
);
gd
.
addNumericField
(
"Center pair weight mode (
>=0)"
,
this
.
glob_center_pair_weight_mode
,
0
,
3
,
""
,
"0: all pairs enabled,
N>0: disable center-reference pairs with |scene-center| <= N
."
);
}
public
void
dialogAnswers
(
GenericJTabbedDialog
gd
)
{
this
.
glob_en
=
gd
.
getNextBoolean
();
this
.
glob_exit_after_test
=
gd
.
getNextBoolean
();
this
.
glob_solver_mode
=
clampSolverMode
((
int
)
gd
.
getNextNumber
());
this
.
glob_en
=
gd
.
getNextBoolean
();
this
.
glob_exit_after_test
=
gd
.
getNextBoolean
();
this
.
glob_recalculate_quarter_refs
=
gd
.
getNextBoolean
();
this
.
glob_quarter_refs_sfm_only
=
gd
.
getNextBoolean
();
this
.
glob_solver_mode
=
clampSolverMode
((
int
)
gd
.
getNextNumber
());
this
.
param_sel
=
IntersceneMatchParameters
.
StringToBooleans
(
gd
.
getNextString
(),
this
.
param_sel
);
this
.
param_regweights
=
IntersceneMatchParameters
.
StringToDoubles
(
gd
.
getNextString
(),
this
.
param_regweights
);
this
.
param_lpf
=
IntersceneMatchParameters
.
StringToDoubles
(
gd
.
getNextString
(),
this
.
param_lpf
);
...
...
@@ -179,14 +189,13 @@ public class IntersceneGlobalLmaParameters {
if
(
this
.
glob_center_pair_weight_mode
<
0
)
{
this
.
glob_center_pair_weight_mode
=
0
;
}
if
(
this
.
glob_center_pair_weight_mode
>
2
)
{
this
.
glob_center_pair_weight_mode
=
2
;
}
}
public
void
setProperties
(
String
prefix
,
Properties
properties
){
properties
.
setProperty
(
prefix
+
"glob_en"
,
this
.
glob_en
+
""
);
properties
.
setProperty
(
prefix
+
"glob_exit_after_test"
,
this
.
glob_exit_after_test
+
""
);
properties
.
setProperty
(
prefix
+
"glob_recalculate_quarter_refs"
,
this
.
glob_recalculate_quarter_refs
+
""
);
properties
.
setProperty
(
prefix
+
"glob_quarter_refs_sfm_only"
,
this
.
glob_quarter_refs_sfm_only
+
""
);
properties
.
setProperty
(
prefix
+
"glob_solver_mode"
,
this
.
glob_solver_mode
+
""
);
properties
.
setProperty
(
prefix
+
"param_sel"
,
IntersceneMatchParameters
.
booleansToString
(
this
.
param_sel
,
2
));
properties
.
setProperty
(
prefix
+
"param_regweights"
,
IntersceneMatchParameters
.
doublesToString
(
this
.
param_regweights
));
...
...
@@ -218,6 +227,8 @@ public class IntersceneGlobalLmaParameters {
public
void
getProperties
(
String
prefix
,
Properties
properties
){
if
(
properties
.
getProperty
(
prefix
+
"glob_en"
)!=
null
)
this
.
glob_en
=
Boolean
.
parseBoolean
(
properties
.
getProperty
(
prefix
+
"glob_en"
));
if
(
properties
.
getProperty
(
prefix
+
"glob_exit_after_test"
)!=
null
)
this
.
glob_exit_after_test
=
Boolean
.
parseBoolean
(
properties
.
getProperty
(
prefix
+
"glob_exit_after_test"
));
if
(
properties
.
getProperty
(
prefix
+
"glob_recalculate_quarter_refs"
)!=
null
)
this
.
glob_recalculate_quarter_refs
=
Boolean
.
parseBoolean
(
properties
.
getProperty
(
prefix
+
"glob_recalculate_quarter_refs"
));
if
(
properties
.
getProperty
(
prefix
+
"glob_quarter_refs_sfm_only"
)!=
null
)
this
.
glob_quarter_refs_sfm_only
=
Boolean
.
parseBoolean
(
properties
.
getProperty
(
prefix
+
"glob_quarter_refs_sfm_only"
));
if
(
properties
.
getProperty
(
prefix
+
"glob_solver_mode"
)!=
null
)
this
.
glob_solver_mode
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"glob_solver_mode"
));
this
.
glob_solver_mode
=
clampSolverMode
(
this
.
glob_solver_mode
);
if
(
properties
.
getProperty
(
prefix
+
"param_sel"
)!=
null
)
this
.
param_sel
=
IntersceneMatchParameters
.
StringToBooleans
(
properties
.
getProperty
(
prefix
+
"param_sel"
),
this
.
param_sel
);
...
...
@@ -246,7 +257,6 @@ public class IntersceneGlobalLmaParameters {
if
(
properties
.
getProperty
(
prefix
+
"glob_save_initial_final_only"
)!=
null
)
this
.
glob_save_initial_final_only
=
Boolean
.
parseBoolean
(
properties
.
getProperty
(
prefix
+
"glob_save_initial_final_only"
));
if
(
properties
.
getProperty
(
prefix
+
"glob_center_pair_weight_mode"
)!=
null
)
this
.
glob_center_pair_weight_mode
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"glob_center_pair_weight_mode"
));
if
(
this
.
glob_center_pair_weight_mode
<
0
)
this
.
glob_center_pair_weight_mode
=
0
;
if
(
this
.
glob_center_pair_weight_mode
>
2
)
this
.
glob_center_pair_weight_mode
=
2
;
}
@Override
...
...
@@ -254,6 +264,8 @@ public class IntersceneGlobalLmaParameters {
IntersceneGlobalLmaParameters
iglp
=
new
IntersceneGlobalLmaParameters
();
iglp
.
glob_en
=
this
.
glob_en
;
iglp
.
glob_exit_after_test
=
this
.
glob_exit_after_test
;
iglp
.
glob_recalculate_quarter_refs
=
this
.
glob_recalculate_quarter_refs
;
iglp
.
glob_quarter_refs_sfm_only
=
this
.
glob_quarter_refs_sfm_only
;
iglp
.
glob_solver_mode
=
this
.
glob_solver_mode
;
iglp
.
param_sel
=
this
.
param_sel
.
clone
();
iglp
.
param_regweights
=
this
.
param_regweights
.
clone
();
...
...
src/main/java/com/elphel/imagej/tileprocessor/IntersceneGlobalLmaRefine.java
View file @
dd7e6ced
This diff is collapsed.
Click to expand it.
src/main/java/com/elphel/imagej/tileprocessor/IntersceneGlobalRefine.java
View file @
dd7e6ced
This diff is collapsed.
Click to expand it.
src/main/java/com/elphel/imagej/tileprocessor/OpticalFlow.java
View file @
dd7e6ced
This diff is collapsed.
Click to expand it.
src/main/java/com/elphel/imagej/tileprocessor/QuadCLTCPU.java
View file @
dd7e6ced
...
...
@@ -246,6 +246,8 @@ public class QuadCLTCPU {
// only reference scene has a pair of first/last scene in a sequence
public String timestamp_first = null;
public String timestamp_last = null;
public String timestamp_quarter1 = null;
public String timestamp_quarter3 = null;
public String timestamp_index = null; // timestamp of the scene with index of all reference scenes in this sequence
public HashSet<String> ref_scenes = null; // Set of timestamps of the reference scenes in this sequence
// combined clt for center view, only used in cuas mode
...
...
@@ -7755,12 +7757,18 @@ LogTee.clearSceneLog(); // stop per‑scene logging
if (this.timestamp_first != null) {
properties.setProperty(prefix+"timestamp_first", this.timestamp_first);
}
if (this.timestamp_quarter1 != null) {
properties.setProperty(prefix+"timestamp_quarter1", this.timestamp_quarter1);
}
if (this.timestamp_index != null) {
properties.setProperty(prefix+"timestamp_index", this.timestamp_index);
}
if (this.timestamp_last != null) {
properties.setProperty(prefix+"timestamp_last", this.timestamp_last);
}
if (this.timestamp_quarter3 != null) {
properties.setProperty(prefix+"timestamp_quarter3", this.timestamp_quarter3);
}
if (this.quat_corr != null) {
properties.setProperty(prefix+"quat_corr", IntersceneMatchParameters.doublesToString(this.quat_corr));
...
...
@@ -7972,9 +7980,15 @@ LogTee.clearSceneLog(); // stop per‑scene logging
if (properties.getProperty(prefix+"timestamp_first")!=null) {
this.timestamp_first= (String) properties.getProperty(prefix+"timestamp_first");
}
if (properties.getProperty(prefix+"timestamp_quarter1")!=null) {
this.timestamp_quarter1= (String) properties.getProperty(prefix+"timestamp_quarter1");
}
if (properties.getProperty(prefix+"timestamp_last")!=null) {
this.timestamp_last= (String) properties.getProperty(prefix+"timestamp_last");
}
if (properties.getProperty(prefix+"timestamp_quarter3")!=null) {
this.timestamp_quarter3= (String) properties.getProperty(prefix+"timestamp_quarter3");
}
if (properties.getProperty(prefix+"timestamp_index")!=null) {
this.timestamp_index= (String) properties.getProperty(prefix+"timestamp_index");
}
...
...
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