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
624f1144
Commit
624f1144
authored
Feb 16, 2024
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Orthographic videos generation
parent
8a9605a5
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
346 additions
and
67 deletions
+346
-67
Eyesis_Correction.java
.../java/com/elphel/imagej/correction/Eyesis_Correction.java
+9
-32
ComboMap.java
src/main/java/com/elphel/imagej/orthomosaic/ComboMap.java
+325
-1
ComboMatch.java
src/main/java/com/elphel/imagej/orthomosaic/ComboMatch.java
+7
-29
OpticalFlow.java
...ain/java/com/elphel/imagej/tileprocessor/OpticalFlow.java
+5
-5
No files found.
src/main/java/com/elphel/imagej/correction/Eyesis_Correction.java
View file @
624f1144
...
...
@@ -109,6 +109,7 @@ import com.elphel.imagej.ims.EventLogger;
import
com.elphel.imagej.ims.Imx5
;
import
com.elphel.imagej.jp4.JP46_Reader_camera
;
import
com.elphel.imagej.lwir.LwirReader
;
import
com.elphel.imagej.orthomosaic.ComboMap
;
import
com.elphel.imagej.orthomosaic.ComboMatch
;
import
com.elphel.imagej.readers.ChangeImageResolution
;
import
com.elphel.imagej.readers.DumpImageMetadata
;
...
...
@@ -847,6 +848,7 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
addButton
(
"Warp pair"
,
panelLWIRWorld
,
color_process
);
addButton
(
"Read Tiff"
,
panelLWIRWorld
,
color_process
);
addButton
(
"Set pair GPS"
,
panelLWIRWorld
,
color_process
);
addButton
(
"Test video"
,
panelLWIRWorld
,
color_process
);
plugInFrame
.
add
(
panelLWIRWorld
);
}
...
...
@@ -5705,21 +5707,6 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
}
else
if
(
label
.
equals
(
"Set pair GPS"
))
{
DEBUG_LEVEL
=
MASTER_DEBUG_LEVEL
;
EYESIS_CORRECTIONS
.
setDebug
(
DEBUG_LEVEL
);
/*
boolean run_pre = true; // false;
if (run_pre) {
String path = loadProperties(null, CORRECTION_PARAMETERS.resultsDirectory, true, PROPERTIES);
if (path != null) {
getAllProperties(PROPERTIES);
if (DEBUG_LEVEL > -3)
System.out.println("Configuration parameters are restored from " + path);
} else {
if (DEBUG_LEVEL > -10)
System.out.println("Failed to restore configuration parameters");
return;
}
}
*/
if
(
GPU_TILE_PROCESSOR
==
null
)
{
try
{
GPU_TILE_PROCESSOR
=
new
GPUTileProcessor
(
CORRECTION_PARAMETERS
.
tile_processor_gpu
);
...
...
@@ -5730,23 +5717,6 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
return
;
}
// final int debugLevel);
}
/*
if (!run_pre) {
String path = loadProperties(null, CORRECTION_PARAMETERS.resultsDirectory, true, PROPERTIES);
if (path != null) {
getAllProperties(PROPERTIES);
if (DEBUG_LEVEL > -3)
System.out.println("Configuration parameters are restored from " + path);
} else {
if (DEBUG_LEVEL > -10)
System.out.println("Failed to restore configuration parameters");
return;
}
}
*/
//////////////////////
// Temporarily initialize on scene GPU
boolean
init_scene
=
false
;
// true;
if
(
init_scene
)
{
...
...
@@ -5756,6 +5726,13 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
CLT_PARAMETERS
,
// CLTParameters clt_parameters,
GPU_TILE_PROCESSOR
,
DEBUG_LEVEL
);
}
else
if
(
label
.
equals
(
"Test video"
))
{
ImagePlus
imp_sel
=
WindowManager
.
getCurrentImage
();
if
(
imp_sel
==
null
)
{
IJ
.
showMessage
(
"Error"
,
"No images selected"
);
return
;
}
ComboMap
.
testVideo
(
imp_sel
);
}
}
...
...
src/main/java/com/elphel/imagej/orthomosaic/ComboMap.java
View file @
624f1144
This diff is collapsed.
Click to expand it.
src/main/java/com/elphel/imagej/orthomosaic/ComboMatch.java
View file @
624f1144
...
...
@@ -43,29 +43,9 @@ public class ComboMatch {
GPUTileProcessor
gpu_tile_processor
,
// initialized by the caller
final
int
debugLevel
)
{
GPU_TILE_PROCESSOR
=
gpu_tile_processor
;
String
[]
image_paths_pre_0
=
{
// "/media/elphel/SSD3-4GB/lwir16-proc/berdich3/linked/linked_1697875868-1697879449-b/1697877410_420287/1697877410_420287-RECT-PIX0.01-FLAT_CLN-VERT-GEO",
// "/media/elphel/SSD3-4GB/lwir16-proc/berdich3/linked/linked_1697875868-1697879449-b/1697877412_004148/1697877412_004148-RECT-PIX0.01-FLAT_CLN-VERT-GEO",
"/media/elphel/SSD3-4GB/lwir16-proc/berdich3/linked/linked_1697875868-1697879449-c/1697877409_353265/1697877409_353265-RECT-PIX0.01-FLAT_CLN-VERT-GEO"
,
"/media/elphel/SSD3-4GB/lwir16-proc/berdich3/linked/linked_1697875868-1697879449-c/1697877410_403615/1697877410_403615-RECT-PIX0.01-FLAT_CLN-VERT-GEO"
,
"/media/elphel/SSD3-4GB/lwir16-proc/berdich3/linked/linked_1697875868-1697879449-c/1697877411_987476/1697877411_987476-RECT-PIX0.01-FLAT_CLN-VERT-GEO"
,
"/media/elphel/SSD3-4GB/lwir16-proc/berdich3/linked/linked_1697875868-1697879449-c/1697877413_137859/1697877413_137859-RECT-PIX0.01-FLAT_CLN-VERT-GEO"
,
"/media/elphel/SSD3-4GB/lwir16-proc/berdich3/linked/linked_1697875868-1697879449-c/1697877414_404948/1697877414_404948-RECT-PIX0.01-FLAT_CLN-VERT-GEO"
,
"/media/elphel/SSD3-4GB/lwir16-proc/berdich3/linked/linked_1697875868-1697879449-c/1697877415_521986/1697877415_521986-RECT-PIX0.01-FLAT_CLN-VERT-GEO"
};
String
[]
image_paths_pre
=
{
"/media/elphel/SSD3-4GB/lwir16-proc/berdich3/linked/linked_1697875868-1697879449-c/1697877409_353265/1697877409_353265-RECT-PIX0.01-FLAT_CLN-VERT-GCORR-GEO"
,
"/media/elphel/SSD3-4GB/lwir16-proc/berdich3/linked/linked_1697875868-1697879449-c/1697877410_403615/1697877410_403615-RECT-PIX0.01-FLAT_CLN-VERT-GCORR-GEO"
,
"/media/elphel/SSD3-4GB/lwir16-proc/berdich3/linked/linked_1697875868-1697879449-c/1697877411_987476/1697877411_987476-RECT-PIX0.01-FLAT_CLN-VERT-GCORR-GEO"
,
"/media/elphel/SSD3-4GB/lwir16-proc/berdich3/linked/linked_1697875868-1697879449-c/1697877413_137859/1697877413_137859-RECT-PIX0.01-FLAT_CLN-VERT-GCORR-GEO"
,
"/media/elphel/SSD3-4GB/lwir16-proc/berdich3/linked/linked_1697875868-1697879449-c/1697877414_404948/1697877414_404948-RECT-PIX0.01-FLAT_CLN-VERT-GCORR-GEO"
,
"/media/elphel/SSD3-4GB/lwir16-proc/berdich3/linked/linked_1697875868-1697879449-c/1697877415_521986/1697877415_521986-RECT-PIX0.01-FLAT_CLN-VERT-GCORR-GEO"
};
// find -L /media/elphel/SSD3-4GB/lwir16-proc/berdich3/linked/linked_1697875868-1697879449-b/ -type f -name "*-GCORR-GEO.tiff" | sort > GCORR-GEO.list
String
files_list_path
=
"/media/elphel/SSD3-4GB/lwir16-proc/
berdich3/linked/linked_1697875868-1697879449-b/maps_01
.list"
;
String
files_list_path
=
"/media/elphel/SSD3-4GB/lwir16-proc/
ortho_videos/maps_berdich2
.list"
;
double
[][][]
image_enuatr
=
{{{
0
,
0
,
0
},{
0
,
0
,
0
}},{{
0
,
0
,
0
},{
0
,
0
,
0
}}};
int
gpu_width
=
clt_parameters
.
imp
.
rln_gpu_width
;
// 3008;
...
...
@@ -122,10 +102,6 @@ public class ComboMatch {
show_centers
=
gd
.
getNextBoolean
();
use_alt
=
gd
.
getNextBoolean
();
String
[]
full_paths
=
new
String
[
image_paths_pre
.
length
];
for
(
int
n
=
0
;
n
<
full_paths
.
length
;
n
++)
{
full_paths
[
n
]
=
image_paths_pre
[
n
]+
".tiff"
;
}
// ComboMap[] combo_maps = ComboMap.initializeComboMaps(
// full_paths); // String [] image_paths);
ComboMap
[]
combo_maps
=
ComboMap
.
initializeComboMaps
(
...
...
@@ -170,14 +146,14 @@ public class ComboMatch {
true
,
"gpu_pair-zoom"
+
zoom_lev
+
"-"
+
combo_maps
[
gpu_pair
[
0
]].
getName
()+
"-"
+
combo_maps
[
gpu_pair
[
1
]].
getName
(),
map_names
);
if
(
image_paths_pre
.
length
>
2
)
{
if
(
debugLevel
<
1000
)
{
return
true
;
}
/* */
int
[]
widths
=
new
int
[
imp_src
.
length
];
int
[]
heights
=
new
int
[
imp_src
.
length
];
for
(
int
n
=
0
;
n
<
imp_src
.
length
;
n
++)
{
imp_src
[
n
]
=
new
ImagePlus
(
image_paths_pre
[
n
]+
".tiff"
);
// may use +"-ALT.tiff"
//
imp_src[n] = new ImagePlus(image_paths_pre[n]+".tiff"); // may use +"-ALT.tiff"
widths
[
n
]
=
imp_src
[
n
].
getWidth
();
heights
[
n
]
=
imp_src
[
n
].
getHeight
();
}
...
...
@@ -187,12 +163,14 @@ public class ComboMatch {
double
[][]
xy_pix_centers
=
new
double
[
2
][];
double
[]
pix_sizes
=
new
double
[
2
];
// ElphelTiffReader.getPixelSize(imp_prop[0])[0];
for
(
int
n
=
0
;
n
<
imp_src
.
length
;
n
++)
{
/*
try {
imp_prop
[
n
]
=
ElphelTiffReader
.
getTiffMeta
(
image_paths_pre
[
n
]+
".tiff"
);
//
imp_prop[n] = ElphelTiffReader.getTiffMeta(image_paths_pre[n]+".tiff");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
*/
llas
[
n
]
=
ElphelTiffReader
.
getLLA
(
imp_prop
[
n
]);
dts
[
n
]
=
ElphelTiffReader
.
getLocalDateTime
(
imp_prop
[
n
]);
xy_pix_centers
[
n
]
=
ElphelTiffReader
.
getXYOffsetPixels
(
imp_prop
[
n
]);
...
...
src/main/java/com/elphel/imagej/tileprocessor/OpticalFlow.java
View file @
624f1144
...
...
@@ -5907,7 +5907,7 @@ public class OpticalFlow {
imp_scenes_pair
[
nstereo
].
getProcessor
().
setMinAndMax
(-
mono_range
/
2
,
mono_range
/
2
);
}
ImageConverter
imageConverter
=
new
ImageConverter
(
imp_scenes_pair
[
nstereo
]);
imageConverter
.
convertToRGB
();
// Did it convert imp_scenes ?
imageConverter
.
convertToRGB
();
// Did it convert imp_scenes ?
YES
}
final
Color
fcolor
=
toRGB
?
annotate_color_color:
annotate_color_mono
;
...
...
@@ -6079,13 +6079,13 @@ public class OpticalFlow {
//https://ffmpeg.org/ffmpeg-formats.html
//ffmpeg -i sample_left_right_clip.mpg -an -c:v libvpx -metadata stereo_mode=left_right -y stereo_clip.webm
//anaglyph_cyan_red
String
streo_meta
=
""
;
String
st
e
reo_meta
=
""
;
if
((
webm_path
.
contains
(
"-STEREO-"
))
||
(
webm_path
.
contains
(
"-SBS-"
)))
{
if
(
stereo_gap
==
0
)
{
if
(
debugLevel
>
-
3
)
{
System
.
out
.
println
(
"Adding 3D meta: stereo_mode=left_right"
);
}
streo_meta
=
" -metadata:s:v:0 stereo_mode=left_right "
;
st
e
reo_meta
=
" -metadata:s:v:0 stereo_mode=left_right "
;
}
else
{
if
(
debugLevel
>
-
3
)
{
System
.
out
.
println
(
"stereo_gap !=0, skipping 3D meta as firefox/vlc halves display width"
);
...
...
@@ -6095,11 +6095,11 @@ public class OpticalFlow {
if
(
debugLevel
>
-
3
)
{
System
.
out
.
println
(
"Adding 3D meta: stereo_mode=anaglyph_cyan_red"
);
}
streo_meta
=
" -metadata:s:v:0 stereo_mode=anaglyph_cyan_red "
;
st
e
reo_meta
=
" -metadata:s:v:0 stereo_mode=anaglyph_cyan_red "
;
}
String
shellCommand
=
String
.
format
(
"ffmpeg -y -i %s -c %s -b:v 0 -crf %d %s %s"
,
avi_path
,
video_codec
,
video_crf
,
streo_meta
,
webm_path
);
avi_path
,
video_codec
,
video_crf
,
st
e
reo_meta
,
webm_path
);
Process
p
=
null
;
if
(
generate_mapped
)
{
int
exit_code
=
-
1
;
...
...
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