Commit 22872131 authored by Andrey Filippov's avatar Andrey Filippov

Fixed no-tile (empty) meshes export

parent afd1853a
...@@ -267,8 +267,12 @@ public class CorrectionColorProc { ...@@ -267,8 +267,12 @@ public class CorrectionColorProc {
this.denoiseMaskChroma=dmask; // (global, used to return denoise mask to save/show this.denoiseMaskChroma=dmask; // (global, used to return denoise mask to save/show
this.denoiseMaskChromaWidth=width; // width of the this.denoiseMaskChroma image this.denoiseMaskChromaWidth=width; // width of the this.denoiseMaskChroma image
} else { } else {
gb.blurDouble(dpixels_pr, width, height, colorProcParameters.chromaBrightSigma, colorProcParameters.chromaBrightSigma, 0.01); if ((width <= 0) || (height <= 0)) {
gb.blurDouble(dpixels_pb, width, height, colorProcParameters.chromaBrightSigma, colorProcParameters.chromaBrightSigma, 0.01); System.out.println("***** BUG oin processColorsWeights: width="+width+", height="+height+" ****");
} else {
gb.blurDouble(dpixels_pr, width, height, colorProcParameters.chromaBrightSigma, colorProcParameters.chromaBrightSigma, 0.01);
gb.blurDouble(dpixels_pb, width, height, colorProcParameters.chromaBrightSigma, colorProcParameters.chromaBrightSigma, 0.01);
}
this.denoiseMaskChroma=null; // (global, used to return denoise mask to save/show this.denoiseMaskChroma=null; // (global, used to return denoise mask to save/show
} }
for (i=0;i<dpixels_pr.length;i++) { for (i=0;i<dpixels_pr.length;i++) {
......
...@@ -169,7 +169,11 @@ public class CLTPass3d{ ...@@ -169,7 +169,11 @@ public class CLTPass3d{
selected[ty * tilesX + tx] = false; // may be omitted selected[ty * tilesX + tx] = false; // may be omitted
} }
} }
texture_bounds = new Rectangle(minX, minY, maxX - minX +1, maxY - minY +1 ); if (maxX < 0) {
texture_bounds = null;
} else {
texture_bounds = new Rectangle(minX, minY, maxX - minX +1, maxY - minY +1 );
}
} }
public Rectangle getTextureBounds(){ public Rectangle getTextureBounds(){
......
...@@ -8226,41 +8226,43 @@ public class QuadCLT { ...@@ -8226,41 +8226,43 @@ public class QuadCLT {
threadsMax, // maximal number of threads to launch threadsMax, // maximal number of threads to launch
updateStatus, updateStatus,
batch_mode ? -5: debugLevel); batch_mode ? -5: debugLevel);
double [] scan_disparity = new double [tilesX * tilesY]; if (texturePath != null) { // null if empty image
int indx = 0; double [] scan_disparity = new double [tilesX * tilesY];
// boolean [] scan_selected = scan.getSelected(); int indx = 0;
for (int ty = 0; ty < tilesY; ty ++) for (int tx = 0; tx < tilesX; tx ++){ // boolean [] scan_selected = scan.getSelected();
scan_disparity[indx++] = infinity_disparity; for (int ty = 0; ty < tilesY; ty ++) for (int tx = 0; tx < tilesX; tx ++){
} scan_disparity[indx++] = infinity_disparity;
// tp.showScan( }
// scan, // CLTPass3d scan, // tp.showScan(
// "infinityDistance"); // scan, // CLTPass3d scan,
// "infinityDistance");
boolean showTri = false; // ((scanIndex < next_pass + 1) && clt_parameters.show_triangles) ||((scanIndex - next_pass) == 73);
try { boolean showTri = false; // ((scanIndex < next_pass + 1) && clt_parameters.show_triangles) ||((scanIndex - next_pass) == 73);
generateClusterX3d( try {
x3dOutput, generateClusterX3d(
wfOutput, // output WSavefront if not null x3dOutput,
texturePath, wfOutput, // output WSavefront if not null
"INFINITY", // id (scanIndex - next_pass), // id texturePath,
"INFINITY", // class "INFINITY", // id (scanIndex - next_pass), // id
bgndScan.getTextureBounds(), "INFINITY", // class
bgndScan.selected, bgndScan.getTextureBounds(),
scan_disparity, // scan.disparity_map[ImageDtt.DISPARITY_INDEX_CM], bgndScan.selected,
clt_parameters.transform_size, scan_disparity, // scan.disparity_map[ImageDtt.DISPARITY_INDEX_CM],
clt_parameters.correct_distortions, // requires backdrop image to be corrected also clt_parameters.transform_size,
showTri, // (scanIndex < next_pass + 1) && clt_parameters.show_triangles, clt_parameters.correct_distortions, // requires backdrop image to be corrected also
infinity_disparity, // 0.3 showTri, // (scanIndex < next_pass + 1) && clt_parameters.show_triangles,
clt_parameters.grow_disp_max, // other_range, // 2.0 'other_range - difference from the specified (*_CM) infinity_disparity, // 0.3
clt_parameters.maxDispTriangle); clt_parameters.grow_disp_max, // other_range, // 2.0 'other_range - difference from the specified (*_CM)
} catch (IOException e) { clt_parameters.maxDispTriangle);
// TODO Auto-generated catch block } catch (IOException e) {
e.printStackTrace(); // TODO Auto-generated catch block
return false; e.printStackTrace();
return false;
}
// maybe not needed
bgndScan.setBorderTiles(bg_border_backup);
bgndScan.setSelected(bg_sel_backup);
} }
// maybe not needed
bgndScan.setBorderTiles(bg_border_backup);
bgndScan.setSelected(bg_sel_backup);
} }
} }
...@@ -8300,7 +8302,9 @@ public class QuadCLT { ...@@ -8300,7 +8302,9 @@ public class QuadCLT {
threadsMax, // maximal number of threads to launch threadsMax, // maximal number of threads to launch
updateStatus, updateStatus,
batch_mode ? -5: debugLevel); batch_mode ? -5: debugLevel);
if (texturePath == null) {
continue; // empty image
}
CLTPass3d scan = tp.clt_3d_passes.get(scanIndex); CLTPass3d scan = tp.clt_3d_passes.get(scanIndex);
// TODO: use new updated disparity, for now just what was forced for the picture // TODO: use new updated disparity, for now just what was forced for the picture
...@@ -8388,6 +8392,9 @@ public class QuadCLT { ...@@ -8388,6 +8392,9 @@ public class QuadCLT {
double maxDispTriangle double maxDispTriangle
) throws IOException ) throws IOException
{ {
if (bounds == null) {
return;
}
int [][] indices = tp.getCoordIndices( // starting with 0, -1 - not selected int [][] indices = tp.getCoordIndices( // starting with 0, -1 - not selected
bounds, bounds,
selected); selected);
...@@ -8683,6 +8690,10 @@ public class QuadCLT { ...@@ -8683,6 +8690,10 @@ public class QuadCLT {
boolean [] borderTiles = scan.border_tiles; boolean [] borderTiles = scan.border_tiles;
double [][][][] texture_tiles = scan.texture_tiles; double [][][][] texture_tiles = scan.texture_tiles;
scan.updateSelection(); // update .selected field (all selected, including border) and Rectangle bounds scan.updateSelection(); // update .selected field (all selected, including border) and Rectangle bounds
if (scan.getTextureBounds() == null) {
System.out.println("getPassImage(): Empty image!");
return null;
}
double [][]alphaFade = tp.getAlphaFade(clt_parameters.transform_size); double [][]alphaFade = tp.getAlphaFade(clt_parameters.transform_size);
if ((debugLevel > 0) && (scanIndex == 1)) { if ((debugLevel > 0) && (scanIndex == 1)) {
String [] titles = new String[16]; String [] titles = new String[16];
...@@ -8754,6 +8765,9 @@ public class QuadCLT { ...@@ -8754,6 +8765,9 @@ public class QuadCLT {
int width = resize ? (clt_parameters.transform_size * scan.getTextureBounds().width): (clt_parameters.transform_size * tilesX); int width = resize ? (clt_parameters.transform_size * scan.getTextureBounds().width): (clt_parameters.transform_size * tilesX);
int height = resize ? (clt_parameters.transform_size * scan.getTextureBounds().height): (clt_parameters.transform_size * tilesY); int height = resize ? (clt_parameters.transform_size * scan.getTextureBounds().height): (clt_parameters.transform_size * tilesY);
if ((width <= 0) || (height <= 0)) {
System.out.println("***** BUG in getPassImage(): width="+width+", height="+height+", resize="+resize+" ****");
}
ImagePlus imp_texture_cluster = linearStackToColor( ImagePlus imp_texture_cluster = linearStackToColor(
clt_parameters, clt_parameters,
......
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