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

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

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

origin: org.boofcv/visualize

public void setSelected( int selected ) {
  this.selectedImage = selected;
  this.isUndistorted = false;
  if( origMS == null ) {
    BufferedImage image = images.get(selected);
    // the number of bands can be difficult to ascertain without digging deep into the data structure
    // so just declare a new one using convert
    origMS = ConvertBufferedImage.convertFromMulti(image,null,true,GrayF32.class);
    correctedMS = ConvertBufferedImage.convertFromMulti(image,null,true,GrayF32.class);
    undistorted = new BufferedImage(image.getWidth(),image.getHeight(),image.getType());
  }
}
origin: org.boofcv/io

  Planar<GrayU8> color = ConvertBufferedImage.convertFromMulti(img,null,true,GrayU8.class);
  savePPM(color, fileName, null);
} else if( fileName.endsWith("pgm") || fileName.endsWith("PGM") ) {
origin: org.boofcv/io

/**
 * Converts a buffered image into an image of the specified type.
 * 
 * @param src Input BufferedImage which is to be converted
 * @param dst The image which it is being converted into
 * @param orderRgb If applicable, should it adjust the ordering of each color band to maintain color consistency
 */
public static <T extends ImageBase> void convertFrom(BufferedImage src, T dst , boolean orderRgb) {
  if( dst instanceof ImageGray) {
    ImageGray sb = (ImageGray)dst;
    convertFromSingle(src, sb, (Class<ImageGray>) sb.getClass());
  } else if( dst instanceof Planar) {
    Planar ms = (Planar)dst;
    convertFromMulti(src,ms,orderRgb,ms.getBandType());
  } else if( dst instanceof ImageInterleaved ) {
    convertFromInterleaved(src, (ImageInterleaved) dst, orderRgb);
  } else {
    throw new IllegalArgumentException("Unknown type " + dst.getClass().getSimpleName());
  }
}
origin: org.boofcv/io

/**
 * Converts a buffered image into an image of the specified type.
 *
 * @param src Input BufferedImage which is to be converted
 * @param orderRgb If applicable, should it adjust the ordering of each color band to maintain color consistency
 * @param imageType Type of image it is to be converted into
 * @return The image
 */
public static <T extends ImageBase> T convertFrom(BufferedImage src , boolean orderRgb , ImageType<T> imageType) {
  T out = imageType.createImage(src.getWidth(),src.getHeight());
  switch( imageType.getFamily() ) {
    case GRAY:
      convertFromSingle(src, (ImageGray)out, imageType.getImageClass());
      break;
    case PLANAR:
      convertFromMulti(src, (Planar) out, orderRgb, imageType.getImageClass());
      break;
    case INTERLEAVED:
      convertFromInterleaved(src, (ImageInterleaved) out, orderRgb);
      break;
    default:
      throw new RuntimeException("Not supported yet");
  }
  return out;
}
origin: org.boofcv/io

public static <T extends ImageBase> T convertFrom(BufferedImage src , boolean orderRgb , T output ) {
  ImageType<T> imageType = output.getImageType();
  switch( imageType.getFamily() ) {
    case GRAY:
      convertFromSingle(src, (ImageGray)output, imageType.getImageClass());
      break;
    case PLANAR:
      convertFromMulti(src, (Planar) output, orderRgb, imageType.getImageClass());
      break;
    case INTERLEAVED:
      convertFromInterleaved(src, (ImageInterleaved) output, orderRgb);
      break;
    default:
      throw new RuntimeException("Not supported yet");
  }
  return output;
}
origin: org.boofcv/visualize

private void undoRadialDistortion(BufferedImage image) {
  ConvertBufferedImage.convertFromMulti(image, origMS,true, GrayF32.class);
  for( int i = 0; i < origMS.getNumBands(); i++ ) {
    GrayF32 in = origMS.getBand(i);
    GrayF32 out = correctedMS.getBand(i);
    undoRadial.apply(in,out);
  }
  if( correctedMS.getNumBands() == 3 )
    ConvertBufferedImage.convertTo(correctedMS,undistorted,true);
  else if( correctedMS.getNumBands() == 1 )
    ConvertBufferedImage.convertTo(correctedMS.getBand(0),undistorted);
  else
    throw new RuntimeException("What kind of image has "+correctedMS.getNumBands()+"???");
}
boofcv.io.imageConvertBufferedImageconvertFromMulti

Javadoc

Converts the buffered image into an Planar image of the specified type.

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
  • convertFromPlanar
  • 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

  • Reading from database using SQL prepared statement
  • requestLocationUpdates (LocationManager)
  • getApplicationContext (Context)
  • onCreateOptionsMenu (Activity)
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Best IntelliJ 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