Loading src/main/java/com/elphel/imagej/orthomosaic/ComboMatch.java +2 −0 Original line number Diff line number Diff line Loading @@ -1303,6 +1303,8 @@ public class ComboMatch { System.out.println("This can happen if files have different resolution for new run."); System.out.println("Verify path, then modify filenames[i], break at line above: 'maps_collection.ortho_maps[i].setFileName(filenames[i])'."); System.out.println("Reduce i by 1 and continue"); } else { maps_collection.ortho_maps[i] = new OrthoMap(path); } } return true; Loading src/main/java/com/elphel/imagej/orthomosaic/OrthoMap.java +23 −8 Original line number Diff line number Diff line Loading @@ -913,6 +913,10 @@ public class OrthoMap implements Comparable <OrthoMap>, Serializable{ int swidth = getWidth(); int sheight = getHeight(); final float [] spix = orig_image.data; if (swidth*sheight != spix.length) { System.out.println ("downScaleForGPU(): swidth="+ swidth+", sheight="+sheight+", swidth*sheight="+(swidth*sheight)+", spix.length="+spix.length); System.out.println (); } final int width = (swidth+frscale-1)/frscale; final int height = (sheight+frscale-1)/frscale; final int tiles = width * height; Loading @@ -939,17 +943,28 @@ public class OrthoMap implements Comparable <OrthoMap>, Serializable{ for (int py = 0; py < tileH; py++) { int ls = (tileY*frscale + py)*swidth; for (int px = 0; px < tileW; px++) { double d = spix[ls + tileX*frscale+px]; int indx = ls + tileX*frscale+px; if ((indx >=0) && (indx < spix.length)) { double d = spix[ls + tileX*frscale+px]; //java.lang.ArrayIndexOutOfBoundsException: Index 3892800 out of bounds for length 3892680 if (!Double.isNaN(d)) { double w = wnd[py][px]; sw += w; swd += w*d; } if (sw > 0) { opix[tileY * width + tileX] = (float) (swd/sw); } else { System.out.println("downScaleForGPU(): indx = "+indx+" ("+spix.length+"), tileX= "+ tileX+", tileY="+tileY+", px="+px+", py="+py+", ls="+ls); } // if (sw > 0) { // opix[tileY * width + tileX] = (float) (swd/sw); // } } } if (sw > 0) { opix[tileY * width + tileX] = (float) (swd/sw); } } } }; Loading Loading
src/main/java/com/elphel/imagej/orthomosaic/ComboMatch.java +2 −0 Original line number Diff line number Diff line Loading @@ -1303,6 +1303,8 @@ public class ComboMatch { System.out.println("This can happen if files have different resolution for new run."); System.out.println("Verify path, then modify filenames[i], break at line above: 'maps_collection.ortho_maps[i].setFileName(filenames[i])'."); System.out.println("Reduce i by 1 and continue"); } else { maps_collection.ortho_maps[i] = new OrthoMap(path); } } return true; Loading
src/main/java/com/elphel/imagej/orthomosaic/OrthoMap.java +23 −8 Original line number Diff line number Diff line Loading @@ -913,6 +913,10 @@ public class OrthoMap implements Comparable <OrthoMap>, Serializable{ int swidth = getWidth(); int sheight = getHeight(); final float [] spix = orig_image.data; if (swidth*sheight != spix.length) { System.out.println ("downScaleForGPU(): swidth="+ swidth+", sheight="+sheight+", swidth*sheight="+(swidth*sheight)+", spix.length="+spix.length); System.out.println (); } final int width = (swidth+frscale-1)/frscale; final int height = (sheight+frscale-1)/frscale; final int tiles = width * height; Loading @@ -939,17 +943,28 @@ public class OrthoMap implements Comparable <OrthoMap>, Serializable{ for (int py = 0; py < tileH; py++) { int ls = (tileY*frscale + py)*swidth; for (int px = 0; px < tileW; px++) { double d = spix[ls + tileX*frscale+px]; int indx = ls + tileX*frscale+px; if ((indx >=0) && (indx < spix.length)) { double d = spix[ls + tileX*frscale+px]; //java.lang.ArrayIndexOutOfBoundsException: Index 3892800 out of bounds for length 3892680 if (!Double.isNaN(d)) { double w = wnd[py][px]; sw += w; swd += w*d; } if (sw > 0) { opix[tileY * width + tileX] = (float) (swd/sw); } else { System.out.println("downScaleForGPU(): indx = "+indx+" ("+spix.length+"), tileX= "+ tileX+", tileY="+tileY+", px="+px+", py="+py+", ls="+ls); } // if (sw > 0) { // opix[tileY * width + tileX] = (float) (swd/sw); // } } } if (sw > 0) { opix[tileY * width + tileX] = (float) (swd/sw); } } } }; Loading