/** * Provides recent images from all the cameras (should be time and lighting synchronized) and renders them * into an equirectangular image. The images must be in the same order that the cameras were added. * * @param cameraImages List of camera images */ public void render( List<T> cameraImages ) { if( cameraImages.size() != cameras.size()) throw new IllegalArgumentException("Input camera image count doesn't equal the expected number"); // avoid divide by zero errors by initializing it to a small non-zero value GImageMiscOps.fill(weightImage,1e-4); GImageMiscOps.fill(averageImage,0); for (int i = 0; i < cameras.size(); i++) { Camera c = cameras.get(i); T cameraImage = cameraImages.get(i); distort.setModel(c.equiToCamera); distort.apply(cameraImage,cameraRendered); /// sum up the total weight for each pixel PixelMath.add(weightImage,c.mask,weightImage); // apply the weight for this image to the rendered image GPixelMath.multiply(c.mask,cameraRendered,workImage); // add the result to the average image GPixelMath.add(workImage, averageImage, averageImage); } // comput the final output by dividing GPixelMath.divide(averageImage,weightImage,averageImage); }
/** * Provides recent images from all the cameras (should be time and lighting synchronized) and renders them * into an equirectangular image. The images must be in the same order that the cameras were added. * * @param cameraImages List of camera images */ public void render( List<T> cameraImages ) { if( cameraImages.size() != cameras.size()) throw new IllegalArgumentException("Input camera image count doesn't equal the expected number"); // avoid divide by zero errors by initializing it to a small non-zero value GImageMiscOps.fill(weightImage,1e-4); GImageMiscOps.fill(averageImage,0); for (int i = 0; i < cameras.size(); i++) { Camera c = cameras.get(i); T cameraImage = cameraImages.get(i); distort.setModel(c.equiToCamera); distort.apply(cameraImage,cameraRendered); /// sum up the total weight for each pixel PixelMath.add(weightImage,c.mask,weightImage); // apply the weight for this image to the rendered image GPixelMath.multiply(c.mask,cameraRendered,workImage); // add the result to the average image GPixelMath.add(workImage, averageImage, averageImage); } // comput the final output by dividing GPixelMath.divide(averageImage,weightImage,averageImage); }
multiply(in.getBand(i),value,out.getBand(i));
multiply(in.getBand(i),value,lower,upper,out.getBand(i));
multiply(inA.getBand(i), inB.getBand(i), out.getBand(i));