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
98783836
Commit
98783836
authored
Oct 28, 2023
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
starting other exports
parent
4bdd4cd8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
65 deletions
+68
-65
TexturedModel.java
...n/java/com/elphel/imagej/tileprocessor/TexturedModel.java
+68
-65
No files found.
src/main/java/com/elphel/imagej/tileprocessor/TexturedModel.java
View file @
98783836
...
...
@@ -3024,78 +3024,81 @@ public class TexturedModel {
}
}
Render3D
render3D
=
new
Render3D
(
//x3d_dir, // String x3d_dir,
//ref_scene.correctionsParameters.getModelName(ref_scene.getImageName()), // String model_name,
scenes
[
ref_index
],
// QuadCLT ref_scene, // all coordinates relative to this scene
to_ground_xyzatr
,
// double [][] plane_xyzatr, // projection plane center relative to reference scene
scaled_pixel_size
,
// double pixel_size, // in meters
hdr_x0y0
,
// double [] x0_y0, // usually negative - top-left point of the output render
hdr_whs
[
0
],
// int out_width, // output rendered image width in pixels
hdr_whs
[
1
]);
// int out_height); // output rendered image height in pixels
boolean
last_is_alpha
=
true
;
// last channel in textures slices is alpha
double
[][]
full_render
;
if
(
use_parallel_proj
)
{
full_render
=
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
((
hdr_whs
[
0
]<
0
)
||
(
hdr_whs
[
1
]<
0
))
{
System
.
out
.
println
(
"**** BUG: hdr_whs[0]="
+
hdr_whs
[
0
]+
", hdr_whs[1]="
+
hdr_whs
[
1
]);
}
else
{
full_render
=
render3D
.
render3dPlaneCenterProj
(
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)
}
// String model_name = ref_scene.correctionsParameters.getModelName(ref_scene.getImageName());
String
suffix
=
"-RECT"
;
if
(
clt_parameters
.
tex_um
)
{
suffix
+=
"-UM"
+(
clt_parameters
.
tex_um_sigma
)+
"_"
+(
clt_parameters
.
tex_um_weight
);
}
suffix
+=
"-PIX"
+
pix_size
*
hdr_whs
[
2
];
scenes
[
ref_index
].
saveDoubleArrayInModelDirectory
(
suffix
+
"-FULL"
,
// String suffix,
null
,
// String [] labels, // or null
full_render
,
// double [][] data,
hdr_whs
[
0
],
// int width, // int tilesX,
hdr_whs
[
1
]);
// int height, // int tilesY,
if
(
crop_empty
||
(
crop_extra
>
0
))
{
int
[]
wh
=
new
int
[
2
];
double
[][]
img_cropped
=
Render3D
.
cropRectified
(
crop_empty
,
// boolean crop_empty,
last_is_alpha
,
// boolean last_is_alpha,
crop_extra
,
// int crop_extra,
hdr_whs
[
0
],
// int width,
wh
,
// int [] wh, // should be initialized to int [2]
full_render
);
// double [][] img_src)
if
(
img_cropped
!=
null
)
{
// has NaN and alpha 0-1
scenes
[
ref_index
].
saveDoubleArrayInModelDirectory
(
suffix
+
"-CROP"
,
// String suffix,
null
,
// String [] labels, // or null
img_cropped
,
// double [][] data,
wh
[
0
],
// int width, // int tilesX,
wh
[
1
]);
// int height, // int tilesY,
// for (int tex_palette = tex_palette_start; tex_palette <= tex_palette_end; tex_palette++) {
for
(
int
tex_palette:
tex_pals
)
{
// try with fixed range?
double
[]
minmax
=
tex_um_fixed
?
(
new
double
[]
{-
tex_um_range
/
2
,
tex_um_range
/
2
}):
null
;
scenes
[
ref_index
].
writeLwirPreview
(
clt_parameters
,
// final CLTParameters clt_parameters,
img_cropped
[
0
],
// double [] data,
Render3D
render3D
=
new
Render3D
(
//x3d_dir, // String x3d_dir,
//ref_scene.correctionsParameters.getModelName(ref_scene.getImageName()), // String model_name,
scenes
[
ref_index
],
// QuadCLT ref_scene, // all coordinates relative to this scene
to_ground_xyzatr
,
// double [][] plane_xyzatr, // projection plane center relative to reference scene
scaled_pixel_size
,
// double pixel_size, // in meters
hdr_x0y0
,
// double [] x0_y0, // usually negative - top-left point of the output render
hdr_whs
[
0
],
// int out_width, // output rendered image width in pixels
hdr_whs
[
1
]);
// int out_height); // output rendered image height in pixels
boolean
last_is_alpha
=
true
;
// last channel in textures slices is alpha
double
[][]
full_render
;
if
(
use_parallel_proj
)
{
full_render
=
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)
}
else
{
full_render
=
render3D
.
render3dPlaneCenterProj
(
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)
}
// String model_name = ref_scene.correctionsParameters.getModelName(ref_scene.getImageName());
String
suffix
=
"-RECT"
;
if
(
clt_parameters
.
tex_um
)
{
suffix
+=
"-UM"
+(
clt_parameters
.
tex_um_sigma
)+
"_"
+(
clt_parameters
.
tex_um_weight
);
}
suffix
+=
"-PIX"
+
pix_size
*
hdr_whs
[
2
];
scenes
[
ref_index
].
saveDoubleArrayInModelDirectory
(
suffix
+
"-FULL"
,
// String suffix,
null
,
// String [] labels, // or null
full_render
,
// double [][] data,
hdr_whs
[
0
],
// int width, // int tilesX,
hdr_whs
[
1
]);
// int height, // int tilesY,
if
(
crop_empty
||
(
crop_extra
>
0
))
{
int
[]
wh
=
new
int
[
2
];
double
[][]
img_cropped
=
Render3D
.
cropRectified
(
crop_empty
,
// boolean crop_empty,
last_is_alpha
,
// boolean last_is_alpha,
crop_extra
,
// int crop_extra,
hdr_whs
[
0
],
// int width,
wh
,
// int [] wh, // should be initialized to int [2]
full_render
);
// double [][] img_src)
if
(
img_cropped
!=
null
)
{
// has NaN and alpha 0-1
scenes
[
ref_index
].
saveDoubleArrayInModelDirectory
(
suffix
+
"-CROP"
,
// String suffix,
null
,
// String [] labels, // or null
img_cropped
,
// double [][] data,
wh
[
0
],
// int width, // int tilesX,
minmax
,
// double [] minmax, // null for auto
null
,
// QuadCLT scene,
tex_palette
,
// int tex_palette,
suffix
+
"-CROP"
+
"-PAL"
+
tex_palette
,
// +tex_palette, // String suffix,
debugLevel
);
// int debugLevel)
wh
[
1
]);
// int height, // int tilesY,
// for (int tex_palette = tex_palette_start; tex_palette <= tex_palette_end; tex_palette++) {
for
(
int
tex_palette:
tex_pals
)
{
// try with fixed range?
double
[]
minmax
=
tex_um_fixed
?
(
new
double
[]
{-
tex_um_range
/
2
,
tex_um_range
/
2
}):
null
;
scenes
[
ref_index
].
writeLwirPreview
(
clt_parameters
,
// final CLTParameters clt_parameters,
img_cropped
[
0
],
// double [] data,
wh
[
0
],
// int width, // int tilesX,
minmax
,
// double [] minmax, // null for auto
null
,
// QuadCLT scene,
tex_palette
,
// int tex_palette,
suffix
+
"-CROP"
+
"-PAL"
+
tex_palette
,
// +tex_palette, // String suffix,
debugLevel
);
// int debugLevel)
}
}
}
}
}
}
if
(
dbg_mesh_imgs
!=
null
)
{
ShowDoubleFloatArrays
.
showArrays
(
dbg_mesh_imgs
,
...
...
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