@Test public void testCreateMosaicImage() throws Exception { final RenderedImage image1 = createRenderedImage(1); final RenderedImage image2 = createRenderedImage(2); final RenderedImage image3 = createRenderedImage(3); final RenderedImage image4 = createRenderedImage(4); final RenderedImage image5 = createRenderedImage(5); final RenderedImage mosaicImage = CameraImageMosaic.create(image1, image2, image3, image4, image5); assertNotNull(mosaicImage); assertEquals(50, mosaicImage.getWidth()); assertEquals(100, mosaicImage.getHeight()); final Raster data = mosaicImage.getData(); for (int x = 0; x < mosaicImage.getWidth(); x++) { assertEquals(x / 10 + 1, data.getSample(x, 0, 0)); } }
static RenderedImage create(RenderedImage... sourceImages) { double[][] sourceThresholds = new double[sourceImages.length][1]; sourceThresholds[0][0] = determineSourceThreshold(sourceImages[0]); int t = 0; for (int i = 1; i < sourceImages.length; i++) { t += sourceImages[i - 1].getWidth(); sourceImages[i] = TranslateDescriptor.create(sourceImages[i], (float) t, 0.0f, INTERPOLATION, null); sourceThresholds[i][0] = determineSourceThreshold(sourceImages[i]); } return MosaicDescriptor.create(sourceImages, MosaicDescriptor.MOSAIC_TYPE_OVERLAY, null, null, sourceThresholds, null, null); }
CameraImageMosaic { static RenderedImage create(RenderedImage... sourceImages) { double[][] sourceThresholds = new double[sourceImages.length][1]; sourceThresholds[0][0] = determineSourceThreshold(sourceImages[0]); int t = 0; for (int i = 1; i < sourceImages.length; i++) { t += sourceImages[i - 1].getWidth(); sourceImages[i] = TranslateDescriptor.create(sourceImages[i], (float) t, 0.0f, INTERPOLATION, null); sourceThresholds[i][0] = determineSourceThreshold(sourceImages[i]); } return MosaicDescriptor.create(sourceImages, MosaicDescriptor.MOSAIC_TYPE_OVERLAY, null, null, sourceThresholds, null, null); } }
CameraImageMosaic { static RenderedImage create(RenderedImage... sourceImages) { double[][] sourceThresholds = new double[sourceImages.length][1]; sourceThresholds[0][0] = determineSourceThreshold(sourceImages[0]); int t = 0; for (int i = 1; i < sourceImages.length; i++) { t += sourceImages[i - 1].getWidth(); sourceImages[i] = TranslateDescriptor.create(sourceImages[i], (float) t, 0.0f, INTERPOLATION, null); sourceThresholds[i][0] = determineSourceThreshold(sourceImages[i]); } return MosaicDescriptor.create(sourceImages, MosaicDescriptor.MOSAIC_TYPE_OVERLAY, null, null, sourceThresholds, null, null); }  }
CameraImageMosaic { static RenderedImage create(RenderedImage... sourceImages) { double[][] sourceThresholds = new double[sourceImages.length][1]; sourceThresholds[0][0] = determineSourceThreshold(sourceImages[0]); int t = 0; for (int i = 1; i < sourceImages.length; i++) { t += sourceImages[i - 1].getWidth(); sourceImages[i] = TranslateDescriptor.create(sourceImages[i], (float) t, 0.0f, INTERPOLATION, null); sourceThresholds[i][0] = determineSourceThreshold(sourceImages[i]); } return MosaicDescriptor.create(sourceImages, MosaicDescriptor.MOSAIC_TYPE_OVERLAY, null, null, sourceThresholds, null, null); }  static MultiLevelImage create(final MultiLevelImage... sourceImages); }
CameraImageMosaic { static RenderedImage create(RenderedImage... sourceImages) { double[][] sourceThresholds = new double[sourceImages.length][1]; sourceThresholds[0][0] = determineSourceThreshold(sourceImages[0]); int t = 0; for (int i = 1; i < sourceImages.length; i++) { t += sourceImages[i - 1].getWidth(); sourceImages[i] = TranslateDescriptor.create(sourceImages[i], (float) t, 0.0f, INTERPOLATION, null); sourceThresholds[i][0] = determineSourceThreshold(sourceImages[i]); } return MosaicDescriptor.create(sourceImages, MosaicDescriptor.MOSAIC_TYPE_OVERLAY, null, null, sourceThresholds, null, null); }  static MultiLevelImage create(final MultiLevelImage... sourceImages);  }