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
4aec6d1f
Commit
4aec6d1f
authored
Aug 31, 2024
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Before trying to fix GEO output
parent
bc9e1a60
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
660 additions
and
46 deletions
+660
-46
EyesisCorrectionParameters.java
...com/elphel/imagej/cameras/EyesisCorrectionParameters.java
+1
-0
ComboMatch.java
src/main/java/com/elphel/imagej/orthomosaic/ComboMatch.java
+1
-1
FloatImageData.java
...in/java/com/elphel/imagej/orthomosaic/FloatImageData.java
+17
-0
OrientationSceneLMA.java
...va/com/elphel/imagej/orthomosaic/OrientationSceneLMA.java
+10
-1
OrthoAltitudeMatch.java
...ava/com/elphel/imagej/orthomosaic/OrthoAltitudeMatch.java
+17
-18
OrthoEqualizeLMA.java
.../java/com/elphel/imagej/orthomosaic/OrthoEqualizeLMA.java
+1
-1
OrthoMap.java
src/main/java/com/elphel/imagej/orthomosaic/OrthoMap.java
+6
-0
OrthoMapsCollection.java
...va/com/elphel/imagej/orthomosaic/OrthoMapsCollection.java
+554
-23
PairwiseOrthoMatch.java
...ava/com/elphel/imagej/orthomosaic/PairwiseOrthoMatch.java
+7
-0
QuatUtils.java
src/main/java/com/elphel/imagej/orthomosaic/QuatUtils.java
+38
-0
IntersceneMatchParameters.java
...lphel/imagej/tileprocessor/IntersceneMatchParameters.java
+7
-2
TwoQuadCLT.java
...main/java/com/elphel/imagej/tileprocessor/TwoQuadCLT.java
+1
-0
No files found.
src/main/java/com/elphel/imagej/cameras/EyesisCorrectionParameters.java
View file @
4aec6d1f
...
...
@@ -1609,6 +1609,7 @@ public class EyesisCorrectionParameters {
e
.
printStackTrace
();
return
null
;
}
System
.
out
.
println
(
"First line: "
+
lines
.
get
(
0
)+
"\n"
);
Path
base_path
=
seq_path
.
getParent
();
// first - scan all file and set sourceDirectory, x3dDirectory, linkedModels,videoDirectory,resultsDirectory
HashMap
<
String
,
String
>
dir_map
=
new
HashMap
<
String
,
String
>();
...
...
src/main/java/com/elphel/imagej/orthomosaic/ComboMatch.java
View file @
4aec6d1f
...
...
@@ -177,7 +177,7 @@ public class ComboMatch {
boolean
use_saved_collection
=
true
;
// false;
boolean
save_collection
=
false
;
//
true;
boolean
save_collection
=
true
;
boolean
process_correlation
=
true
;
// use false to save new version of data
int
num_tries_fit
=
10
;
boolean
update_match
=
true
;
// use false to save new version of data
...
...
src/main/java/com/elphel/imagej/orthomosaic/FloatImageData.java
View file @
4aec6d1f
...
...
@@ -26,6 +26,23 @@ public class FloatImageData {
this
.
data
=
data
;
}
public
double
[]
getDData
()
{
final
double
[]
ddata
=
new
double
[
data
.
length
];
final
Thread
[]
threads
=
ImageDtt
.
newThreadArray
();
final
AtomicInteger
ai
=
new
AtomicInteger
(
0
);
for
(
int
ithread
=
0
;
ithread
<
threads
.
length
;
ithread
++)
{
threads
[
ithread
]
=
new
Thread
()
{
public
void
run
()
{
for
(
int
ipix
=
ai
.
getAndIncrement
();
ipix
<
data
.
length
;
ipix
=
ai
.
getAndIncrement
())
{
ddata
[
ipix
]
=
data
[
ipix
];
}
}
};
}
ImageDtt
.
startAndJoin
(
threads
);
return
ddata
;
}
public
static
int
getZoomLevel
(
double
pix_in_meters
)
{
return
getZoomLevel
(
pix_in_meters
,
null
,
null
);
...
...
src/main/java/com/elphel/imagej/orthomosaic/OrientationSceneLMA.java
View file @
4aec6d1f
...
...
@@ -52,6 +52,15 @@ public class OrientationSceneLMA {
public
int
debug_width
=
12
;
public
int
debug_decimals
=
9
;
public
double
[][]
getOrientationQuaternions
(){
double
[][]
qorient
=
new
double
[
num_scenes
][
4
];
for
(
int
nscene
=
0
;
nscene
<
num_scenes
;
nscene
++)
{
for
(
int
i
=
0
;
i
<
4
;
i
++)
{
qorient
[
nscene
][
i
]
=
parameters_vector
[
4
*
nscene
+
i
];
}
}
return
qorient
;
}
public
int
prepareLMA
(
int
[]
indices
,
// should all be used
...
...
@@ -81,7 +90,7 @@ public class OrientationSceneLMA {
double
[]
pull4
=
{
pull_scales
,
pull_tilts
/
2
,
pull_tilts
/
2
,
pull_rots
};
double
sum_pull4
=
0
;
for
(
double
w:
weights
4
)
sum_pull4
+=
w
;
for
(
double
w:
pull
4
)
sum_pull4
+=
w
;
if
(
sum_pull4
<=
0
)
{
pull
=
0
;
}
...
...
src/main/java/com/elphel/imagej/orthomosaic/OrthoAltitudeMatch.java
View file @
4aec6d1f
...
...
@@ -76,7 +76,7 @@ public class OrthoAltitudeMatch {
boolean
invert_y
=
true
;
// only for tilts->affines
boolean
show_details
=
false
;
boolean
do_not_save
=
tru
e
;
boolean
do_not_save
=
fals
e
;
// OrientationSceneLMA.testGetPairErrQuaternion ();
// OrientationSceneLMA.testGetPairPairScaleDirError();
...
...
@@ -890,7 +890,7 @@ public class OrthoAltitudeMatch {
}
// double tilt_err_threshold = 0.01; // reduce weight if larger
//overlop_pow = 2.0
/*
for (int npair = 0; npair <quat_pairs.length; npair++ ) {
System.out.println("quat_pairs["+npair+"]="+QuatUtils.toString(quat_pairs[npair],use_degrees));
}
...
...
@@ -923,7 +923,7 @@ public class OrthoAltitudeMatch {
SingularValueDecomposition svd = SingularValueDecomposition.singularValueDecomposeScaleTiltGamma(affine_pairs[npair], y_down_ccw); // boolean y_down_ccw)
System.out.println("svd_affine["+npair+"]=" + svd.toString(use_degrees));
}
*/
double
max_flat_err
=
0
;
// tilt_err_threshold
for
(
int
npair
=
0
;
npair
<
num_pairs
;
npair
++)
{
...
...
@@ -964,17 +964,23 @@ public class OrthoAltitudeMatch {
last_run
,
// boolean last_run,
null
,
// String dbg_prefix,
debugLevel
);
// int debug_level)
System
.
out
.
println
(
"LMA -> "
+
lma_rslt
);
if
(
lma_rslt
>=
0
)
{
if
(
debugLevel
>
-
3
)
{
//ersTiltLMA.printSceneResults(use_degrees, use_percents);
//ersTiltLMA.printPairsResults(use_degrees, use_percents);
System
.
out
.
println
(
"LMA -> "
+
lma_rslt
);
double
[][]
qorients
=
orientationSceneLMA
.
getOrientationQuaternions
();
for
(
int
nscene
=
0
;
nscene
<
indices
.
length
;
nscene
++)
{
ortho_maps
[
indices
[
nscene
]].
setQOrient
(
qorients
[
nscene
]);
}
for
(
int
npair
=
0
;
npair
<
quat_pairs
.
length
;
npair
++)
{
int
[]
cpair
=
condensed_pairs
[
npair
];
// index alt_multi
int
[]
ipair
=
{
indices
[
cpair
[
0
]],
indices
[
cpair
[
1
]]};
PairwiseOrthoMatch
pairwiseOrthoMatch
=
ortho_maps
[
ipair
[
0
]].
getMatch
(
ortho_maps
[
ipair
[
1
]].
getName
(),
true
);
// ?
pairwiseOrthoMatch
.
setQuaternion
(
quat_pairs
[
npair
]);
}
}
System
.
out
.
println
();
/*
ERSTiltLMA ersTiltLMA = new ERSTiltLMA();
ersTiltLMA.prepareLMA(
...
...
@@ -986,15 +992,6 @@ public class OrthoAltitudeMatch {
scene_tilts_pairs, // double [][][] tilts, // [pair][scene(2)][tilt(2)]
affine_pairs, // double [][][] affine_pairs,
debugLevel); // int debug_level)
/*
double lambda = 0.1;
double lambda_scale_good = 0.5;
double lambda_scale_bad = 8.0;
double lambda_max = 1000;
boolean last_run = false;
double rms_diff = 0.0001;
int num_iter = 100;
*/
lma_rslt=ersTiltLMA.runLma( // <0 - failed, >=0 iteration number (1 - immediately)
lambda, // double lambda, // 0.1
lambda_scale_good,// double lambda_scale_good,// 0.5
...
...
@@ -1027,6 +1024,8 @@ public class OrthoAltitudeMatch {
}
*/
//printResults(boolean degrees)
if
(
orthoMapsCollection_path
!=
null
)
{
try
{
...
...
src/main/java/com/elphel/imagej/orthomosaic/OrthoEqualizeLMA.java
View file @
4aec6d1f
...
...
@@ -135,7 +135,7 @@ public class OrthoEqualizeLMA {
int
[]
indices
=
maps_collection
.
getScenesSelection
(
null
,
// boolean select_all,
clt_parameters
,
// CLTParameters clt_parameters,
" to build a map"
);
// String purpose)
OrthoEqualizeLMA
oel
=
new
OrthoEqualizeLMA
();
oel
.
prepareLMA
(
...
...
src/main/java/com/elphel/imagej/orthomosaic/OrthoMap.java
View file @
4aec6d1f
...
...
@@ -160,6 +160,7 @@ public class OrthoMap implements Comparable <OrthoMap>, Serializable{
oos
.
writeObject
(
num_scenes
);
oos
.
writeObject
(
sfm_gain
);
oos
.
writeObject
(
equalize
);
oos
.
writeObject
(
qorient
);
}
private
void
readObject
(
ObjectInputStream
ois
)
throws
ClassNotFoundException
,
IOException
{
...
...
@@ -185,6 +186,11 @@ public class OrthoMap implements Comparable <OrthoMap>, Serializable{
sfm_gain
=
(
double
)
ois
.
readObject
();
// equalize = new double[] {1,0};
equalize
=
(
double
[])
ois
.
readObject
();
if
(
OrthoMapsCollection
.
CURRENT_VERSION
>=
OrthoMapsCollection
.
VERSION_POST_ORIENT
)
{
qorient
=
(
double
[])
ois
.
readObject
();
}
images
=
new
HashMap
<
Integer
,
FloatImageData
>();
// field images was not saved
averageImagePixel
=
Double
.
NaN
;
// average image pixel value (to combine with raw)
...
...
src/main/java/com/elphel/imagej/orthomosaic/OrthoMapsCollection.java
View file @
4aec6d1f
This diff is collapsed.
Click to expand it.
src/main/java/com/elphel/imagej/orthomosaic/PairwiseOrthoMatch.java
View file @
4aec6d1f
...
...
@@ -308,6 +308,8 @@ public class PairwiseOrthoMatch implements Serializable {
oos
.
writeObject
(
overlap
);
oos
.
writeObject
(
equalize1to0
);
oos
.
writeObject
(
alt_data
);
oos
.
writeObject
(
quat
);
oos
.
writeObject
(
qaffine
);
}
private
void
readObject
(
ObjectInputStream
ois
)
throws
ClassNotFoundException
,
IOException
{
...
...
@@ -327,6 +329,11 @@ public class PairwiseOrthoMatch implements Serializable {
if
(!
READ_NO_ALT
)
{
alt_data
=
(
double
[])
ois
.
readObject
();
}
if
(
OrthoMapsCollection
.
CURRENT_VERSION
>=
OrthoMapsCollection
.
VERSION_POST_ORIENT
)
{
quat
=
(
double
[])
ois
.
readObject
();
qaffine
=
(
double
[][])
ois
.
readObject
();
}
}
//private void readObjectNoData() throws ObjectStreamException; // used to modify default values
}
src/main/java/com/elphel/imagej/orthomosaic/QuatUtils.java
View file @
4aec6d1f
...
...
@@ -1840,5 +1840,43 @@ q11 - q22 = c3
return
;
}
public
static
void
applyTo
(
final
double
[]
q
,
final
double
[]
in
,
final
double
[]
out
)
{
final
double
q0
=
q
[
0
];
final
double
q1
=
q
[
1
];
final
double
q2
=
q
[
2
];
final
double
q3
=
q
[
3
];
final
double
x
=
in
[
0
];
final
double
y
=
in
[
1
];
final
double
z
=
in
[
2
];
final
double
s
=
q1
*
x
+
q2
*
y
+
q3
*
z
;
out
[
0
]
=
2
*
(
q0
*
(
x
*
q0
-
(
q2
*
z
-
q3
*
y
))
+
s
*
q1
)
-
x
;
out
[
1
]
=
2
*
(
q0
*
(
y
*
q0
-
(
q3
*
x
-
q1
*
z
))
+
s
*
q2
)
-
y
;
out
[
2
]
=
2
*
(
q0
*
(
z
*
q0
-
(
q1
*
y
-
q2
*
x
))
+
s
*
q3
)
-
z
;
}
public
static
void
applyTo
(
final
double
k
,
// scale
final
double
[]
q
,
final
double
[]
in
,
final
double
[]
out
)
{
final
double
q0
=
q
[
0
];
final
double
q1
=
q
[
1
];
final
double
q2
=
q
[
2
];
final
double
q3
=
q
[
3
];
final
double
x
=
in
[
0
];
final
double
y
=
in
[
1
];
final
double
z
=
in
[
2
];
final
double
s
=
q1
*
x
+
q2
*
y
+
q3
*
z
;
out
[
0
]
=
k
*
(
2
*
(
q0
*
(
x
*
q0
-
(
q2
*
z
-
q3
*
y
))
+
s
*
q1
)
-
x
);
out
[
1
]
=
k
*
(
2
*
(
q0
*
(
y
*
q0
-
(
q3
*
x
-
q1
*
z
))
+
s
*
q2
)
-
y
);
out
[
2
]
=
k
*
(
2
*
(
q0
*
(
z
*
q0
-
(
q1
*
y
-
q2
*
x
))
+
s
*
q3
)
-
z
);
}
}
src/main/java/com/elphel/imagej/tileprocessor/IntersceneMatchParameters.java
View file @
4aec6d1f
...
...
@@ -35,6 +35,7 @@ public class IntersceneMatchParameters {
public
static
String
[]
MODES3D
=
{
"RAW"
,
"INF"
,
"FG"
,
"BG"
};
// RAW:-1
public
static
String
[]
MODES_AVI
=
{
"RAW"
,
"JPEG"
,
"PNG"
};
public
static
String
[]
FLT_ALT_MODES
=
{
"--- (no ALT filter)"
,
"ALT only"
,
"no ALT only"
};
public
static
String
[]
FLT_ORIENT_MODES
=
{
"--- (no ORIENT filter)"
,
"ORIENT only"
,
"no ORIENT only"
};
// Maybe add parameters to make sure there is enough data? Enough in each zone? Enough spread?
public
boolean
ims_use
=
true
;
// use IMS data
...
...
@@ -223,6 +224,7 @@ public class IntersceneMatchParameters {
public
double
flt_min_sfm
=
0.0
;
// minimal minimal SfM gain of a pair
public
double
flt_max_sfm
=
1000.0
;
// maximal minimal SfM gain of a pair
public
int
flt_alt
=
0
;
// 0 - do not filter, 1 - keep only with alt data, 2 - keep only without alt data
public
int
flt_orient
=
0
;
// 0 - do not filter, 1 - keep only with orientation data, 2 - keep only without orientation data
public
boolean
flt_show_names
=
true
;
public
boolean
flt_show_overlaps
=
true
;
...
...
@@ -987,6 +989,7 @@ min_str_neib_fpn 0.35
gd
.
addNumericField
(
"Minimal SfM gain"
,
this
.
flt_min_sfm
,
3
,
7
,
""
,
"Minimal SfM gain of the minimum in the scene pair."
);
gd
.
addNumericField
(
"Maximal SfM gain"
,
this
.
flt_max_sfm
,
3
,
7
,
""
,
"Maximal SfM gain of the minimum in the scene pair."
);
gd
.
addChoice
(
"Filter by pairwise ALT availability"
,
FLT_ALT_MODES
,
FLT_ALT_MODES
[
this
.
flt_alt
],
"Filter by pairwise ALT availability."
);
gd
.
addChoice
(
"Filter by orientation availability"
,
FLT_ORIENT_MODES
,
FLT_ORIENT_MODES
[
this
.
flt_orient
],
"Filter by the scene orientation availability."
);
gd
.
addCheckbox
(
"Show scene names"
,
this
.
flt_show_names
,
"Show scene full names (timestamps) in selection drop-down list."
);
gd
.
addCheckbox
(
"Show scene overlaps"
,
this
.
flt_show_overlaps
,
"Show scene overlaps (in percents) in selection drop-down list."
);
...
...
@@ -1997,6 +2000,7 @@ min_str_neib_fpn 0.35
this
.
flt_max_sfm
=
gd
.
getNextNumber
();
this
.
flt_alt
=
gd
.
getNextChoiceIndex
();
this
.
flt_orient
=
gd
.
getNextChoiceIndex
();
this
.
flt_show_names
=
gd
.
getNextBoolean
();
this
.
flt_show_overlaps
=
gd
.
getNextBoolean
();
this
.
flt_show_rms
=
gd
.
getNextBoolean
();
...
...
@@ -2598,6 +2602,7 @@ min_str_neib_fpn 0.35
properties
.
setProperty
(
prefix
+
"flt_min_sfm"
,
this
.
flt_min_sfm
+
""
);
// double
properties
.
setProperty
(
prefix
+
"flt_max_sfm"
,
this
.
flt_max_sfm
+
""
);
// double
properties
.
setProperty
(
prefix
+
"flt_alt"
,
this
.
flt_alt
+
""
);
// int
properties
.
setProperty
(
prefix
+
"flt_orient"
,
this
.
flt_orient
+
""
);
// int
properties
.
setProperty
(
prefix
+
"flt_show_names"
,
this
.
flt_show_names
+
""
);
// boolean
properties
.
setProperty
(
prefix
+
"flt_show_overlaps"
,
this
.
flt_show_overlaps
+
""
);
// boolean
properties
.
setProperty
(
prefix
+
"flt_show_rms"
,
this
.
flt_show_rms
+
""
);
// boolean
...
...
@@ -3165,6 +3170,7 @@ min_str_neib_fpn 0.35
if
(
properties
.
getProperty
(
prefix
+
"flt_min_sfm"
)!=
null
)
this
.
flt_min_sfm
=
Double
.
parseDouble
(
properties
.
getProperty
(
prefix
+
"flt_min_sfm"
));
if
(
properties
.
getProperty
(
prefix
+
"flt_max_sfm"
)!=
null
)
this
.
flt_max_sfm
=
Double
.
parseDouble
(
properties
.
getProperty
(
prefix
+
"flt_max_sfm"
));
if
(
properties
.
getProperty
(
prefix
+
"flt_alt"
)!=
null
)
this
.
flt_alt
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"flt_alt"
));
if
(
properties
.
getProperty
(
prefix
+
"flt_orient"
)!=
null
)
this
.
flt_orient
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"flt_orient"
));
if
(
properties
.
getProperty
(
prefix
+
"flt_show_names"
)!=
null
)
this
.
flt_show_names
=
Boolean
.
parseBoolean
(
properties
.
getProperty
(
prefix
+
"flt_show_names"
));
if
(
properties
.
getProperty
(
prefix
+
"flt_show_overlaps"
)!=
null
)
this
.
flt_show_overlaps
=
Boolean
.
parseBoolean
(
properties
.
getProperty
(
prefix
+
"flt_show_overlaps"
));
if
(
properties
.
getProperty
(
prefix
+
"flt_show_rms"
)!=
null
)
this
.
flt_show_rms
=
Boolean
.
parseBoolean
(
properties
.
getProperty
(
prefix
+
"flt_show_rms"
));
...
...
@@ -3753,9 +3759,8 @@ min_str_neib_fpn 0.35
imp
.
flt_min_sfm
=
this
.
flt_min_sfm
;
imp
.
flt_max_sfm
=
this
.
flt_max_sfm
;
imp
.
flt_alt
=
this
.
flt_alt
;
imp
.
flt_orient
=
this
.
flt_orient
;
imp
.
flt_show_names
=
this
.
flt_show_names
;
imp
.
flt_show_overlaps
=
this
.
flt_show_overlaps
;
imp
.
flt_show_rms
=
this
.
flt_show_rms
;
...
...
src/main/java/com/elphel/imagej/tileprocessor/TwoQuadCLT.java
View file @
4aec6d1f
...
...
@@ -8556,6 +8556,7 @@ if (debugLevel > -100) return true; // temporarily !
EyesisCorrectionParameters
.
CorrectionParameters
.
PathFirstLast
[]
pathFirstLast
=
null
;
int
num_seq
=
1
;
if
(
quadCLT_main
.
correctionsParameters
.
useSourceList
)
{
System
.
out
.
println
(
"\nReading source list from file: "
+
quadCLT_main
.
correctionsParameters
.
sourceSequencesList
);
pathFirstLast
=
quadCLT_main
.
correctionsParameters
.
getSourceSets
(
quadCLT_main
.
correctionsParameters
.
sourceSequencesList
);
if
(
pathFirstLast
!=
null
)
{
...
...
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