org.canova.image.loader

Class ImageLoader

    • Constructor Detail

      • ImageLoader

        public ImageLoader()
      • ImageLoader

        public ImageLoader(int width,                   int height)
        Instantiate an image with the given width and height
        Parameters:
        width - the width to load
        height - the height to load
      • ImageLoader

        public ImageLoader(int width,                   int height,                   int channels)
        Instantiate an image with the given width and height
        Parameters:
        width - the width to load
        height - the height to load
        channels - the number of channels for the image
    • Method Detail

      • asRowVector

        public org.nd4j.linalg.api.ndarray.INDArray asRowVector(File f)                                                 throws Exception
        Convert a file to a row vector
        Parameters:
        f - the image to convert
        Returns:
        the flattened image
        Throws:
        Exception
      • asRowVector

        public org.nd4j.linalg.api.ndarray.INDArray asRowVector(InputStream inputStream)
      • asRowVector

        public org.nd4j.linalg.api.ndarray.INDArray asRowVector(BufferedImage image)
        Convert an image in to a row vector
        Parameters:
        image - the image to convert
        Returns:
        the row vector based on a rastered representation of the image
      • toRaveledTensor

        public org.nd4j.linalg.api.ndarray.INDArray toRaveledTensor(File file)
        Changes the input stream in to an bgr based raveled(flattened) vector
        Parameters:
        file - the input stream to convert
        Returns:
        the raveled bgr values for this input stream
      • toRaveledTensor

        public org.nd4j.linalg.api.ndarray.INDArray toRaveledTensor(InputStream is)
        Changes the input stream in to an bgr based raveled(flattened) vector
        Parameters:
        is - the input stream to convert
        Returns:
        the raveled bgr values for this input stream
      • toRaveledTensor

        public org.nd4j.linalg.api.ndarray.INDArray toRaveledTensor(BufferedImage image)
        Convert an image in to a raveled tensor of the bgr values of the image
        Parameters:
        image - the image to parse
        Returns:
        the raveled tensor of bgr values
      • toBgr

        public org.nd4j.linalg.api.ndarray.INDArray toBgr(File file)
        Convert an input stream to an bgr spectrum image
        Parameters:
        file - the file to convert
        Returns:
        the input stream to convert
      • toBgr

        public org.nd4j.linalg.api.ndarray.INDArray toBgr(InputStream inputStream)
        Convert an input stream to an bgr spectrum image
        Parameters:
        inputStream - the input stream to convert
        Returns:
        the input stream to convert
      • asMatrix

        public org.nd4j.linalg.api.ndarray.INDArray asMatrix(File f)                                              throws IOException
        Convert an image file in to a matrix
        Parameters:
        f - the file to convert
        Returns:
        a 2d matrix of a rastered version of the image
        Throws:
        IOException
      • asMatrix

        public org.nd4j.linalg.api.ndarray.INDArray asMatrix(InputStream inputStream)
        Convert an input stream to a matrix
        Parameters:
        inputStream - the input stream to convert
        Returns:
        the input stream to convert
      • asImageMiniBatches

        public org.nd4j.linalg.api.ndarray.INDArray asImageMiniBatches(File f,                                                               int numMiniBatches,                                                               int numRowsPerSlice)
        Slices up an image in to a mini batch.
        Parameters:
        f - the file to load from
        numMiniBatches - the number of images in a mini batch
        numRowsPerSlice - the number of rows for each image
        Returns:
        a tensor representing one image as a mini batch
      • fromFile

        public int[][] fromFile(File file)                 throws IOException
        Load a rastered image from file
        Parameters:
        file - the file to load
        Returns:
        the rastered image
        Throws:
        IOException
      • fromFileMultipleChannels

        public int[][][] fromFileMultipleChannels(File file)                                   throws IOException
        Load a rastered image from file
        Parameters:
        file - the file to load
        Returns:
        the rastered image
        Throws:
        IOException
      • toImage

        public static BufferedImage toImage(org.nd4j.linalg.api.ndarray.INDArray matrix)
        Convert a matrix in to a buffereed image
        Parameters:
        matrix - the
        Returns:
      • toBufferedImageRGB

        public void toBufferedImageRGB(org.nd4j.linalg.api.ndarray.INDArray arr,                               BufferedImage image)
        Convert the given image to an rgb image
        Parameters:
        arr - the array to use
        image - the iamge to set
      • toBufferedImage

        public static BufferedImage toBufferedImage(Image img,                                            int type)
        Converts a given Image into a BufferedImage
        Parameters:
        img - The Image to be converted
        type - The color model of BufferedImage
        Returns:
        The converted BufferedImage
      • toIntArrayArray

        protected int[][] toIntArrayArray(BufferedImage image)
      • toINDArrayBGR

        protected org.nd4j.linalg.api.ndarray.INDArray toINDArrayBGR(BufferedImage image)

Copyright © 2015. All rights reserved.



NOTHING
NOTHING
Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14