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
0de865d9
Commit
0de865d9
authored
Feb 12, 2024
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added average RMSE fro orientation
parent
7c17ebab
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
72 deletions
+76
-72
Interscene.java
...main/java/com/elphel/imagej/tileprocessor/Interscene.java
+38
-53
OpticalFlow.java
...ain/java/com/elphel/imagej/tileprocessor/OpticalFlow.java
+16
-19
RMSEStats.java
src/main/java/com/elphel/imagej/tileprocessor/RMSEStats.java
+22
-0
No files found.
src/main/java/com/elphel/imagej/tileprocessor/Interscene.java
View file @
0de865d9
...
@@ -436,6 +436,8 @@ public class Interscene {
...
@@ -436,6 +436,8 @@ public class Interscene {
return
earliest_scene2
;
return
earliest_scene2
;
}
}
public
static
int
invertInitialOrientation
(
public
static
int
invertInitialOrientation
(
final
CLTParameters
clt_parameters
,
final
CLTParameters
clt_parameters
,
final
boolean
batch_mode
,
final
boolean
batch_mode
,
...
@@ -492,7 +494,7 @@ public class Interscene {
...
@@ -492,7 +494,7 @@ public class Interscene {
false
,
// boolean use_ERS_tilt);
false
,
// boolean use_ERS_tilt);
false
);
// boolean use_ERS_roll);
false
);
// boolean use_ERS_roll);
double
maximal_series_rms
=
0.0
;
RMSEStats
rmse_stats
=
new
RMSEStats
()
;
double
[][][]
scenes_xyzatr
=
new
double
[
last_index
+
1
][][];
double
[][][]
scenes_xyzatr
=
new
double
[
last_index
+
1
][][];
double
[][][]
dxyzatr_dt
=
new
double
[
last_index
+
1
][][];
double
[][][]
dxyzatr_dt
=
new
double
[
last_index
+
1
][][];
for
(
int
nscene
=
earliest_index
;
nscene
<=
ref_index
;
nscene
++)
{
for
(
int
nscene
=
earliest_index
;
nscene
<=
ref_index
;
nscene
++)
{
...
@@ -677,14 +679,12 @@ public class Interscene {
...
@@ -677,14 +679,12 @@ public class Interscene {
adjusted_xyzatr_dt
[
0
],
// ZERO3, // ers_scene.getErsXYZ_dt(),
adjusted_xyzatr_dt
[
0
],
// ZERO3, // ers_scene.getErsXYZ_dt(),
adjusted_xyzatr_dt
[
1
]
// ZERO3 // ers_scene.getErsATR_dt()
adjusted_xyzatr_dt
[
1
]
// ZERO3 // ers_scene.getErsATR_dt()
);
);
if
(
lma_rms
[
0
]
>
maximal_series_rms
)
{
rmse_stats
.
add
(
lma_rms
[
0
]);
maximal_series_rms
=
lma_rms
[
0
];
}
if
(
debugLevel
>
-
3
)
{
if
(
debugLevel
>
-
3
)
{
System
.
out
.
println
(
"invertInitialOrientation(): scene "
+
scene_index
+
" (of "
+
quadCLTs
.
length
+
") "
+
System
.
out
.
println
(
"invertInitialOrientation(): scene "
+
scene_index
+
" (of "
+
quadCLTs
.
length
+
") "
+
quadCLTs
[
ref_index
].
getImageName
()
+
"/"
+
quadCLTs
[
scene_index
].
getImageName
()+
quadCLTs
[
ref_index
].
getImageName
()
+
"/"
+
quadCLTs
[
scene_index
].
getImageName
()+
" Done. RMS="
+
lma_rms
[
0
]+
", maximal so far was "
+
maximal_series_rms
);
" Done. RMS="
+
lma_rms
[
0
]+
", maximal so far was "
+
rmse_stats
.
getMax
()+
", average was "
+
rmse_stats
.
getAverage
());
}
}
}
// for (int scene_index = ref_index; scene_index <= last_index; scene_index++) {
}
// for (int scene_index = ref_index; scene_index <= last_index; scene_index++) {
...
@@ -712,15 +712,6 @@ public class Interscene {
...
@@ -712,15 +712,6 @@ public class Interscene {
return
getFPNUnResolved
(
fpn_pairs
);
return
getFPNUnResolved
(
fpn_pairs
);
}
}
// mitigating problem, that in the process of adjusting offset can fall below
// the minimum and coordinates will be NaN:
/*
Mitigating FPN for scene 361 being too close to reference 344, using scene 367 as a reference
interCorrPair(): avg_offs = 10.755562139763402 <= 256.0, sw = 4217.0 iter=3, RMS=0.5364197453455559 (Pure RMS=0.5364197453455559)
interCorrPair(): avg_offs = 7.795390182218127 < 8.0, sw = 4219.0
adjustPairsLMAInterscene() returned null
*/
double
[]
min_max_fpn
=
{
0
,
min_max
[
1
]};
double
[]
min_max_fpn
=
{
0
,
min_max
[
1
]};
for
(
int
ipair
=
0
;
ipair
<
fpn_pairs
.
length
;
ipair
++)
if
(
fpn_pairs
[
ipair
][
1
]
>=
0
)
{
for
(
int
ipair
=
0
;
ipair
<
fpn_pairs
.
length
;
ipair
++)
if
(
fpn_pairs
[
ipair
][
1
]
>=
0
)
{
if
(
debugLevel
>
-
4
)
{
if
(
debugLevel
>
-
4
)
{
...
@@ -777,13 +768,12 @@ public class Interscene {
...
@@ -777,13 +768,12 @@ public class Interscene {
scenes_xyzatr
[
fpn_pairs
[
ipair
][
0
]][
1
],
scenes_xyzatr
[
fpn_pairs
[
ipair
][
0
]][
1
],
adjusted_xyzatr_dt
[
0
],
// ZERO3, // ers_scene.getErsXYZ_dt(),
adjusted_xyzatr_dt
[
0
],
// ZERO3, // ers_scene.getErsXYZ_dt(),
adjusted_xyzatr_dt
[
1
]);
// ZERO3 // ers_scene.getErsATR_dt()
adjusted_xyzatr_dt
[
1
]);
// ZERO3 // ers_scene.getErsATR_dt()
if
(
lma_rms
[
0
]
>
maximal_series_rms
)
{
rmse_stats
.
add
(
lma_rms
[
0
]);
maximal_series_rms
=
lma_rms
[
0
];
}
if
(
debugLevel
>
-
3
)
{
if
(
debugLevel
>
-
3
)
{
System
.
out
.
println
(
"Pass multi scene "
+
fpn_pairs
[
ipair
][
0
]+
" (of "
+
quadCLTs
.
length
+
") "
+
System
.
out
.
println
(
"Pass multi scene "
+
fpn_pairs
[
ipair
][
0
]+
" (of "
+
quadCLTs
.
length
+
") "
+
quadCLTs
[
fpn_pairs
[
ipair
][
1
]].
getImageName
()
+
"/"
+
quadCLTs
[
fpn_pairs
[
ipair
][
0
]].
getImageName
()+
quadCLTs
[
fpn_pairs
[
ipair
][
1
]].
getImageName
()
+
"/"
+
quadCLTs
[
fpn_pairs
[
ipair
][
0
]].
getImageName
()+
" Done. RMS="
+
lma_rms
[
0
]+
", maximal so far was "
+
maximal_series_rms
);
" Done. RMS="
+
lma_rms
[
0
]+
", maximal so far was "
+
rmse_stats
.
getMax
()+
", average was "
+
rmse_stats
.
getAverage
());
}
}
}
}
}
}
...
@@ -798,7 +788,8 @@ public class Interscene {
...
@@ -798,7 +788,8 @@ public class Interscene {
sb
.
append
(
"ref_index= "
+
ref_index
+
"\n"
);
sb
.
append
(
"ref_index= "
+
ref_index
+
"\n"
);
sb
.
append
(
"last_index= "
+
last_index
+
"\n"
);
sb
.
append
(
"last_index= "
+
last_index
+
"\n"
);
sb
.
append
(
"old_ref_index= "
+
ref_old
+
"\n"
);
sb
.
append
(
"old_ref_index= "
+
ref_old
+
"\n"
);
sb
.
append
(
"Maximal RMSE= "
+
maximal_series_rms
+
"\n"
);
sb
.
append
(
"Maximal RMSE= "
+
rmse_stats
.
getMax
()+
"\n"
);
sb
.
append
(
"Average RMSE= "
+
rmse_stats
.
getAverage
()+
"\n"
);
sb
.
append
(
"------------------------\n\n"
);
sb
.
append
(
"------------------------\n\n"
);
quadCLTs
[
ref_index
].
saveStringInModelDirectory
(
sb
.
toString
(),
QuadCLT
.
ORIENTATION_LOGS_SUFFIX
);
// String suffix)
quadCLTs
[
ref_index
].
saveStringInModelDirectory
(
sb
.
toString
(),
QuadCLT
.
ORIENTATION_LOGS_SUFFIX
);
// String suffix)
}
}
...
@@ -820,7 +811,7 @@ public class Interscene {
...
@@ -820,7 +811,7 @@ public class Interscene {
final
int
threadsMax
,
// int threadsMax,
final
int
threadsMax
,
// int threadsMax,
final
boolean
updateStatus
,
final
boolean
updateStatus
,
final
int
debugLevel
)
{
final
int
debugLevel
)
{
double
maximal_series_rms
=
0.0
;
RMSEStats
rmse_stats
=
new
RMSEStats
()
;
double
min_ref_str
=
clt_parameters
.
imp
.
min_ref_str
;
double
min_ref_str
=
clt_parameters
.
imp
.
min_ref_str
;
boolean
ref_need_lma
=
clt_parameters
.
imp
.
ref_need_lma
;
boolean
ref_need_lma
=
clt_parameters
.
imp
.
ref_need_lma
;
double
min_ref_frac
=
clt_parameters
.
imp
.
min_ref_frac
;
double
min_ref_frac
=
clt_parameters
.
imp
.
min_ref_frac
;
...
@@ -1180,14 +1171,12 @@ public class Interscene {
...
@@ -1180,14 +1171,12 @@ public class Interscene {
adjusted_xyzatr_dt
[
0
],
// ZERO3, // ers_scene.getErsXYZ_dt(),
adjusted_xyzatr_dt
[
0
],
// ZERO3, // ers_scene.getErsXYZ_dt(),
adjusted_xyzatr_dt
[
1
]
// ZERO3 // ers_scene.getErsATR_dt()
adjusted_xyzatr_dt
[
1
]
// ZERO3 // ers_scene.getErsATR_dt()
);
);
if
(
lma_rms
[
0
]
>
maximal_series_rms
)
{
rmse_stats
.
add
(
lma_rms
[
0
]);
maximal_series_rms
=
lma_rms
[
0
];
}
if
(
debugLevel
>
-
3
)
{
if
(
debugLevel
>
-
3
)
{
System
.
out
.
println
(
"Pass multi scene "
+
scene_index
+
" (of "
+
quadCLTs
.
length
+
") "
+
System
.
out
.
println
(
"Pass multi scene "
+
scene_index
+
" (of "
+
quadCLTs
.
length
+
") "
+
quadCLTs
[
ref_index
].
getImageName
()
+
"/"
+
scene_QuadClt
.
getImageName
()+
quadCLTs
[
ref_index
].
getImageName
()
+
"/"
+
scene_QuadClt
.
getImageName
()+
" Done. RMS="
+
lma_rms
[
0
]+
", maximal so far was "
+
maximal_series_rms
);
" Done. RMS="
+
lma_rms
[
0
]+
", maximal so far was "
+
rmse_stats
.
getMax
()+
", average was "
+
rmse_stats
.
getAverage
());
}
}
...
@@ -1283,13 +1272,12 @@ public class Interscene {
...
@@ -1283,13 +1272,12 @@ public class Interscene {
scenes_xyzatr
[
fpn_pairs
[
ipair
][
0
]][
1
],
scenes_xyzatr
[
fpn_pairs
[
ipair
][
0
]][
1
],
adjusted_xyzatr_dt
[
0
],
// ZERO3, // ers_scene.getErsXYZ_dt(),
adjusted_xyzatr_dt
[
0
],
// ZERO3, // ers_scene.getErsXYZ_dt(),
adjusted_xyzatr_dt
[
1
]);
// ZERO3 // ers_scene.getErsATR_dt()
adjusted_xyzatr_dt
[
1
]);
// ZERO3 // ers_scene.getErsATR_dt()
if
(
lma_rms
[
0
]
>
maximal_series_rms
)
{
rmse_stats
.
add
(
lma_rms
[
0
]);
maximal_series_rms
=
lma_rms
[
0
];
}
if
(
debugLevel
>
-
3
)
{
if
(
debugLevel
>
-
3
)
{
System
.
out
.
println
(
"Pass multi scene "
+
fpn_pairs
[
ipair
][
0
]+
" (of "
+
quadCLTs
.
length
+
") "
+
System
.
out
.
println
(
"Pass multi scene "
+
fpn_pairs
[
ipair
][
0
]+
" (of "
+
quadCLTs
.
length
+
") "
+
quadCLTs
[
fpn_pairs
[
ipair
][
1
]].
getImageName
()
+
"/"
+
quadCLTs
[
fpn_pairs
[
ipair
][
0
]].
getImageName
()+
quadCLTs
[
fpn_pairs
[
ipair
][
1
]].
getImageName
()
+
"/"
+
quadCLTs
[
fpn_pairs
[
ipair
][
0
]].
getImageName
()+
" Done. RMS="
+
lma_rms
[
0
]+
", maximal so far was "
+
maximal_series_rms
);
" Done. RMS="
+
lma_rms
[
0
]+
", maximal so far was "
+
rmse_stats
.
getMax
()+
", average was "
+
rmse_stats
.
getAverage
());
}
}
}
}
}
}
...
@@ -1298,9 +1286,9 @@ public class Interscene {
...
@@ -1298,9 +1286,9 @@ public class Interscene {
if
(
earliest_scene
>
0
)
{
if
(
earliest_scene
>
0
)
{
System
.
out
.
println
(
"setInitialOrientationsIms(): Not all scenes matched, earliest useful scene = "
+
earliest_scene
+
System
.
out
.
println
(
"setInitialOrientationsIms(): Not all scenes matched, earliest useful scene = "
+
earliest_scene
+
" (total number of scenes = "
+(
ref_index
-
earliest_scene
+
1
)+
" (total number of scenes = "
+(
ref_index
-
earliest_scene
+
1
)+
").
Maximal RMSE was "
+
maximal_series_rms
);
").
Maximal RMSE was "
+
rmse_stats
.
getMax
()+
", average was "
+
rmse_stats
.
getAverage
()
);
}
else
if
(
debugLevel
>
-
4
)
{
}
else
if
(
debugLevel
>
-
4
)
{
System
.
out
.
println
(
"All multi scene passes are Done. Maximal RMSE was "
+
maximal_series_rms
);
System
.
out
.
println
(
"All multi scene passes are Done. Maximal RMSE was "
+
rmse_stats
.
getMax
()+
", average was "
+
rmse_stats
.
getAverage
()
);
}
}
quadCLTs
[
ref_index
].
set_orient
(
1
);
// first orientation
quadCLTs
[
ref_index
].
set_orient
(
1
);
// first orientation
quadCLTs
[
ref_index
].
set_accum
(
0
);
// reset accumulations ("build_interscene") number
quadCLTs
[
ref_index
].
set_accum
(
0
);
// reset accumulations ("build_interscene") number
...
@@ -1315,7 +1303,8 @@ public class Interscene {
...
@@ -1315,7 +1303,8 @@ public class Interscene {
sb
.
append
(
"getNumAccum()= "
+
quadCLTs
[
ref_index
].
getNumAccum
()+
" of "
+
clt_parameters
.
imp
.
min_num_interscene
+
"\n"
);
sb
.
append
(
"getNumAccum()= "
+
quadCLTs
[
ref_index
].
getNumAccum
()+
" of "
+
clt_parameters
.
imp
.
min_num_interscene
+
"\n"
);
sb
.
append
(
"earliest_scene= "
+
earliest_scene
+
"\n"
);
sb
.
append
(
"earliest_scene= "
+
earliest_scene
+
"\n"
);
sb
.
append
(
"ref_index= "
+
ref_index
+
"\n"
);
sb
.
append
(
"ref_index= "
+
ref_index
+
"\n"
);
sb
.
append
(
"Maximal RMSE= "
+
maximal_series_rms
+
"\n"
);
sb
.
append
(
"Maximal RMSE= "
+
rmse_stats
.
getMax
()+
"\n"
);
sb
.
append
(
"Average RMSE= "
+
rmse_stats
.
getAverage
()+
"\n"
);
sb
.
append
(
"------------------------\n\n"
);
sb
.
append
(
"------------------------\n\n"
);
quadCLTs
[
ref_index
].
saveStringInModelDirectory
(
sb
.
toString
(),
QuadCLT
.
ORIENTATION_LOGS_SUFFIX
);
// String suffix)
quadCLTs
[
ref_index
].
saveStringInModelDirectory
(
sb
.
toString
(),
QuadCLT
.
ORIENTATION_LOGS_SUFFIX
);
// String suffix)
return
earliest_scene
;
return
earliest_scene
;
...
@@ -1455,7 +1444,7 @@ public class Interscene {
...
@@ -1455,7 +1444,7 @@ public class Interscene {
double
scale_extrap_atr
=
clt_parameters
.
imp
.
scale_extrap_atr
;
double
scale_extrap_atr
=
clt_parameters
.
imp
.
scale_extrap_atr
;
double
scale_extrap_xyz
=
clt_parameters
.
imp
.
scale_extrap_xyz
;
double
scale_extrap_xyz
=
clt_parameters
.
imp
.
scale_extrap_xyz
;
int
avg_len
=
clt_parameters
.
imp
.
avg_len
;
int
avg_len
=
clt_parameters
.
imp
.
avg_len
;
double
maximal_series_rms
=
0.0
;
RMSEStats
rmse_stats
=
new
RMSEStats
()
;
double
min_ref_str
=
clt_parameters
.
imp
.
min_ref_str
;
double
min_ref_str
=
clt_parameters
.
imp
.
min_ref_str
;
boolean
ref_need_lma
=
clt_parameters
.
imp
.
ref_need_lma
;
boolean
ref_need_lma
=
clt_parameters
.
imp
.
ref_need_lma
;
double
min_ref_frac
=
clt_parameters
.
imp
.
min_ref_frac
;
double
min_ref_frac
=
clt_parameters
.
imp
.
min_ref_frac
;
...
@@ -1773,14 +1762,12 @@ public class Interscene {
...
@@ -1773,14 +1762,12 @@ public class Interscene {
ZERO3
,
// ers_scene.getErsXYZ_dt(),
ZERO3
,
// ers_scene.getErsXYZ_dt(),
ZERO3
// ers_scene.getErsATR_dt()
ZERO3
// ers_scene.getErsATR_dt()
);
);
if
(
lma_rms
[
0
]
>
maximal_series_rms
)
{
rmse_stats
.
add
(
lma_rms
[
0
]);
maximal_series_rms
=
lma_rms
[
0
];
}
if
(
debugLevel
>
-
3
)
{
if
(
debugLevel
>
-
3
)
{
System
.
out
.
println
(
"Pass multi scene "
+
scene_index
+
" (of "
+
quadCLTs
.
length
+
") "
+
System
.
out
.
println
(
"Pass multi scene "
+
scene_index
+
" (of "
+
quadCLTs
.
length
+
") "
+
quadCLTs
[
ref_index
].
getImageName
()
+
"/"
+
scene_QuadClt
.
getImageName
()+
quadCLTs
[
ref_index
].
getImageName
()
+
"/"
+
scene_QuadClt
.
getImageName
()+
" Done. RMS="
+
lma_rms
[
0
]+
", maximal so far was "
+
maximal_series_rms
);
" Done. RMS="
+
lma_rms
[
0
]+
", maximal so far was "
+
rmse_stats
.
getMax
()+
", average was "
+
rmse_stats
.
getAverage
());
}
}
}
// for (int scene_index = ref_index - 1; scene_index >= 0 ; scene_index--)
}
// for (int scene_index = ref_index - 1; scene_index >= 0 ; scene_index--)
if
((
ref_index
-
earliest_scene
+
1
)
<
min_num_scenes
)
{
if
((
ref_index
-
earliest_scene
+
1
)
<
min_num_scenes
)
{
...
@@ -1794,9 +1781,9 @@ public class Interscene {
...
@@ -1794,9 +1781,9 @@ public class Interscene {
if
(
earliest_scene
>
0
)
{
if
(
earliest_scene
>
0
)
{
System
.
out
.
println
(
"setInitialOrientations(): Not all scenes matched, earliest useful scene = "
+
earliest_scene
+
System
.
out
.
println
(
"setInitialOrientations(): Not all scenes matched, earliest useful scene = "
+
earliest_scene
+
" (total number of scenes = "
+(
ref_index
-
earliest_scene
+
1
)+
" (total number of scenes = "
+(
ref_index
-
earliest_scene
+
1
)+
").Maximal RMSE was "
+
maximal_series_rms
);
").Maximal RMSE was "
+
rmse_stats
.
getMax
()+
", average was "
+
rmse_stats
.
getAverage
()
);
}
else
if
(
debugLevel
>
-
4
)
{
}
else
if
(
debugLevel
>
-
4
)
{
System
.
out
.
println
(
"All multi scene passes are Done. Maximal RMSE was "
+
maximal_series_rms
);
System
.
out
.
println
(
"All multi scene passes are Done. Maximal RMSE was "
+
rmse_stats
.
getMax
()+
", average was "
+
rmse_stats
.
getAverage
()
);
}
}
quadCLTs
[
ref_index
].
set_orient
(
1
);
// first orientation
quadCLTs
[
ref_index
].
set_orient
(
1
);
// first orientation
quadCLTs
[
ref_index
].
set_accum
(
0
);
// reset accumulations ("build_interscene") number
quadCLTs
[
ref_index
].
set_accum
(
0
);
// reset accumulations ("build_interscene") number
...
@@ -2094,7 +2081,7 @@ public class Interscene {
...
@@ -2094,7 +2081,7 @@ public class Interscene {
scenes_xyzatr
[
ref_index
]
=
new
double
[
2
][
3
];
// all zeros
scenes_xyzatr
[
ref_index
]
=
new
double
[
2
][
3
];
// all zeros
// should have at least next or previous non-null
// should have at least next or previous non-null
int
debug_scene
=
69
;
// -68; // -8;
int
debug_scene
=
69
;
// -68; // -8;
double
maximal_series_rms
=
0.0
;
RMSEStats
rmse_stats
=
new
RMSEStats
()
;
if
(
debug_ers
)
{
if
(
debug_ers
)
{
System
.
out
.
println
(
"ERS velocities scale mode = '"
+
dbg_ers_string
+
"'"
);
System
.
out
.
println
(
"ERS velocities scale mode = '"
+
dbg_ers_string
+
"'"
);
}
}
...
@@ -2532,14 +2519,12 @@ public class Interscene {
...
@@ -2532,14 +2519,12 @@ public class Interscene {
adjusted_xyzatr_dt
[
1
]
adjusted_xyzatr_dt
[
1
]
);
);
if
(
lma_rms
[
0
]
>
maximal_series_rms
)
{
rmse_stats
.
add
(
lma_rms
[
0
]);
maximal_series_rms
=
lma_rms
[
0
];
}
if
(
debugLevel
>
-
3
)
{
if
(
debugLevel
>
-
3
)
{
System
.
out
.
println
(
"reAdjustPairsLMAInterscene "
+
nscene
+
" (of "
+
quadCLTs
.
length
+
") "
+
System
.
out
.
println
(
"reAdjustPairsLMAInterscene "
+
nscene
+
" (of "
+
quadCLTs
.
length
+
") "
+
quadCLTs
[
ref_index
].
getImageName
()
+
"/"
+
ts
+
quadCLTs
[
ref_index
].
getImageName
()
+
"/"
+
ts
+
" Done. RMS="
+
lma_rms
[
0
]+
", maximal so far was "
+
maximal_series_rms
);
" Done. RMS="
+
lma_rms
[
0
]+
", maximal so far was "
+
rmse_stats
.
getMax
()+
", average was "
+
rmse_stats
.
getAverage
());
}
}
}
// if (nscene == ref_index) else
}
// if (nscene == ref_index) else
}
// for (int nscene = ref_index; nscene > earliest_scene; nscene--) {
}
// for (int nscene = ref_index; nscene > earliest_scene; nscene--) {
...
@@ -2646,13 +2631,12 @@ public class Interscene {
...
@@ -2646,13 +2631,12 @@ public class Interscene {
scenes_xyzatr
[
fpn_pairs
[
ipair
][
0
]][
1
],
scenes_xyzatr
[
fpn_pairs
[
ipair
][
0
]][
1
],
adjusted_xyzatr_dt
[
0
],
adjusted_xyzatr_dt
[
0
],
adjusted_xyzatr_dt
[
1
]);
adjusted_xyzatr_dt
[
1
]);
if
(
lma_rms
[
0
]
>
maximal_series_rms
)
{
rmse_stats
.
add
(
lma_rms
[
0
]);
maximal_series_rms
=
lma_rms
[
0
];
}
if
(
debugLevel
>
-
3
)
{
if
(
debugLevel
>
-
3
)
{
System
.
out
.
println
(
"reAdjustPairsLMAInterscene "
+
fpn_pairs
[
ipair
][
0
]+
" (of "
+
quadCLTs
.
length
+
") "
+
System
.
out
.
println
(
"reAdjustPairsLMAInterscene "
+
fpn_pairs
[
ipair
][
0
]+
" (of "
+
quadCLTs
.
length
+
") "
+
quadCLTs
[
fpn_pairs
[
ipair
][
1
]].
getImageName
()
+
"/"
+
quadCLTs
[
fpn_pairs
[
ipair
][
0
]].
getImageName
()+
quadCLTs
[
fpn_pairs
[
ipair
][
1
]].
getImageName
()
+
"/"
+
quadCLTs
[
fpn_pairs
[
ipair
][
0
]].
getImageName
()+
" Done. RMS="
+
lma_rms
[
0
]+
", maximal so far was "
+
maximal_series_rms
);
" Done. RMS="
+
lma_rms
[
0
]+
", maximal so far was "
+
rmse_stats
.
getMax
()+
", average was "
+
rmse_stats
.
getAverage
());
}
}
}
}
}
}
...
@@ -2718,7 +2702,7 @@ public class Interscene {
...
@@ -2718,7 +2702,7 @@ public class Interscene {
}
}
if
(
debugLevel
>
-
4
)
{
if
(
debugLevel
>
-
4
)
{
System
.
out
.
println
(
"All multi scene passes are Done. Maximal RMSE was "
+
maximal_series_rms
);
System
.
out
.
println
(
"All multi scene passes are Done. Maximal RMSE was "
+
rmse_stats
.
getMax
()+
", average was "
+
rmse_stats
.
getAverage
()
);
}
}
quadCLTs
[
ref_index
].
saveInterProperties
(
// save properties for interscene processing (extrinsics, ers, ...)
quadCLTs
[
ref_index
].
saveInterProperties
(
// save properties for interscene processing (extrinsics, ers, ...)
...
@@ -2734,7 +2718,8 @@ public class Interscene {
...
@@ -2734,7 +2718,8 @@ public class Interscene {
sb
.
append
(
"earliest_scene= "
+
range
[
0
]+
"\n"
);
sb
.
append
(
"earliest_scene= "
+
range
[
0
]+
"\n"
);
sb
.
append
(
"ref_index= "
+
ref_index
+
"\n"
);
sb
.
append
(
"ref_index= "
+
ref_index
+
"\n"
);
sb
.
append
(
"last_index= "
+
range
[
1
]+
"\n"
);
sb
.
append
(
"last_index= "
+
range
[
1
]+
"\n"
);
sb
.
append
(
"Maximal RMSE= "
+
maximal_series_rms
+
"\n"
);
sb
.
append
(
"Maximal RMSE= "
+
rmse_stats
.
getMax
()+
"\n"
);
sb
.
append
(
"Average RMSE= "
+
rmse_stats
.
getAverage
()+
"\n"
);
sb
.
append
(
"lpf_xy= "
+
lpf_xy
+
"\n"
);
sb
.
append
(
"lpf_xy= "
+
lpf_xy
+
"\n"
);
sb
.
append
(
"readjust_xy_ims="
+
readjust_xy_ims
+
"\n"
);
sb
.
append
(
"readjust_xy_ims="
+
readjust_xy_ims
+
"\n"
);
sb
.
append
(
"lma_xyzatr= "
+
lma_xyzatr
+
"\n"
);
sb
.
append
(
"lma_xyzatr= "
+
lma_xyzatr
+
"\n"
);
...
...
src/main/java/com/elphel/imagej/tileprocessor/OpticalFlow.java
View file @
0de865d9
...
@@ -7591,8 +7591,9 @@ public class OpticalFlow {
...
@@ -7591,8 +7591,9 @@ public class OpticalFlow {
Arrays
.
fill
(
dbg_rms_pre
,
Double
.
NaN
);
Arrays
.
fill
(
dbg_rms_pre
,
Double
.
NaN
);
// process scenes before reference
// process scenes before reference
int
dbg_ref_index
=
10
;
// wait for ref_index <= dbg_ref_index and print (manually update dbg_ref_index
int
dbg_ref_index
=
10
;
// wait for ref_index <= dbg_ref_index and print (manually update dbg_ref_index
double
maximal_series_rms
=
0.0
;
RMSEStats
rmse_stats
=
new
RMSEStats
();
double
maximal_series_rms1
=
0.0
;
RMSEStats
rmse_stats1
=
new
RMSEStats
();
if
(
ref_index
>
1
)
{
if
(
ref_index
>
1
)
{
for
(
int
i
=
ref_index
-
2
;
i
>=
0
;
i
--)
{
for
(
int
i
=
ref_index
-
2
;
i
>=
0
;
i
--)
{
QuadCLT
scene_QuadClt
=
scenes
[
i
];
QuadCLT
scene_QuadClt
=
scenes
[
i
];
...
@@ -7672,9 +7673,7 @@ public class OpticalFlow {
...
@@ -7672,9 +7673,7 @@ public class OpticalFlow {
}
}
}
}
}
}
if
(
lma_rms
[
0
]
>
maximal_series_rms
)
{
rmse_stats
.
add
(
lma_rms
[
0
]);
maximal_series_rms
=
lma_rms
[
0
];
}
dbg_rms_pre
[
i
]
=
lma_rms
[
0
];
dbg_rms_pre
[
i
]
=
lma_rms
[
0
];
ers_reference
.
addScene
(
scene_QuadClt
.
getImageName
(),
ers_reference
.
addScene
(
scene_QuadClt
.
getImageName
(),
scenes_xyzatr
[
i
][
0
],
scenes_xyzatr
[
i
][
0
],
...
@@ -7691,8 +7690,8 @@ public class OpticalFlow {
...
@@ -7691,8 +7690,8 @@ public class OpticalFlow {
if
(
debug_level
>
-
1
)
{
if
(
debug_level
>
-
1
)
{
System
.
out
.
println
(
"Pass multi scene "
+
i
+
" (of "
+
scenes
.
length
+
") "
+
System
.
out
.
println
(
"Pass multi scene "
+
i
+
" (of "
+
scenes
.
length
+
") "
+
reference_QuadClt
.
getImageName
()
+
"/"
+
scene_QuadClt
.
getImageName
()+
reference_QuadClt
.
getImageName
()
+
"/"
+
scene_QuadClt
.
getImageName
()+
" Done. RMS="
+
lma_rms
[
0
]+
", maximal so far was "
+
maximal_series_rms
);
" Done. RMS="
+
lma_rms
[
0
]+
}
", maximal so far was "
+
rmse_stats
.
getMax
()+
", average was "
+
rmse_stats
.
getAverage
());
}
if
(
delete_scene_asap
)
{
if
(
delete_scene_asap
)
{
scenes
[
i
+
1
]
=
null
;
scenes
[
i
+
1
]
=
null
;
}
}
...
@@ -7775,9 +7774,7 @@ public class OpticalFlow {
...
@@ -7775,9 +7774,7 @@ public class OpticalFlow {
0.0
,
// double max_rms,
0.0
,
// double max_rms,
debug_level
);
// int debug_level)
debug_level
);
// int debug_level)
}
}
if
(
lma_rms
[
0
]
>
maximal_series_rms
)
{
rmse_stats
.
add
(
lma_rms
[
0
]);
maximal_series_rms
=
lma_rms
[
0
];
}
dbg_rms_pre
[
i
]
=
lma_rms
[
0
];
dbg_rms_pre
[
i
]
=
lma_rms
[
0
];
ers_reference
.
addScene
(
scene_QuadClt
.
getImageName
(),
ers_reference
.
addScene
(
scene_QuadClt
.
getImageName
(),
scenes_xyzatr
[
i
][
0
],
scenes_xyzatr
[
i
][
0
],
...
@@ -7794,7 +7791,8 @@ public class OpticalFlow {
...
@@ -7794,7 +7791,8 @@ public class OpticalFlow {
if
(
debug_level
>
-
1
)
{
if
(
debug_level
>
-
1
)
{
System
.
out
.
println
(
"Pass multi scene "
+
i
+
" (of "
+
scenes
.
length
+
") "
+
System
.
out
.
println
(
"Pass multi scene "
+
i
+
" (of "
+
scenes
.
length
+
") "
+
reference_QuadClt
.
getImageName
()
+
"/"
+
scene_QuadClt
.
getImageName
()+
reference_QuadClt
.
getImageName
()
+
"/"
+
scene_QuadClt
.
getImageName
()+
" Done. RMS="
+
lma_rms
[
0
]+
", maximal so far was "
+
maximal_series_rms
);
" Done. RMS="
+
lma_rms
[
0
]+
", maximal so far was "
+
rmse_stats
.
getMax
()+
", average was "
+
rmse_stats
.
getAverage
());
}
}
if
(
delete_scene_asap
)
{
if
(
delete_scene_asap
)
{
scenes
[
i
-
1
]
=
null
;
scenes
[
i
-
1
]
=
null
;
...
@@ -7802,7 +7800,7 @@ public class OpticalFlow {
...
@@ -7802,7 +7800,7 @@ public class OpticalFlow {
}
}
}
}
if
(
debug_level
>
-
3
)
{
if
(
debug_level
>
-
3
)
{
System
.
out
.
println
(
"All multi scene passes are Done. Maximal RMSE was "
+
maximal_series_rms
);
System
.
out
.
println
(
"All multi scene passes are Done. Maximal RMSE was "
+
rmse_stats
.
getMax
()+
", average was "
+
rmse_stats
.
getAverage
()
);
}
}
// boolean show_results = true;
// boolean show_results = true;
...
@@ -7922,9 +7920,7 @@ public class OpticalFlow {
...
@@ -7922,9 +7920,7 @@ public class OpticalFlow {
0.0
,
// double max_rms,
0.0
,
// double max_rms,
debug_level
);
// int debug_level)
debug_level
);
// int debug_level)
}
}
if
(
lma_rms
[
0
]
>
maximal_series_rms1
)
{
rmse_stats1
.
add
(
lma_rms
[
0
]);
maximal_series_rms1
=
lma_rms
[
0
];
}
dbg_rms
[
i
]
=
lma_rms
[
0
];
dbg_rms
[
i
]
=
lma_rms
[
0
];
ers_reference
.
addScene
(
ers_reference
.
addScene
(
scene_ts
,
scene_ts
,
...
@@ -7944,7 +7940,8 @@ public class OpticalFlow {
...
@@ -7944,7 +7940,8 @@ public class OpticalFlow {
if
(
debug_level
>
-
1
)
{
if
(
debug_level
>
-
1
)
{
System
.
out
.
println
(
"Pass 2 multi scene "
+
i
+
" (of "
+
scenes
.
length
+
") "
+
System
.
out
.
println
(
"Pass 2 multi scene "
+
i
+
" (of "
+
scenes
.
length
+
") "
+
reference_QuadClt
.
getImageName
()
+
"/"
+
scene_ts
+
reference_QuadClt
.
getImageName
()
+
"/"
+
scene_ts
+
" Done. RMS="
+
lma_rms
[
0
]+
", maximal so far was "
+
maximal_series_rms
);
" Done. RMS="
+
lma_rms
[
0
]+
", maximal so far was "
+
rmse_stats
.
getMax
()+
", average was "
+
rmse_stats
.
getAverage
());
}
}
if
(
delete_scene_asap
)
{
if
(
delete_scene_asap
)
{
scenes
[
i
-
1
]
=
null
;
scenes
[
i
-
1
]
=
null
;
...
@@ -7965,7 +7962,7 @@ public class OpticalFlow {
...
@@ -7965,7 +7962,7 @@ public class OpticalFlow {
rms_mean
/=
rms_num
;
rms_mean
/=
rms_num
;
if
(
debug_level
>
-
3
)
{
if
(
debug_level
>
-
3
)
{
System
.
out
.
println
(
"adjustSeries() rms_pre_mean="
+
rms_pre_mean
+
", rms_mean="
+
System
.
out
.
println
(
"adjustSeries() rms_pre_mean="
+
rms_pre_mean
+
", rms_mean="
+
rms_mean
+
", maximal RMSE="
+
maximal_series_rms1
);
rms_mean
+
", maximal RMSE="
+
rmse_stats1
.
getMax
()+
", average was "
+
rmse_stats1
.
getAverage
()
);
}
}
if
(
show_results
)
{
if
(
show_results
)
{
...
@@ -8125,8 +8122,8 @@ public class OpticalFlow {
...
@@ -8125,8 +8122,8 @@ public class OpticalFlow {
8
);
// int iscale) // 8
8
);
// int iscale) // 8
}
}
if
(
debug_level
>
-
3
)
{
if
(
debug_level
>
-
3
)
{
System
.
out
.
println
(
"adjustSeries() Done. Maximal RMSE in pass1 was "
+
maximal_series_rms
+
System
.
out
.
println
(
"adjustSeries() Done. Maximal RMSE in pass1 was "
+
rmse_stats
.
getMax
()+
", average was "
+
rmse_stats
.
getAverage
()
+
", in pass2 - "
+
maximal_series_rms1
);
", in pass2 - "
+
rmse_stats1
.
getMax
()+
", average was "
+
rmse_stats1
.
getAverage
()
);
}
}
}
}
...
...
src/main/java/com/elphel/imagej/tileprocessor/RMSEStats.java
0 → 100644
View file @
0de865d9
package
com
.
elphel
.
imagej
.
tileprocessor
;
public
class
RMSEStats
{
public
double
max
=
0
;
public
double
sum2
=
0
;
public
int
num
=
0
;
public
void
add
(
double
rmse
)
{
sum2
+=
rmse
*
rmse
;
num
++;
max
=
Math
.
max
(
max
,
rmse
);
}
public
double
getMax
()
{
return
max
;
}
public
int
getNum
()
{
return
num
;
}
public
double
getAverage
()
{
return
Math
.
sqrt
(
sum2
/
num
);
}
}
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