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
e64fe051
Commit
e64fe051
authored
Sep 07, 2024
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated version working
parent
7f9773fb
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
31 deletions
+51
-31
ComboMatch.java
src/main/java/com/elphel/imagej/orthomosaic/ComboMatch.java
+16
-15
OrthoMap.java
src/main/java/com/elphel/imagej/orthomosaic/OrthoMap.java
+4
-4
OrthoMapsCollection.java
...va/com/elphel/imagej/orthomosaic/OrthoMapsCollection.java
+11
-1
PairwiseOrthoMatch.java
...ava/com/elphel/imagej/orthomosaic/PairwiseOrthoMatch.java
+20
-11
No files found.
src/main/java/com/elphel/imagej/orthomosaic/ComboMatch.java
View file @
e64fe051
...
@@ -175,7 +175,7 @@ public class ComboMatch {
...
@@ -175,7 +175,7 @@ public class ComboMatch {
boolean
display_pairs
=
false
;
boolean
display_pairs
=
false
;
boolean
create_map
=
false
;
boolean
create_map
=
false
;
boolean
create_equalize
=
false
;
boolean
create_equalize
=
false
;
boolean
use_saved_collection
=
false
;
//
true; // false;
boolean
use_saved_collection
=
true
;
// false;
boolean
save_collection
=
false
;
// true;
boolean
save_collection
=
false
;
// true;
boolean
process_correlation
=
true
;
// use false to save new version of data
boolean
process_correlation
=
true
;
// use false to save new version of data
int
num_tries_fit
=
10
;
int
num_tries_fit
=
10
;
...
@@ -339,7 +339,7 @@ public class ComboMatch {
...
@@ -339,7 +339,7 @@ public class ComboMatch {
maps_collection
=
OrthoMapsCollection
.
readOrthoMapsCollection
(
orthoMapsCollection_path
);
maps_collection
=
OrthoMapsCollection
.
readOrthoMapsCollection
(
orthoMapsCollection_path
);
}
catch
(
ClassNotFoundException
|
IOException
e
)
{
}
catch
(
ClassNotFoundException
|
IOException
e
)
{
use_files_list
=
true
;
use_files_list
=
true
;
System
.
out
.
println
(
"Saved data not found: "
+
orthoMapsCollection_path
+
", building from a list "
+
files_list_path
);
System
.
out
.
println
(
"Saved data not found
(or is corrupt)
: "
+
orthoMapsCollection_path
+
", building from a list "
+
files_list_path
);
}
}
//files_list_path
//files_list_path
if
(!
use_files_list
)
{
if
(!
use_files_list
)
{
...
@@ -361,10 +361,12 @@ public class ComboMatch {
...
@@ -361,10 +361,12 @@ public class ComboMatch {
}
}
if
(
import_export
)
{
if
(
import_export
)
{
return
updateImportExport
(
boolean
OK
=
updateImportExport
(
omtch_img_set
,
// String files_base
omtch_img_set
,
// String files_base
maps_collection
);
// OrthoMapsCollection maps_collection
maps_collection
);
// OrthoMapsCollection maps_collection
if
(!
OK
)
{
return
false
;
}
}
}
...
@@ -867,7 +869,7 @@ public class ComboMatch {
...
@@ -867,7 +869,7 @@ public class ComboMatch {
maps_collection
.
processComboMap
(
maps_collection
.
processComboMap
(
clt_parameters
,
// CLTParameters clt_parameters,
clt_parameters
,
// CLTParameters clt_parameters,
debugLevel
);
debugLevel
);
return
true
;
// return true; // need to save AGL?
}
}
// for all modes - needed for create_overlaps || process_correlation || render_match || pattern_match
// for all modes - needed for create_overlaps || process_correlation || render_match || pattern_match
...
@@ -2689,7 +2691,7 @@ adjusted affines[1] for a pair: 1694564291_293695/1694564778_589341
...
@@ -2689,7 +2691,7 @@ adjusted affines[1] for a pair: 1694564291_293695/1694564778_589341
gd
.
addStringField
(
"Scene affines full path"
,
affines_path
,
150
,
"Path to import/export scenes affines."
);
gd
.
addStringField
(
"Scene affines full path"
,
affines_path
,
150
,
"Path to import/export scenes affines."
);
gd
.
addStringField
(
"Pairwise affines full path"
,
affines2_path
,
150
,
"Path to import/export scenes pairs affines."
);
gd
.
addStringField
(
"Pairwise affines full path"
,
affines2_path
,
150
,
"Path to import/export scenes pairs affines."
);
gd
.
addCheckbox
(
"Update scene files"
,
update_files
,
"Re-read files as specified in .list file, possibly changing versions"
);
gd
.
addCheckbox
(
"Update scene files"
,
update_files
,
"Re-read files as specified in .list file, possibly changing versions"
);
gd
.
addCheckbox
(
"Update files metadata"
,
update_lla
,
"Re-read files metadata (if it was modified)"
);
gd
.
addCheckbox
(
"Update files metadata"
,
update_lla
,
"Re-read files metadata (if it was modified)
, needed to calculate AGL.
"
);
gd
.
addCheckbox
(
"Update kernels/patterns"
,
update_kernel_patterns
,
"Re-read kernels and patterns from *.list file"
);
gd
.
addCheckbox
(
"Update kernels/patterns"
,
update_kernel_patterns
,
"Re-read kernels and patterns from *.list file"
);
gd
.
addCheckbox
(
"Export scene affines"
,
export_affine
,
"Export per-scene affines in text format for migration."
);
gd
.
addCheckbox
(
"Export scene affines"
,
export_affine
,
"Export per-scene affines in text format for migration."
);
gd
.
addCheckbox
(
"Export pairs affines"
,
export_affine2
,
"Export per-pair affines in text format for migration."
);
gd
.
addCheckbox
(
"Export pairs affines"
,
export_affine2
,
"Export per-pair affines in text format for migration."
);
...
@@ -2726,7 +2728,7 @@ adjusted affines[1] for a pair: 1694564291_293695/1694564778_589341
...
@@ -2726,7 +2728,7 @@ adjusted affines[1] for a pair: 1694564291_293695/1694564778_589341
if
(
update_lla
)
{
if
(
update_lla
)
{
System
.
out
.
println
(
"Updating map files metadata"
);
System
.
out
.
println
(
"Updating map files metadata"
);
maps_collection
.
updateLLA
();
maps_collection
.
updateLLA
();
maps_collection
.
updateNumberScenes
();
// maps_collection.updateNumberScenes(); It is very long
maps_collection
.
updateSfmGain
();
maps_collection
.
updateSfmGain
();
}
}
if
(
update_kernel_patterns
)
{
if
(
update_kernel_patterns
)
{
...
@@ -2807,14 +2809,14 @@ adjusted affines[1] for a pair: 1694564291_293695/1694564778_589341
...
@@ -2807,14 +2809,14 @@ adjusted affines[1] for a pair: 1694564291_293695/1694564778_589341
}
}
}
}
}
}
maps_collection
.
updateNumberScenes
();
//
maps_collection.updateNumberScenes();
System
.
out
.
println
(
"Updated "
+
num_updated_affines
+
" affines of "
+
affine_import
.
size
()+
" specified. There are "
+
System
.
out
.
println
(
"Updated "
+
num_updated_affines
+
" affines of "
+
affine_import
.
size
()+
" specified. There are "
+
maps_collection
.
ortho_maps
.
length
+
" maps in the system."
);
maps_collection
.
ortho_maps
.
length
+
" maps in the system."
);
}
}
if
(
import_affine2
)
{
if
(
import_affine2
)
{
ArrayList
<
Affine2Import
>
affine2_import
=
new
ArrayList
<
Affine2Import
>();
ArrayList
<
Affine2Import
>
affine2_import
=
new
ArrayList
<
Affine2Import
>();
OrthoMapsCollection
.
getPathsAndScenesFromSourceList
(
OrthoMapsCollection
.
getPathsAndScenesFromSourceList
(
affines_path
,
affines
2
_path
,
null
,
// scenes0,
null
,
// scenes0,
null
,
// ArrayList<AltitudeMismatchKernel> kernels,
null
,
// ArrayList<AltitudeMismatchKernel> kernels,
null
,
// ArrayList<GroundObjectPattern> patterns);
null
,
// ArrayList<GroundObjectPattern> patterns);
...
@@ -2823,6 +2825,7 @@ adjusted affines[1] for a pair: 1694564291_293695/1694564778_589341
...
@@ -2823,6 +2825,7 @@ adjusted affines[1] for a pair: 1694564291_293695/1694564778_589341
null
,
// ArrayList<AffineImport> affine_import,
null
,
// ArrayList<AffineImport> affine_import,
affine2_import
);
// ArrayList<Affine2Import> affine2_import) {
affine2_import
);
// ArrayList<Affine2Import> affine2_import) {
int
num_updated_affines
=
0
;
int
num_updated_affines
=
0
;
int
num_new_affines
=
0
;
for
(
Affine2Import
affine2Import:
affine2_import
)
{
for
(
Affine2Import
affine2Import:
affine2_import
)
{
OrthoMap
map
=
maps_collection
.
getMap
(
affine2Import
.
name1
);
OrthoMap
map
=
maps_collection
.
getMap
(
affine2Import
.
name1
);
if
(
map
!=
null
)
{
if
(
map
!=
null
)
{
...
@@ -2831,6 +2834,7 @@ adjusted affines[1] for a pair: 1694564291_293695/1694564778_589341
...
@@ -2831,6 +2834,7 @@ adjusted affines[1] for a pair: 1694564291_293695/1694564778_589341
if
(
overwrite_affine
||
!
pom
.
isAffineNonTrivial
())
{
if
(
overwrite_affine
||
!
pom
.
isAffineNonTrivial
())
{
pom
.
setOverlap
(
affine2Import
.
overlap
);
pom
.
setOverlap
(
affine2Import
.
overlap
);
pom
.
setAffine
(
affine2Import
.
affine
);
// does not clone - OK
pom
.
setAffine
(
affine2Import
.
affine
);
// does not clone - OK
num_updated_affines
++;
}
}
}
else
{
}
else
{
OrthoMap
map2
=
maps_collection
.
getMap
(
affine2Import
.
name2
);
OrthoMap
map2
=
maps_collection
.
getMap
(
affine2Import
.
name2
);
...
@@ -2841,15 +2845,12 @@ adjusted affines[1] for a pair: 1694564291_293695/1694564778_589341
...
@@ -2841,15 +2845,12 @@ adjusted affines[1] for a pair: 1694564291_293695/1694564778_589341
Double
.
NaN
,
// double rms,
Double
.
NaN
,
// double rms,
zoom_lev
,
// int zoom_lev,
zoom_lev
,
// int zoom_lev,
affine2Import
.
overlap
);
// double overlap)
affine2Import
.
overlap
);
// double overlap)
map
.
setMatch
(
map2
.
getName
(),
pom
);
num_new_affines
++;
}
}
}
}
}
}
System
.
out
.
println
(
"Updated "
+
num_updated_affines
+
" pairwise affines, setup new "
+
num_new_affines
+
" matches. Specified "
+
affine2_import
.
size
()+
" matches."
);
}
}
if
(
update_bl_bc
)
{
if
(
update_bl_bc
)
{
...
...
src/main/java/com/elphel/imagej/orthomosaic/OrthoMap.java
View file @
e64fe051
...
@@ -201,16 +201,16 @@ public class OrthoMap implements Comparable <OrthoMap>, Serializable{
...
@@ -201,16 +201,16 @@ public class OrthoMap implements Comparable <OrthoMap>, Serializable{
}
}
public
int
getWidth
()
{
public
int
getWidth
()
{
return
getImage
Data
().
getWidth
();
// orig_width;
return
getImage
().
getWidth
();
// orig_width;
}
}
public
int
getHeight
()
{
public
int
getHeight
()
{
return
getImage
Data
().
getHeight
();
//orig_height;
return
getImage
().
getHeight
();
//orig_height;
}
}
public
int
getAltWidth
()
{
public
int
getAltWidth
()
{
return
getAlt
Data
().
getWidth
();
// orig_width;
return
getAlt
().
getWidth
();
// orig_width;
}
}
public
int
getAltHeight
()
{
public
int
getAltHeight
()
{
return
getAlt
Data
().
getHeight
();
//orig_height;
return
getAlt
().
getHeight
();
//orig_height;
}
}
public
void
setMatch
(
public
void
setMatch
(
...
...
src/main/java/com/elphel/imagej/orthomosaic/OrthoMapsCollection.java
View file @
e64fe051
...
@@ -62,8 +62,9 @@ public class OrthoMapsCollection implements Serializable{
...
@@ -62,8 +62,9 @@ public class OrthoMapsCollection implements Serializable{
public
static
final
int
VERSION_PRE_ORIENT
=
100
;
public
static
final
int
VERSION_PRE_ORIENT
=
100
;
public
static
final
int
VERSION_POST_ORIENT
=
101
;
public
static
final
int
VERSION_POST_ORIENT
=
101
;
public
static
final
int
VERSION_ORANGE
=
102
;
public
static
int
LATEST_VERSION
=
VERSION_
POST_ORIENT
;
// 100; // use when read from .list
public
static
int
LATEST_VERSION
=
VERSION_
ORANGE
;
// 100; // use when read from .list
/// public transient int current_version = LATEST_VERSION;
/// public transient int current_version = LATEST_VERSION;
public
static
int
CURRENT_VERSION
=
LATEST_VERSION
;
public
static
int
CURRENT_VERSION
=
LATEST_VERSION
;
...
@@ -341,14 +342,19 @@ public class OrthoMapsCollection implements Serializable{
...
@@ -341,14 +342,19 @@ public class OrthoMapsCollection implements Serializable{
System
.
out
.
println
(
"updateLLa(): n="
+
n
);
System
.
out
.
println
(
"updateLLa(): n="
+
n
);
}
}
ortho_maps
[
n
].
updateLLA
();
ortho_maps
[
n
].
updateLLA
();
IJ
.
showStatus
(
"Updating LLA "
+
n
+
" of "
+
ortho_maps
.
length
);
IJ
.
showProgress
(
1.0
*
n
/
ortho_maps
.
length
);
}
}
updateAGL
();
updateAGL
();
}
}
public
void
updateAGL
()
{
public
void
updateAGL
()
{
for
(
int
n
=
0
;
n
<
ortho_maps
.
length
;
n
++)
{
for
(
int
n
=
0
;
n
<
ortho_maps
.
length
;
n
++)
{
IJ
.
showStatus
(
"Updating AGL "
+
n
+
" of "
+
ortho_maps
.
length
);
ortho_maps
[
n
].
agl
=
Double
.
NaN
;
ortho_maps
[
n
].
agl
=
Double
.
NaN
;
ortho_maps
[
n
].
agl
=
ortho_maps
[
n
].
getAGL
();
ortho_maps
[
n
].
agl
=
ortho_maps
[
n
].
getAGL
();
IJ
.
showProgress
(
1.0
*
n
/
ortho_maps
.
length
);
}
}
}
}
...
@@ -7122,7 +7128,11 @@ public class OrthoMapsCollection implements Serializable{
...
@@ -7122,7 +7128,11 @@ public class OrthoMapsCollection implements Serializable{
for
(
int
nscene
=
0
;
nscene
<
indices
.
length
;
nscene
++)
{
for
(
int
nscene
=
0
;
nscene
<
indices
.
length
;
nscene
++)
{
int
indx
=
indices
[
nscene
];
int
indx
=
indices
[
nscene
];
System
.
out
.
println
(
"Scene="
+
indx
+
", agl="
+
ortho_maps
[
indx
].
getAGL
());
System
.
out
.
println
(
"Scene="
+
indx
+
", agl="
+
ortho_maps
[
indx
].
getAGL
());
double
[]
qorient
=
ortho_maps
[
indx
].
getQOrinet
();
// QuatUtils.invert(ortho_maps[indx].getQOrinet());
double
[]
qorient
=
ortho_maps
[
indx
].
getQOrinet
();
// QuatUtils.invert(ortho_maps[indx].getQOrinet());
if
(
qorient
==
null
)
{
qorient
=
new
double
[]
{
1
,
0
,
0
,
0
};
}
final
int
src_width
=
ortho_maps
[
indx
].
getImageData
().
width
;
// assuming same image size for alt and texture
final
int
src_width
=
ortho_maps
[
indx
].
getImageData
().
width
;
// assuming same image size for alt and texture
final
int
src_height
=
ortho_maps
[
indx
].
getImageData
().
height
;
// assuming same image size for alt and texture
final
int
src_height
=
ortho_maps
[
indx
].
getImageData
().
height
;
// assuming same image size for alt and texture
final
double
[]
image_data
=
ortho_maps
[
indx
].
getImageData
().
getDData
();
final
double
[]
image_data
=
ortho_maps
[
indx
].
getImageData
().
getDData
();
...
...
src/main/java/com/elphel/imagej/orthomosaic/PairwiseOrthoMatch.java
View file @
e64fe051
...
@@ -49,11 +49,15 @@ public class PairwiseOrthoMatch implements Serializable {
...
@@ -49,11 +49,15 @@ public class PairwiseOrthoMatch implements Serializable {
private
void
writeObject
(
ObjectOutputStream
oos
)
throws
IOException
{
private
void
writeObject
(
ObjectOutputStream
oos
)
throws
IOException
{
oos
.
defaultWriteObject
();
oos
.
defaultWriteObject
();
if
(
jtj
==
null
)
{
oos
.
writeObject
(
Double
.
NaN
);
}
else
{
for
(
int
i
=
0
;
i
<
jtj
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
jtj
.
length
;
i
++)
{
for
(
int
j
=
i
;
j
<
jtj
[
i
].
length
;
j
++)
{
for
(
int
j
=
i
;
j
<
jtj
[
i
].
length
;
j
++)
{
oos
.
writeObject
(
jtj
[
i
][
j
]);
oos
.
writeObject
(
jtj
[
i
][
j
]);
}
}
}
}
}
// oos.writeObject(overlap);
// oos.writeObject(overlap);
// oos.writeObject(equalize1to0);
// oos.writeObject(equalize1to0);
// oos.writeObject(alt_data);
// oos.writeObject(alt_data);
...
@@ -64,9 +68,14 @@ public class PairwiseOrthoMatch implements Serializable {
...
@@ -64,9 +68,14 @@ public class PairwiseOrthoMatch implements Serializable {
private
void
readObject
(
ObjectInputStream
ois
)
throws
ClassNotFoundException
,
IOException
{
private
void
readObject
(
ObjectInputStream
ois
)
throws
ClassNotFoundException
,
IOException
{
ois
.
defaultReadObject
();
ois
.
defaultReadObject
();
jtj
=
new
double
[
6
][
6
];
// readObject does not use constructor!
jtj
=
new
double
[
6
][
6
];
// readObject does not use constructor!
readjtj:
for
(
int
i
=
0
;
i
<
jtj
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
jtj
.
length
;
i
++)
{
for
(
int
j
=
i
;
j
<
jtj
[
i
].
length
;
j
++)
{
for
(
int
j
=
i
;
j
<
jtj
[
i
].
length
;
j
++)
{
jtj
[
i
][
j
]
=
(
Double
)
ois
.
readObject
();
jtj
[
i
][
j
]
=
(
Double
)
ois
.
readObject
();
if
(
Double
.
isNaN
(
jtj
[
0
][
0
])
&&
(
i
==
0
)
&&
(
j
==
0
))
{
jtj
=
null
;
break
readjtj
;
}
if
(
j
>
i
)
{
if
(
j
>
i
)
{
jtj
[
j
][
i
]
=
jtj
[
i
][
j
];
jtj
[
j
][
i
]
=
jtj
[
i
][
j
];
}
}
...
@@ -79,8 +88,8 @@ public class PairwiseOrthoMatch implements Serializable {
...
@@ -79,8 +88,8 @@ public class PairwiseOrthoMatch implements Serializable {
// alt_data = (double[]) ois.readObject();
// alt_data = (double[]) ois.readObject();
// }
// }
// if (OrthoMapsCollection.CURRENT_VERSION >= OrthoMapsCollection.VERSION_POST_ORIENT) {
// if (OrthoMapsCollection.CURRENT_VERSION >= OrthoMapsCollection.VERSION_POST_ORIENT) {
quat
=
(
double
[])
ois
.
readObject
();
//
quat= (double[]) ois.readObject();
qaffine
=
(
double
[][])
ois
.
readObject
();
//
qaffine = (double[][]) ois.readObject();
// }
// }
}
}
...
...
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