示例#1
0
  private void doNotScaleLayers() {
    int N = pyramid.getNumLayers();

    for (int i = 0; i < N; i++) {
      BufferedImage b = ConvertBufferedImage.convertTo(pyramid.getLayer(i), null, true);
      addImage(b, String.format("%5.2f", pyramid.getScale(i)));
    }
  }
示例#2
0
  private void scaleUpLayers() {
    T l = pyramid.getLayer(0);
    if (upscale == null) {
      interp = (InterpolatePixelS<T>) FactoryInterpolation.nearestNeighborPixelS(l.getClass());
      upscale = (T) l._createNew(l.width, l.height);
    } else {
      upscale.reshape(l.width, l.height);
    }

    int N = pyramid.getNumLayers();

    for (int i = 0; i < N; i++) {
      new FDistort(pyramid.getLayer(i), upscale).interpNN().scaleExt().apply();
      BufferedImage b = ConvertBufferedImage.convertTo(upscale, null, true);
      if (showScales) addImage(b, String.format("%5.2f", pyramid.getScale(i)));
      else addImage(b, String.format("%5.2f", pyramid.getSigma(i)));
    }
  }
  public void render() {
    for (int i = 0; i < layers.length; i++) {
      VisualizeImageData.standard(pyramid.getLayer(i), layers[i]);
    }

    Graphics2D g2 = (Graphics2D) img.getGraphics();

    g2.drawImage(layers[0], 0, 0, this);
    int height = 0;
    int width = layers[0].getWidth();
    for (int i = 1; i < layers.length; i++) {
      g2.drawImage(layers[i], width, height, this);
      height += layers[i].getHeight();
    }
  }
示例#4
0
 public ImagePyramidPanel(ImagePyramid<T> pyramid, boolean scaleUp) {
   set(pyramid, scaleUp);
   render();
   setPreferredSize(new Dimension(pyramid.getWidth(0), pyramid.getHeight(0)));
 }