Commit 98783836 authored by Andrey Filippov's avatar Andrey Filippov

starting other exports

parent 4bdd4cd8
...@@ -3024,78 +3024,81 @@ public class TexturedModel { ...@@ -3024,78 +3024,81 @@ public class TexturedModel {
} }
} }
if ((hdr_whs[0]<0) || (hdr_whs[1]<0)) {
Render3D render3D = new Render3D ( System.out.println("**** BUG: hdr_whs[0]="+hdr_whs[0]+", hdr_whs[1]="+hdr_whs[1]);
//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 { } else {
full_render =render3D.render3dPlaneCenterProj( Render3D render3D = new Render3D (
tri_meshes, // final ArrayList<TriMesh> tri_meshes, //x3d_dir, // String x3d_dir,
last_is_alpha, // final boolean last_is_alpha, //ref_scene.correctionsParameters.getModelName(ref_scene.getImageName()), // String model_name,
// scenes[ref_index], //final QuadCLT ref_scene, // all coordinates relative to this scene scenes[ref_index], // QuadCLT ref_scene, // all coordinates relative to this scene
debugLevel); //int debugLevel) to_ground_xyzatr, // double [][] plane_xyzatr, // projection plane center relative to reference scene
} scaled_pixel_size, // double pixel_size, // in meters
// String model_name = ref_scene.correctionsParameters.getModelName(ref_scene.getImageName()); hdr_x0y0, // double [] x0_y0, // usually negative - top-left point of the output render
String suffix ="-RECT"; hdr_whs[0], // int out_width, // output rendered image width in pixels
if (clt_parameters.tex_um) { hdr_whs[1]); // int out_height); // output rendered image height in pixels
suffix+="-UM"+(clt_parameters.tex_um_sigma)+"_"+(clt_parameters.tex_um_weight); boolean last_is_alpha = true; // last channel in textures slices is alpha
} double [][] full_render;
suffix +="-PIX"+pix_size * hdr_whs[2]; if (use_parallel_proj) {
scenes[ref_index].saveDoubleArrayInModelDirectory( full_render =render3D.render3dPlaneParallelProj(
suffix+"-FULL", // String suffix, tri_meshes, // final ArrayList<TriMesh> tri_meshes,
null, // String [] labels, // or null last_is_alpha, // final boolean last_is_alpha,
full_render, // double [][] data, // scenes[ref_index], //final QuadCLT ref_scene, // all coordinates relative to this scene
hdr_whs[0], // int width, // int tilesX, debugLevel); //int debugLevel)
hdr_whs[1]); // int height, // int tilesY, } else {
if (crop_empty || (crop_extra > 0)) { full_render =render3D.render3dPlaneCenterProj(
int [] wh = new int[2]; tri_meshes, // final ArrayList<TriMesh> tri_meshes,
double [][] img_cropped = Render3D.cropRectified( last_is_alpha, // final boolean last_is_alpha,
crop_empty, // boolean crop_empty, // scenes[ref_index], //final QuadCLT ref_scene, // all coordinates relative to this scene
last_is_alpha, // boolean last_is_alpha, debugLevel); //int debugLevel)
crop_extra, // int crop_extra, }
hdr_whs[0], // int width, // String model_name = ref_scene.correctionsParameters.getModelName(ref_scene.getImageName());
wh, // int [] wh, // should be initialized to int [2] String suffix ="-RECT";
full_render); // double [][] img_src) if (clt_parameters.tex_um) {
if (img_cropped != null) { // has NaN and alpha 0-1 suffix+="-UM"+(clt_parameters.tex_um_sigma)+"_"+(clt_parameters.tex_um_weight);
scenes[ref_index].saveDoubleArrayInModelDirectory( }
suffix+"-CROP", // String suffix, suffix +="-PIX"+pix_size * hdr_whs[2];
null, // String [] labels, // or null scenes[ref_index].saveDoubleArrayInModelDirectory(
img_cropped, // double [][] data, suffix+"-FULL", // String suffix,
wh[0], // int width, // int tilesX, null, // String [] labels, // or null
wh[1]); // int height, // int tilesY, full_render, // double [][] data,
// for (int tex_palette = tex_palette_start; tex_palette <= tex_palette_end; tex_palette++) { hdr_whs[0], // int width, // int tilesX,
for (int tex_palette: tex_pals) { hdr_whs[1]); // int height, // int tilesY,
// try with fixed range? if (crop_empty || (crop_extra > 0)) {
double [] minmax = tex_um_fixed ? (new double[] {-tex_um_range/2, tex_um_range/2}): null; int [] wh = new int[2];
scenes[ref_index].writeLwirPreview( double [][] img_cropped = Render3D.cropRectified(
clt_parameters, // final CLTParameters clt_parameters, crop_empty, // boolean crop_empty,
img_cropped[0], // double [] data, 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[0], // int width, // int tilesX,
minmax, // double [] minmax, // null for auto wh[1]); // int height, // int tilesY,
null, // QuadCLT scene, // for (int tex_palette = tex_palette_start; tex_palette <= tex_palette_end; tex_palette++) {
tex_palette, // int tex_palette, for (int tex_palette: tex_pals) {
suffix+"-CROP"+"-PAL"+tex_palette, // +tex_palette, // String suffix, // try with fixed range?
debugLevel); // int debugLevel) 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) { if (dbg_mesh_imgs != null) {
ShowDoubleFloatArrays.showArrays( ShowDoubleFloatArrays.showArrays(
dbg_mesh_imgs, dbg_mesh_imgs,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment