public INDArray asMatrix(InputStream inputStream) throws IOException {
  if (channels == 3)   return toBgr(inputStream);
  try {
    BufferedImage image=ImageIO.read(inputStream);
    return asMatrix(image);
  }
 catch (  IOException e) {
    throw new IOException("Unable to load image",e);
  }
}

public INDArray asMatrix ( InputStream inputStream ) throws IOException { if ( channels == 3 ) return toBgr ( inputStream ) ; try { BufferedImage image = ImageIO . read ( inputStream ) ; return asMatrix ( image ) ; } catch ( IOException e ) { throw new IOException ( "Unable to load image" , e ) ; } }
convert an input stream to a matrix
