Tabnine Logo
ConvertBufferedImage.convertFromPlanar
Code IndexAdd Tabnine to your IDE (free)

How to use
convertFromPlanar
method
in
boofcv.io.image.ConvertBufferedImage

Best Java code snippets using boofcv.io.image.ConvertBufferedImage.convertFromPlanar (Showing top 7 results out of 315)

origin: org.boofcv/demonstrations

public void process( final BufferedImage image ) {
  input.reshape(image.getWidth(),image.getHeight());
  output.reshape(image.getWidth(),image.getHeight());
  ConvertBufferedImage.convertFromPlanar(image, input,true, GrayF32.class);
  SwingUtilities.invokeLater(new Runnable() {
    public void run() {
      setInputImage(image);
      doRefreshAll();
    }});
}
origin: org.boofcv/demonstrations

public void process( final BufferedImage image ) {
  input.reshape(image.getWidth(),image.getHeight());
  output.reshape(image.getWidth(),image.getHeight());
  storage.reshape(image.getWidth(),image.getHeight());
  ConvertBufferedImage.convertFromPlanar(image, input, true, imageType);
  SwingUtilities.invokeLater(new Runnable() {
    public void run() {
      setInputImage(image);
      renderedImage = new BufferedImage(input.width, input.height,BufferedImage.TYPE_INT_BGR);
      gui.setImage(renderedImage);
      gui.setPreferredSize(new Dimension(input.width,input.height));
      gui.repaint();
      processedImage = true;
      doRefreshAll();
    }});
}
origin: hazelcast/hazelcast-jet-demos

/**
 * The actual classification of the images by using the pre-trained model.
 */
private static Entry<String, Double> classifyWithModel(ImageClassifierVggCifar10 classifier, BufferedImage image) {
  Planar<GrayF32> planar = new Planar<>(GrayF32.class, image.getWidth(), image.getHeight(), 3);
  ConvertBufferedImage.convertFromPlanar(image, planar, true, GrayF32.class);
  classifier.classify(planar);
  return classifier.getAllResults().stream()
      .map(score -> entry(classifier.getCategories().get(score.category), score.score))
      .max(Comparator.comparing(Entry::getValue)).get();
}
origin: org.boofcv/demonstrations

public void process(final BufferedImage buffLeft, final BufferedImage buffRight) {
  imageLeft.reshape(buffLeft.getWidth(), buffLeft.getHeight());
  imageRight.reshape(buffRight.getWidth(), buffRight.getHeight());
  grayLeft.reshape(buffLeft.getWidth(), buffLeft.getHeight());
  grayRight.reshape(buffRight.getWidth(), buffRight.getHeight());
  ConvertBufferedImage.convertFromPlanar(buffLeft, imageLeft, true, imageType);
  ConvertBufferedImage.convertFromPlanar(buffRight, imageRight, true, imageType);
  GConvertImage.average(imageLeft, grayLeft);
  GConvertImage.average(imageRight, grayRight);
  SwingUtilities.invokeLater(new Runnable() {
    public void run() {
      panel.setImages(buffLeft, buffRight);
      processedImage = true;
      doRefreshAll();
    }
  });
}
origin: org.boofcv/demonstrations

private void setDescriptorInput() {
  if( describe != null )  {
    if( describe.getImageType().getFamily() == ImageType.Family.GRAY) {
      T input = ConvertBufferedImage.convertFromSingle(image, null, imageType);
      describe.setImage(input);
    } else {
      Planar<T> input = ConvertBufferedImage.convertFromPlanar(image, null, true, imageType);
      describe.setImage(input);
    }
  }
}
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

distLeft = ConvertBufferedImage.convertFromPlanar(origLeft, null, true, GrayF32.class);
distRight = ConvertBufferedImage.convertFromPlanar(origRight, null, true, GrayF32.class);
boofcv.io.imageConvertBufferedImageconvertFromPlanar

Popular methods of ConvertBufferedImage

  • convertFrom
    Converts a buffered image into an image of the specified type.
  • convertTo
    Draws the component into a BufferedImage.
  • convertFromSingle
  • checkDeclare
  • convertFromMulti
    Converts the buffered image into an Planar image of the specified type.
  • convertTo_F32
    Converts a Planar GrayF32 into a BufferedImage.
  • checkCopy
  • checkInputs
    If null the dst is declared, otherwise it checks to see if the 'dst' as the same shape as 'src'.
  • convertFromInterleaved
  • convertTo_U8
    Converts a Planar GrayU8 into a BufferedImage.
  • orderBandsBufferedFromRGB
    The image the BufferedImage was created from had RGB or RGBA color order. This swaps the bytes aroun
  • orderBandsBufferedFromRgb
  • orderBandsBufferedFromRGB,
  • orderBandsBufferedFromRgb,
  • orderBandsIntoBuffered,
  • orderBandsIntoRGB,
  • swapBandOrder

Popular in Java

  • Finding current android device location
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • notifyDataSetChanged (ArrayAdapter)
  • putExtra (Intent)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • JList (javax.swing)
  • Top 12 Jupyter Notebook extensions
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