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
758adc65
Commit
758adc65
authored
Mar 28, 2024
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Working with single-image higher AGL (75 and 100)
parent
5e4e5577
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
866 additions
and
276 deletions
+866
-276
GenericJTabbedDialog.java
...n/java/com/elphel/imagej/common/GenericJTabbedDialog.java
+25
-0
ComboMatch.java
src/main/java/com/elphel/imagej/orthomosaic/ComboMatch.java
+145
-109
OrthoMap.java
src/main/java/com/elphel/imagej/orthomosaic/OrthoMap.java
+233
-1
OrthoMapsCollection.java
...va/com/elphel/imagej/orthomosaic/OrthoMapsCollection.java
+463
-166
No files found.
src/main/java/com/elphel/imagej/common/GenericJTabbedDialog.java
View file @
758adc65
...
...
@@ -216,6 +216,31 @@ public class GenericJTabbedDialog implements ActionListener {
inp_units
.
putClientProperty
(
"type"
,
"combo"
);
// combo.setPreferredSize(new Dimension(200));
// combo.setSize(200, combo.getPreferredSize().height);
// combo.setMaximumSize(20); // combo.getPreferredSize() );
inp_units
.
setLayout
(
new
FlowLayout
(
FlowLayout
.
LEFT
));
addLine
(
label
,
inp_units
,
tooltip
);
}
public
void
addChoice
(
String
label
,
String
[]
items
,
String
defaultItem
,
String
tooltip
,
int
count
)
{
int
index
=
0
;
if
(
defaultItem
!=
null
)
{
for
(
int
i
=
0
;
i
<
items
.
length
;
i
++)
if
(
items
[
i
].
equals
(
defaultItem
))
{
index
=
i
;
break
;
}
}
JComboBox
<
String
>
combo
=
new
JComboBox
<
String
>(
items
);
combo
.
setSelectedIndex
(
index
);
JPanel
inp_units
=
new
JPanel
(
false
);
inp_units
.
add
(
combo
);
inp_units
.
putClientProperty
(
"type"
,
"combo"
);
if
(
count
>
0
)
{
combo
.
setMaximumRowCount
(
count
);
}
// combo.setPreferredSize(new Dimension(200));
// combo.setSize(200, combo.getPreferredSize().height);
// combo.setMaximumSize(20); // combo.getPreferredSize() );
inp_units
.
setLayout
(
new
FlowLayout
(
FlowLayout
.
LEFT
));
...
...
src/main/java/com/elphel/imagej/orthomosaic/ComboMatch.java
View file @
758adc65
...
...
@@ -48,6 +48,11 @@ public class ComboMatch {
GPUTileProcessor
gpu_tile_processor
,
// initialized by the caller
boolean
extract_objects
,
int
debugLevel
)
{
boolean
create_kernels
=
debugLevel
>
1000
;
if
(
create_kernels
)
{
OrthoMap
.
combineKernels
();
return
true
;
}
GPU_TILE_PROCESSOR
=
gpu_tile_processor
;
PairwiseOrthoMatch
pairwiseOrthoMatch
=
null
;
String
[]
pair_names
=
new
String
[
2
];
...
...
@@ -797,29 +802,46 @@ public class ComboMatch {
String
[]
choices
=
getPairChoices
(
available_pairs
,
// int [][] pairs,
names
);
// String [] names)
String
[]
choices_all
=
new
String
[
choices
.
length
+
1
];
System
.
arraycopy
(
choices
,
0
,
choices_all
,
0
,
choices
.
length
);
choices_all
[
choices_all
.
length
-
1
]
=
"--- select a single image ---"
;
GenericJTabbedDialog
gdc
=
new
GenericJTabbedDialog
(
"Select image pair"
,
1200
,
400
);
gdc
.
addChoice
(
"Operation:"
,
choices
,
choices
[
choices
.
length
-
1
]);
int
num_choice_lines
=
50
;
gdc
.
addChoice
(
"Image pair:"
,
choices_all
,
choices_all
[
choices
.
length
],
// -1],
"Select processed image pair or request a single image selection"
,
num_choice_lines
);
gdc
.
showDialog
();
if
(
gdc
.
wasCanceled
())
return
false
;
int
pair
=
gdc
.
getNextChoiceIndex
();
if
(
pair
>=
choices
.
length
)
{
int
default_choice
=
0
;
int
num_scene_lines
=
50
;
String
scene_name
=
maps_collection
.
selectOneScene
(
default_choice
,
// int default_choice,
num_scene_lines
);
// int num_choice_lines)
if
(
scene_name
==
null
)
{
return
false
;
}
gpu_spair
=
new
String
[]
{
scene_name
};
}
else
{
gpu_spair
=
new
String
[]
{
maps_collection
.
ortho_maps
[
available_pairs
[
pair
][
0
]].
getName
(),
maps_collection
.
ortho_maps
[
available_pairs
[
pair
][
1
]].
getName
()};
}
}
int
[]
gpu_pair
=
new
int
[
gpu_spair
.
length
];
int
min_zoom_lev
=
maps_collection
.
ortho_maps
[
gpu_pair
[
0
]].
getOriginalZoomLevel
();
int
max_zoom_lev
=
maps_collection
.
ortho_maps
[
gpu_pair
[
0
]].
getOriginalZoomLevel
();
for
(
int
i
=
0
;
i
<
gpu_pair
.
length
;
i
++)
{
gpu_pair
[
i
]
=
maps_collection
.
getIndex
(
gpu_spair
[
i
]);
min_zoom_lev
=
Math
.
min
(
min_zoom_lev
,
maps_collection
.
ortho_maps
[
gpu_pair
[
i
]].
getOriginalZoomLevel
());
max_zoom_lev
=
Math
.
max
(
max_zoom_lev
,
maps_collection
.
ortho_maps
[
gpu_pair
[
i
]].
getOriginalZoomLevel
());
}
int
min_zoom_lev
=
Math
.
min
(
maps_collection
.
ortho_maps
[
gpu_pair
[
0
]].
getOriginalZoomLevel
(),
maps_collection
.
ortho_maps
[
gpu_pair
[
1
]].
getOriginalZoomLevel
());
int
max_zoom_lev
=
Math
.
max
(
maps_collection
.
ortho_maps
[
gpu_pair
[
0
]].
getOriginalZoomLevel
(),
maps_collection
.
ortho_maps
[
gpu_pair
[
1
]].
getOriginalZoomLevel
());
int
initial_zoom
=
max_zoom_lev
-
4
;
// another algorithm?
System
.
out
.
println
(
"Setting up GPU"
);
if
(
GPU_QUAD_AFFINE
==
null
)
{
try
{
...
...
@@ -836,13 +858,23 @@ public class ComboMatch {
return
false
;
}
// final int debugLevel);
}
double
[][]
affine0
=
{{
1
,
0
,
0
},{
0
,
1
,
0
}};
// will always stay the same
double
[][]
affine1
=
null
;
if
(
gpu_spair
.
length
<
2
)
{
System
.
out
.
println
(
"Selected a single image"
);
double
[][][]
affines
=
{
affine0
};
// or use affine1 = null as second?
if
(
pattern_match
)
{
ImagePlus
imp_pat_match
=
maps_collection
.
patternMatchDualWrap
(
gpu_pair
,
// int [] indices, // null or which indices to use (normally just 2 for pairwise comparison)
affines
,
// double [][][] affines, // null or [indices.length][2][3]
null
);
// warp); // FineXYCorr warp)
// imp_pat_match.show();
}
double
[][]
affine0
=
{{
1
,
0
,
0
},{
0
,
1
,
0
}};
// will always stay the same
}
else
{
pairwiseOrthoMatch
=
maps_collection
.
ortho_maps
[
gpu_pair
[
0
]].
getMatch
(
maps_collection
.
ortho_maps
[
gpu_pair
[
1
]].
getName
());
double
[][]
affine1
=
null
;
if
(
pairwiseOrthoMatch
==
null
)
{
System
.
out
.
println
(
"No correlation data is available for pairs "
+
gpu_spair
[
0
]+
" - "
+
gpu_spair
[
1
]+
" need to implement/search reverse, a spiral search or restart command"
);
...
...
@@ -853,7 +885,7 @@ public class ComboMatch {
double
[][][]
affines
=
{
affine0
,
affine1
};
int
[]
zooms
=
{
initial_zoom
,
min_zoom_lev
,
1000
,
1000
};
// make automatic
double
scale
=
2.0
;
// scale vectors when warping;
// int num_tries = 5; // make configurable
// int num_tries = 5; // make configurable
if
(!
process_correlation
)
{
zooms
=
new
int
[]
{
min_zoom_lev
,
1000
};
num_tries_fit
=
0
;
...
...
@@ -908,18 +940,21 @@ public class ComboMatch {
System
.
out
.
println
();
}
}
if
(
pattern_match
)
{
ImagePlus
imp_pat_match
=
maps_collection
.
patternMatchDualWrap
(
gpu_pair
,
// int [] indices, // null or which indices to use (normally just 2 for pairwise comparison)
affines
,
// double [][][] affines, // null or [indices.length][2][3]
warp
);
// FineXYCorr warp)
// imp_pat_match.show();
// imp_pat_match.show();
}
if
(
render_match
)
{
ImagePlus
imp_img_pair
=
maps_collection
.
renderMulti
(
//_zoom<integer> is needed for opening with "Extract Objects" command
"multi_"
+
gpu_spair
[
0
]+
"-"
+
gpu_spair
[
1
]+
"_zoom"
+
min_zoom_lev
+
"_"
+
zoom_lev
,
// String title,
// false, // boolean use_alt,
// false, // boolean use_alt,
OrthoMapsCollection
.
MODE_IMAGE
,
// int mode, // 0 - regular image, 1 - altitudes, 2 - black/white mask // boolean use_alt,
gpu_pair
,
// int [] indices, // null or which indices to use (normally just 2 for pairwise comparison)
bounds_to_indices
,
// boolean bounds_to_indices,
...
...
@@ -934,6 +969,7 @@ public class ComboMatch {
}
}
}
}
if
(
save_collection
)
{
try
{
maps_collection
.
writeOrthoMapsCollection
(
orthoMapsCollection_path
);
...
...
@@ -1132,8 +1168,8 @@ adjusted affines[1] for a pair: 1694564291_293695/1694564778_589341
pairs
,
// int [][] pairs,
scene_names
);
// String [] names)
GenericJTabbedDialog
gds
=
new
GenericJTabbedDialog
(
"Select image pair"
,
1200
,
400
);
gds
.
addChoice
(
"
Operation
:"
,
choices
,
choices
[
choices
.
length
-
1
]);
GenericJTabbedDialog
gds
=
new
GenericJTabbedDialog
(
"Select image pair
from the image
"
,
1200
,
400
);
gds
.
addChoice
(
"
Image pair in the marked image
:"
,
choices
,
choices
[
choices
.
length
-
1
]);
gds
.
showDialog
();
if
(
gds
.
wasCanceled
())
return
null
;
pair
=
gds
.
getNextChoiceIndex
();
...
...
src/main/java/com/elphel/imagej/orthomosaic/OrthoMap.java
View file @
758adc65
This diff is collapsed.
Click to expand it.
src/main/java/com/elphel/imagej/orthomosaic/OrthoMapsCollection.java
View file @
758adc65
This diff is collapsed.
Click to expand it.
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