Commit c3505d27 authored by Andrey Filippov's avatar Andrey Filippov
Browse files

Working snapshot,single-connected pairs

parent d8f3ec21
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;
+23 −8
Original line number Diff line number Diff line
@@ -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;
@@ -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