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
a47aabbe
Commit
a47aabbe
authored
Dec 07, 2023
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Linear output for GRAY32 GEO output, UM for ARGB (slow fillNaNs)
parent
24d7049d
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
238 additions
and
87 deletions
+238
-87
CLTParameters.java
src/main/java/com/elphel/imagej/cameras/CLTParameters.java
+47
-3
ElphelTiffWriter.java
...main/java/com/elphel/imagej/readers/ElphelTiffWriter.java
+7
-7
QuadCLTCPU.java
...main/java/com/elphel/imagej/tileprocessor/QuadCLTCPU.java
+47
-1
TexturedModel.java
...n/java/com/elphel/imagej/tileprocessor/TexturedModel.java
+137
-76
No files found.
src/main/java/com/elphel/imagej/cameras/CLTParameters.java
View file @
a47aabbe
...
...
@@ -489,7 +489,14 @@ public class CLTParameters {
public
boolean
gmap_save_alt
=
true
;
// save height map (meters ASL)
public
boolean
gmap_save_tiff32
=
true
;
// save float TIFF (NaN for transparency) with geo metadata (top left corner)
public
boolean
gmap_save_tiff
=
true
;
// save transparent TIFF with geo metadata (top left corner)
public
int
gmap_tiff_pal
=
0
;
// LWIR palette for TIFF
public
int
gmap_tiff_pal
=
0
;
// LWIR palette for ARGB TIFF
public
boolean
gmap_um
=
true
;
// Use unsharp mask filter for ARGB TIFF maps
public
double
gmap_um_sigma
=
0.4
;
// Unsharp mask sigma for ARGB TIFF maps (in meters)
public
double
gmap_um_weight
=
0.8
;
// Unsharp mask weight for ARGB TIFF maps
public
boolean
gmap_lwir_autorange
=
true
;
// Autorange LWIR textures for ARGB TIFF maps
public
boolean
gmap_um_fixed
=
false
;
// Use fixed range after unsharp mask instead of autorange for ARGB TIFF maps
public
double
gmap_um_range
=
500
;
// Full range after unsharp mask for ARGB TIFF maps
public
boolean
generate_bg
=
true
;
// Generate background image for 3dmodels
public
boolean
show_textures
=
true
;
// show generated textures
...
...
@@ -1640,6 +1647,13 @@ public class CLTParameters {
properties
.
setProperty
(
prefix
+
"gmap_save_tiff"
,
this
.
gmap_save_tiff
+
""
);
// boolean
properties
.
setProperty
(
prefix
+
"gmap_tiff_pal"
,
this
.
gmap_tiff_pal
+
""
);
// int
properties
.
setProperty
(
prefix
+
"gmap_um"
,
this
.
gmap_um
+
""
);
// boolean
properties
.
setProperty
(
prefix
+
"gmap_um_sigma"
,
this
.
gmap_um_sigma
+
""
);
// double
properties
.
setProperty
(
prefix
+
"gmap_um_weight"
,
this
.
gmap_um_weight
+
""
);
// double
properties
.
setProperty
(
prefix
+
"gmap_lwir_autorange"
,
this
.
gmap_lwir_autorange
+
""
);
// boolean
properties
.
setProperty
(
prefix
+
"gmap_um_fixed"
,
this
.
gmap_um_fixed
+
""
);
// boolean
properties
.
setProperty
(
prefix
+
"gmap_um_range"
,
this
.
gmap_um_range
+
""
);
// double
properties
.
setProperty
(
prefix
+
"generate_bg"
,
this
.
generate_bg
+
""
);
properties
.
setProperty
(
prefix
+
"show_textures"
,
this
.
show_textures
+
""
);
properties
.
setProperty
(
prefix
+
"debug_filters"
,
this
.
debug_filters
+
""
);
...
...
@@ -2664,6 +2678,13 @@ public class CLTParameters {
if
(
properties
.
getProperty
(
prefix
+
"gmap_save_tiff"
)!=
null
)
this
.
gmap_save_tiff
=
Boolean
.
parseBoolean
(
properties
.
getProperty
(
prefix
+
"gmap_save_tiff"
));
if
(
properties
.
getProperty
(
prefix
+
"gmap_tiff_pal"
)!=
null
)
this
.
gmap_tiff_pal
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"gmap_tiff_pal"
));
// int
if
(
properties
.
getProperty
(
prefix
+
"gmap_um"
)!=
null
)
this
.
gmap_um
=
Boolean
.
parseBoolean
(
properties
.
getProperty
(
prefix
+
"gmap_um"
));
if
(
properties
.
getProperty
(
prefix
+
"gmap_um_sigma"
)!=
null
)
this
.
gmap_um_sigma
=
Double
.
parseDouble
(
properties
.
getProperty
(
prefix
+
"gmap_um_sigma"
));
if
(
properties
.
getProperty
(
prefix
+
"gmap_um_weight"
)!=
null
)
this
.
gmap_um_weight
=
Double
.
parseDouble
(
properties
.
getProperty
(
prefix
+
"gmap_um_weight"
));
if
(
properties
.
getProperty
(
prefix
+
"gmap_lwir_autorange"
)!=
null
)
this
.
gmap_lwir_autorange
=
Boolean
.
parseBoolean
(
properties
.
getProperty
(
prefix
+
"gmap_lwir_autorange"
));
if
(
properties
.
getProperty
(
prefix
+
"gmap_um_fixed"
)!=
null
)
this
.
gmap_um_fixed
=
Boolean
.
parseBoolean
(
properties
.
getProperty
(
prefix
+
"gmap_um_fixed"
));
if
(
properties
.
getProperty
(
prefix
+
"gmap_um_range"
)!=
null
)
this
.
gmap_um_range
=
Double
.
parseDouble
(
properties
.
getProperty
(
prefix
+
"gmap_um_range"
));
if
(
properties
.
getProperty
(
prefix
+
"generate_bg"
)!=
null
)
this
.
generate_bg
=
Boolean
.
parseBoolean
(
properties
.
getProperty
(
prefix
+
"generate_bg"
));
if
(
properties
.
getProperty
(
prefix
+
"show_textures"
)!=
null
)
this
.
show_textures
=
Boolean
.
parseBoolean
(
properties
.
getProperty
(
prefix
+
"show_textures"
));
if
(
properties
.
getProperty
(
prefix
+
"debug_filters"
)!=
null
)
this
.
debug_filters
=
Boolean
.
parseBoolean
(
properties
.
getProperty
(
prefix
+
"debug_filters"
));
...
...
@@ -3939,9 +3960,25 @@ public class CLTParameters {
"Save float (32-bit) TIFF with geo and resolution metadata (coordinates correspond to the top left image corner), NAN for transparency."
);
gd
.
addCheckbox
(
"Save ARGB Tiff with transparency and Geo"
,
this
.
gmap_save_tiff
,
// true; // enable change FG pixel to opaque from transparent
"Save transparent TIFF with geo and resolution metadata (coordinates correspond to the top left image corner)."
);
gd
.
addNumericField
(
"
Crop maps extra"
,
this
.
gmap_tiff_pal
,
0
,
3
,
""
,
// minimal neighbors to keep alpha
gd
.
addNumericField
(
"
LWIR palette for Geo"
,
this
.
gmap_tiff_pal
,
0
,
3
,
""
,
// minimal neighbors to keep alpha
"LWIR palette for Geo/transparency TIFF output."
);
gd
.
addMessage
(
"Unsharp mask parameters for ARGB render of the ground maps"
);
gd
.
addCheckbox
(
"Apply unsharp mask to ARGB render"
,
this
.
gmap_um
,
"Use unsharp mask filter for texture."
);
gd
.
addNumericField
(
"Unsharp mask sigma"
,
this
.
gmap_um_sigma
,
5
,
7
,
"m"
,
"Unsharp mask sigma for ARGB ground map render in meters."
);
gd
.
addNumericField
(
"Unsharp mask weight"
,
this
.
gmap_um_weight
,
5
,
7
,
""
,
"Unsharp mask weight for ARGB ground map render."
);
gd
.
addCheckbox
(
"Autorange LWIR textures"
,
this
.
gmap_lwir_autorange
,
"Autorange LWIR ARGB ground map render (after unsharp mask)."
);
gd
.
addCheckbox
(
"Fixed range (after unsharp only)"
,
this
.
gmap_um_fixed
,
"Use fixed range after unsharp mask for ARGB ground map instead of autorange."
);
gd
.
addNumericField
(
"Full range for ARGB ground map render"
,
this
.
gmap_um_range
,
5
,
7
,
"counts"
,
"Full range after unsharp mask when fixed range is selected."
);
gd
.
addMessage
(
"Earlier 3D generation parameters"
);
gd
.
addCheckbox
(
"Generate background (infinity) image for 3D (not needed for view down)"
,
this
.
generate_bg
);
gd
.
addCheckbox
(
"Show generated textures"
,
this
.
show_textures
);
...
...
@@ -5163,6 +5200,13 @@ public class CLTParameters {
this
.
gmap_save_tiff
=
gd
.
getNextBoolean
();
this
.
gmap_tiff_pal
=
(
int
)
gd
.
getNextNumber
();
this
.
gmap_um
=
gd
.
getNextBoolean
();
this
.
gmap_um_sigma
=
gd
.
getNextNumber
();
this
.
gmap_um_weight
=
gd
.
getNextNumber
();
this
.
gmap_lwir_autorange
=
gd
.
getNextBoolean
();
this
.
gmap_um_fixed
=
gd
.
getNextBoolean
();
this
.
gmap_um_range
=
gd
.
getNextNumber
();
this
.
generate_bg
=
gd
.
getNextBoolean
();
this
.
show_textures
=
gd
.
getNextBoolean
();
this
.
debug_filters
=
gd
.
getNextBoolean
();
...
...
src/main/java/com/elphel/imagej/readers/ElphelTiffWriter.java
View file @
a47aabbe
...
...
@@ -194,13 +194,13 @@ public class ElphelTiffWriter {
int
bands
=
1
;
// 4 bands for ARGB, 3 for RGB etc
int
[]
bandOffsets
=
{
0
};
// length == bands, 0 == R, 1 == G, 2 == B and 3 == A
// Create a TYPE_FLOAT sample model (specifying how the pixels are stored)
SampleModel
sampleModel0
=
new
PixelInterleavedSampleModel
(
DataBuffer
.
TYPE_FLOAT
,
width
,
height
,
bands
,
width
*
bands
,
bandOffsets
);
//
SampleModel sampleModel0 = new PixelInterleavedSampleModel(
//
DataBuffer.TYPE_FLOAT,
//
width,
//
height,
//
bands,
//
width * bands,
//
bandOffsets);
// Create a color model compatible with this sample model/raster (TYPE_FLOAT)
// Note that the number of bands must equal the number of color components in the
...
...
src/main/java/com/elphel/imagej/tileprocessor/QuadCLTCPU.java
View file @
a47aabbe
...
...
@@ -8668,7 +8668,7 @@ public class QuadCLTCPU {
double
[][][]
textures
// [nslices][nchn][i]
)
{
if
((
textures
==
null
)
||
(
textures
.
length
==
0
))
{
throw
new
IllegalArgumentException
(
"
um
Textures(): Empty textures"
);
throw
new
IllegalArgumentException
(
"
getMinMax
Textures(): Empty textures"
);
}
final
boolean
is_mono
=
textures
[
0
].
length
<=
2
;
final
int
alpha_chn
=
is_mono
?
1
:
3
;
...
...
@@ -16456,6 +16456,52 @@ public class QuadCLTCPU {
return
true
;
}
// Currently only a single-slice 32-bit file (with NaN for tranparency)
public
boolean
writeLwirGeoTiff32
(
final
CLTParameters
clt_parameters
,
double
[]
data
,
double
[]
lla
,
// latitude, longitude, altitude (or null)
LocalDateTime
dt
,
// local date/time or null
double
pix_in_meters
,
int
width
,
QuadCLT
scene
,
String
suffix
,
// include "-geo"
int
debugLevel
)
{
if
(
scene
==
null
)
{
scene
=
(
QuadCLT
)
this
;
}
int
height
=
data
.
length
/
width
;
String
set_name
=
getImageName
();
if
(
set_name
==
null
)
{
QuadCLTCPU
.
SetChannels
[]
set_channels
=
setChannels
(
debugLevel
);
set_name
=
set_channels
[
0
].
set_name
;
}
String
model_dir
=
correctionsParameters
.
selectX3dDirectory
(
set_name
,
// quad timestamp. Will be ignored if correctionsParameters.use_x3d_subdirs is false
null
,
true
,
// smart,
true
);
//newAllowed, // save\
String
title
=
getImageName
()+
suffix
;
ImagePlus
imp
=
ShowDoubleFloatArrays
.
makeArrays
(
data
,
// double[] pixels,
width
,
// int width,
height
,
// int height,
title
);
// String title);
String
image_path
=
model_dir
+
Prefs
.
getFileSeparator
()
+
title
+
".tiff"
;
ElphelTiffWriter
.
saveTiffARGBOrGray32
(
imp
,
image_path
,
lla
,
// double [] lla, // latitude, longitude, altitude (or null)
dt
,
// LocalDateTime dt, // local date/time or null
pix_in_meters
,
//double pix_in_meters, // resolution or Double.NaN
false
,
// imageJTags,
debugLevel
);
return
true
;
}
/** broke
public boolean writeRatingFile( // USED in lwir
...
...
src/main/java/com/elphel/imagej/tileprocessor/TexturedModel.java
View file @
a47aabbe
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