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

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

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

origin: org.boofcv/visualize

  private synchronized void setLevel( int level ) {
//        System.out.println("level "+level);
    if( level > 0 && ss != null ) {

      ImageGray small = ss.getLayer(level-1);
      ImageGray enlarge = GeneralizedImageOps.createSingleBand(small.getClass(), ss.getInputWidth(), ss.getInputHeight());
      new FDistort(small,enlarge).interpNN().apply();

      // if the size isn't the same null it so a new image will be declared
      if( levelImage != null &&
          (levelImage.getWidth() != enlarge.width || levelImage.getHeight() != enlarge.height )) {
        levelImage = null;
      }
      levelImage = ConvertBufferedImage.convertTo(enlarge,levelImage,true);

      double scale = ss.getScale(level-1);
      levelPoints.clear();
      for( ScalePoint p : points ) {
        if( p.scale == scale ) {
          levelPoints.add(p);
        }
      }
    } else {
      levelPoints.clear();
      levelPoints.addAll(points);
    }

    this.activeLevel = level;
  }

origin: org.boofcv/boofcv-swing

  private synchronized void setLevel( int level ) {
//        System.out.println("level "+level);
    if( level > 0 && ss != null ) {

      ImageGray small = (ImageGray)ss.getLayer(level-1);
      ImageGray enlarge = GeneralizedImageOps.createSingleBand(small.getClass(), ss.getInputWidth(), ss.getInputHeight());
      new FDistort(small,enlarge).interpNN().apply();

      // if the size isn't the same null it so a new image will be declared
      if( levelImage != null &&
          (levelImage.getWidth() != enlarge.width || levelImage.getHeight() != enlarge.height )) {
        levelImage = null;
      }
      levelImage = ConvertBufferedImage.convertTo(enlarge,levelImage,true);

      double scale = ss.getScale(level-1);
      levelPoints.clear();
      for( ScalePoint p : points ) {
        if( p.scale == scale ) {
          levelPoints.add(p);
        }
      }
    } else {
      levelPoints.clear();
      levelPoints.addAll(points);
    }

    this.activeLevel = level;
  }

origin: org.boofcv/demonstrations

private synchronized void render( Rectangle visibleRect ) {
  
  if( visibleRect.width == 0 || visibleRect.height == 0 )
    return;
  if( transformed.width != visibleRect.width || transformed.height != visibleRect.height ||
      workImage == null ) {
    transformed.reshape(visibleRect.width,visibleRect.height);
    workImage = new BufferedImage(visibleRect.width,visibleRect.height,BufferedImage.TYPE_INT_RGB);
  }
  double x = -visibleRect.x;
  double y = -visibleRect.y;
  new FDistort(input,transformed).interpNN().affine(scale,0,0,scale,x,y).apply();
  ConvertBufferedImage.convertTo(transformed,workImage,true);
}
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/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.distortFDistortinterpNN

Javadoc

Sets interpolation to use nearest-neighbor

Popular methods of FDistort

  • <init>
    Constructor
  • apply
    Applies the distortion.
  • interp
    Specifies the interpolation used by type.
  • scaleExt
    Scales the image and sets the border to BorderType#EXTENDED. This is normally what you want to do wh
  • 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

  • Finding current android device location
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • onRequestPermissionsResult (Fragment)
  • runOnUiThread (Activity)
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • JButton (javax.swing)
  • Best plugins for Eclipse
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