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
c8e09488
Commit
c8e09488
authored
Apr 11, 2024
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added bicubic interpolation
parent
42058891
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
260 additions
and
7 deletions
+260
-7
CLTParameters.java
src/main/java/com/elphel/imagej/cameras/CLTParameters.java
+6
-0
TexturedModel.java
...n/java/com/elphel/imagej/tileprocessor/TexturedModel.java
+14
-7
Render3D.java
src/main/java/com/elphel/imagej/x3d/export/Render3D.java
+240
-0
No files found.
src/main/java/com/elphel/imagej/cameras/CLTParameters.java
View file @
c8e09488
...
...
@@ -493,6 +493,7 @@ public class CLTParameters {
public
boolean
gmap_render_hdr
=
true
;
// generate textures w/o normalization to generate undistorted
public
boolean
gmap_en
=
true
;
// generate ground map from a drone (enables gmap_render_hdr)
public
boolean
gmap_parallel_proj
=
true
;
// Use parallel projection (map)
public
boolean
gmap_bicubic
=
true
;
// Use bicubic interpolation (false - bilinear)
public
boolean
gmap_update_range
=
false
;
// for parallel only
// extracting ground projection plane
...
...
@@ -1674,6 +1675,7 @@ public class CLTParameters {
properties
.
setProperty
(
prefix
+
"gmap_render_hdr"
,
this
.
gmap_render_hdr
+
""
);
// boolean
properties
.
setProperty
(
prefix
+
"gmap_en"
,
this
.
gmap_en
+
""
);
// boolean
properties
.
setProperty
(
prefix
+
"gmap_parallel_proj"
,
this
.
gmap_parallel_proj
+
""
);
// boolean
properties
.
setProperty
(
prefix
+
"gmap_bicubic"
,
this
.
gmap_bicubic
+
""
);
// boolean
properties
.
setProperty
(
prefix
+
"gmap_update_range"
,
this
.
gmap_update_range
+
""
);
// boolean
properties
.
setProperty
(
prefix
+
"gmap_use_lma"
,
this
.
gmap_use_lma
+
""
);
// boolean
...
...
@@ -2726,6 +2728,7 @@ public class CLTParameters {
if
(
properties
.
getProperty
(
prefix
+
"gmap_render_hdr"
)!=
null
)
this
.
gmap_render_hdr
=
Boolean
.
parseBoolean
(
properties
.
getProperty
(
prefix
+
"gmap_render_hdr"
));
if
(
properties
.
getProperty
(
prefix
+
"gmap_en"
)!=
null
)
this
.
gmap_en
=
Boolean
.
parseBoolean
(
properties
.
getProperty
(
prefix
+
"gmap_en"
));
if
(
properties
.
getProperty
(
prefix
+
"gmap_parallel_proj"
)!=
null
)
this
.
gmap_parallel_proj
=
Boolean
.
parseBoolean
(
properties
.
getProperty
(
prefix
+
"gmap_parallel_proj"
));
if
(
properties
.
getProperty
(
prefix
+
"gmap_bicubic"
)!=
null
)
this
.
gmap_bicubic
=
Boolean
.
parseBoolean
(
properties
.
getProperty
(
prefix
+
"gmap_bicubic"
));
if
(
properties
.
getProperty
(
prefix
+
"gmap_update_range"
)!=
null
)
this
.
gmap_update_range
=
Boolean
.
parseBoolean
(
properties
.
getProperty
(
prefix
+
"gmap_update_range"
));
if
(
properties
.
getProperty
(
prefix
+
"gmap_use_lma"
)!=
null
)
this
.
gmap_use_lma
=
Boolean
.
parseBoolean
(
properties
.
getProperty
(
prefix
+
"gmap_use_lma"
));
if
(
properties
.
getProperty
(
prefix
+
"gmap_discard_low"
)!=
null
)
this
.
gmap_discard_low
=
Double
.
parseDouble
(
properties
.
getProperty
(
prefix
+
"gmap_discard_low"
));
...
...
@@ -4031,6 +4034,8 @@ public class CLTParameters {
"Render fixed-scale projection of the 3D model to a ground plane, such as for the UAS-generated imagery."
);
gd
.
addCheckbox
(
"Parallel (not center) projection (maps)"
,
this
.
gmap_parallel_proj
,
// true; // enable change FG pixel to opaque from transparent
"Parallel-project objects to a plane surface. If unchecked - use center (from the camera) projection."
);
gd
.
addCheckbox
(
"Use bi-cubic texture interpolation"
,
this
.
gmap_bicubic
,
// true; // enable change FG pixel to opaque from transparent
"Use bi-cubic texture interpolation. False - old way, is bilinear."
);
gd
.
addCheckbox
(
"Fit all model (parallel only)"
,
this
.
gmap_update_range
,
// true; // enable change FG pixel to opaque from transparent
"Recalculate (increase) image size to fit all model elements. Unchecked - limit by plane intersection with the camera FOV."
);
...
...
@@ -5307,6 +5312,7 @@ public class CLTParameters {
this
.
gmap_render_hdr
=
gd
.
getNextBoolean
();
this
.
gmap_en
=
gd
.
getNextBoolean
();
this
.
gmap_parallel_proj
=
gd
.
getNextBoolean
();
this
.
gmap_bicubic
=
gd
.
getNextBoolean
();
this
.
gmap_update_range
=
gd
.
getNextBoolean
();
this
.
gmap_use_lma
=
gd
.
getNextBoolean
();
this
.
gmap_discard_low
=
gd
.
getNextNumber
();
...
...
src/main/java/com/elphel/imagej/tileprocessor/TexturedModel.java
View file @
c8e09488
...
...
@@ -2458,9 +2458,9 @@ public class TexturedModel {
{
final
boolean
map_en
=
clt_parameters
.
gmap_en
;
final
boolean
render_hdr
=
clt_parameters
.
gmap_render_hdr
||
map_en
;
// true; //false; // true; // generate textures w/o normalization to generate undistorted
final
boolean
use_parallel_proj
=
clt_parameters
.
gmap_parallel_proj
;
// Use parallel projection (map)
final
boolean
use_parallel_proj
=
clt_parameters
.
gmap_parallel_proj
;
// Use parallel projection (map)\
final
boolean
bicubic
=
clt_parameters
.
gmap_bicubic
;
// Use bicubic interpolation (false - bilinear)
final
boolean
update_range
=
clt_parameters
.
gmap_update_range
;
// for parallel only
final
boolean
use_lma
=
clt_parameters
.
gmap_use_lma
;
// true; // ;
final
double
discard_low
=
clt_parameters
.
gmap_discard_low
;
//0.01; // fraction of all pixels
final
double
discard_high
=
clt_parameters
.
gmap_discard_high
;
//0.5; // fraction of all pixels
...
...
@@ -3178,11 +3178,17 @@ public class TexturedModel {
boolean
last_is_alpha
=
true
;
// last channel in textures slices is alpha
double
[][]
full_render_z
;
if
(
use_parallel_proj
)
{
full_render_z
=
render3D
.
render3dPlaneParallelProj
(
tri_meshes
,
// final ArrayList<TriMesh> tri_meshes,
last_is_alpha
,
// final boolean last_is_alpha,
// scenes[ref_index], //final QuadCLT ref_scene, // all coordinates relative to this scene
debugLevel
);
//int debugLevel)
if
(
bicubic
)
{
full_render_z
=
render3D
.
render3dPlaneParallelProjBiCubic
(
tri_meshes
,
// final ArrayList<TriMesh> tri_meshes,
last_is_alpha
,
// final boolean last_is_alpha,
debugLevel
);
//int debugLevel)
}
else
{
full_render_z
=
render3D
.
render3dPlaneParallelProj
(
tri_meshes
,
// final ArrayList<TriMesh> tri_meshes,
last_is_alpha
,
// final boolean last_is_alpha,
debugLevel
);
//int debugLevel)
}
}
else
{
full_render_z
=
render3D
.
render3dPlaneCenterProj
(
tri_meshes
,
// final ArrayList<TriMesh> tri_meshes,
...
...
@@ -3193,6 +3199,7 @@ public class TexturedModel {
// String model_name = ref_scene.correctionsParameters.getModelName(ref_scene.getImageName());
String
suffix
=
"-RECT"
;
suffix
+=
"-PIX"
+
pix_size
*
hdr_whs
[
2
];
suffix
+=
bicubic
?
"-BC"
:
"-BL"
;
if
(
gsmth_enable
)
{
suffix
+=
mixed_flat
?
"-FLAT_MIX"
:
"-FLAT_CLN"
;
// flattened ground - mixed or clean
}
...
...
src/main/java/com/elphel/imagej/x3d/export/Render3D.java
View file @
c8e09488
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