Tabnine Logo
FDistort.scaleExt
Code IndexAdd Tabnine to your IDE (free)

How to use
scaleExt
method
in
boofcv.abst.distort.FDistort

Best Java code snippets using boofcv.abst.distort.FDistort.scaleExt (Showing top 8 results out of 315)

origin: org.boofcv/demonstrations

  public static void main(String[] args) {
    BufferedImage original = UtilImageIO.loadImage(UtilIO.pathExample("simple_objects.jpg"));

    Planar<GrayF32> input = new Planar<>(GrayF32.class,
        original.getWidth(),original.getHeight(),3);

    ConvertBufferedImage.convertFromPlanar(original,input,true,GrayF32.class);

    Planar<GrayF32> output = new Planar<>(GrayF32.class,
        original.getWidth()/3,original.getHeight()/3,3);
    Planar<GrayF32> output2 = new Planar<>(GrayF32.class,
        original.getWidth()/3,original.getHeight()/3,3);

    AverageDownSampleOps.down(input, output);
    new FDistort(input,output2).scaleExt().apply();

    BufferedImage outputFull = ConvertBufferedImage.convertTo_F32(output, null, true);
    BufferedImage outputFull2 = ConvertBufferedImage.convertTo_F32(output2, null, true);

    ShowImages.showWindow(original,"Original");
    ShowImages.showWindow(outputFull,"3x small average");
    ShowImages.showWindow(outputFull2,"3x small bilinear");
  }
}
origin: org.boofcv/demonstrations

new FDistort(unscaled,input0).scaleExt().apply();
ConvertBufferedImage.convertFrom(image1, unscaled, false);
new FDistort(unscaled,input1).scaleExt().apply();
origin: org.boofcv/visualize

  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)));
    }
  }
}
origin: org.boofcv/boofcv-swing

  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)));
    }
  }
}
origin: org.boofcv/demonstrations

@Override
public void setActiveAlgorithm(String name, Object cookie) {
  DerivType type = (DerivType)cookie;
  panel.reset();
  for( int radius = 1; radius <= 40; radius += 2 ) {
    int maxOrder = Math.max(type.orderX,type.orderY);
    double sigma = FactoryKernelGaussian.sigmaForRadius(radius,maxOrder);
    Class typeKer1 = FactoryKernel.getKernelType(imageType,1);
    Kernel1D kerX =  FactoryKernelGaussian.derivativeK(typeKer1,type.orderX,sigma,radius);
    Kernel1D kerY = FactoryKernelGaussian.derivativeK(typeKer1,type.orderY,sigma,radius);
    Kernel2D kernel = GKernelMath.convolve(kerY, kerX);
    T smallImg = GKernelMath.convertToImage(kernel);
    new FDistort(smallImg,largeImg).interpNN().scaleExt().apply();
    double maxValue = GImageStatistics.maxAbs(largeImg);
    BufferedImage out = VisualizeImageData.colorizeSign(largeImg,null,maxValue);
    panel.addImage(out,String.format("%5d",radius));
  }
}
origin: org.boofcv/recognition

  AverageDownSampleOps.down(inputGray,scaled);
} else {
  new FDistort(inputGray,scaled).scaleExt().apply();
origin: org.boofcv/demonstrations

@Override
public void setActiveAlgorithm(String name, Object cookie) {
  DisplayGaussianKernelApp.DerivType dt = (DisplayGaussianKernelApp.DerivType)cookie;
  // add basis
  SteerableKernel<K> steerable = createKernel(dt.orderX,dt.orderY);
  basisPanel.reset();
  for( int i = 0; i < steerable.getBasisSize(); i++ ) {
    T smallImg = GKernelMath.convertToImage(steerable.getBasis(i));
    new FDistort(smallImg,largeImg).scaleExt().interpNN().apply();
    double maxValue = GImageStatistics.maxAbs(largeImg);
    BufferedImage out = VisualizeImageData.colorizeSign(largeImg,null,maxValue);
    basisPanel.addImage(out,"Basis "+i);
  }
  // add steered kernels
  steerPanel.reset();
  for( int i = 0; i <= 20; i++  ) {
    double angle = Math.PI*i/20.0;
    K kernel = steerable.compute(angle);
    T smallImg = GKernelMath.convertToImage(kernel);
    new FDistort(smallImg,largeImg).scaleExt().interpNN().apply();
    double maxValue = GImageStatistics.maxAbs(largeImg);
    BufferedImage out = VisualizeImageData.colorizeSign(largeImg,null,maxValue);
    steerPanel.addImage(out,String.format("%5d",(int)(180.0*angle/Math.PI)));
  }
  repaint();
}
origin: org.boofcv/demonstrations

new FDistort(featureImg,scaledIntensity).interpNN().scaleExt().apply();
boofcv.abst.distortFDistortscaleExt

Javadoc

Scales the image and sets the border to BorderType#EXTENDED. This is normally what you want to do when scaling an image. If you don't use an extended border when you hit the right and bottom boundaries it will go outside the image bounds and if a fixed value of 0 is used it will average towards zero.

Popular methods of FDistort

  • <init>
    Constructor
  • apply
    Applies the distortion.
  • interp
    Specifies the interpolation used by type.
  • interpNN
    Sets interpolation to use nearest-neighbor
  • transform
    Used to manually specify a transform. From output to input
  • affine
  • border
    Sets how the interpolation handles borders.
  • input
    Changes the input image. The previous distortion is thrown away only if the input image has a differ
  • output
    Changes the output image. The previous distortion is thrown away only if the output image has a diff
  • scale
    Applies a distortion which will rescale the input image into the output image. You might want to con
  • borderExt
    Sets the border to EXTEND.
  • init
    Specifies the input and output image and sets interpolation to BILINEAR, black image border, cache i
  • borderExt,
  • init,
  • rotate

Popular in Java

  • Updating database using SQL prepared statement
  • startActivity (Activity)
  • getSystemService (Context)
  • setContentView (Activity)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Reference (javax.naming)
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now