Documentation of 'org.neuroph.imgrec.FractionRgbData' Java class
FractionRgbData
org.neuroph.imgrec

Class FractionRgbData



  • public class FractionRgbData
    extends java.lang.Object
    The intention of this class is to allow you to pay up front (at construction) the compute cost of converting the RGB values in a BufferedImage into a derived form. The major benefit of using this class is a single loop that grabs all 3 color channels (red, green, and blue) from each (x,y) coordinate, as opposed to looping through each color channel (red, green, or blue) when you need it. If you only need a single color from the channels (red, green, or blue) then using this class may be more expensive than a custom solution. In the event that it needs to be parsed, the flattened rgb values array contains all the red first, followed by all the green, followed by all the blue values. The flattened array size should be divisible by 3.
    • Constructor Detail

      • FractionRgbData

        public FractionRgbData(Image img)
        Creates rgb data for the specified image.
        Parameters:
        img - image to cretae rgb data for
      • FractionRgbData

        public FractionRgbData(java.awt.image.BufferedImage img)
    • Method Detail

      • convertRgbInputToBinaryBlackAndWhite

        public static double[] convertRgbInputToBinaryBlackAndWhite(double[] inputRGB)
        Converts image rgb data to binary black and white data (1 for black, 0 for white)
        Parameters:
        inputRGB - flatten rgb data
        Returns:
        binary black and white representation of image
      • getWidth

        public int getWidth()
        Get image width
        Returns:
        image width
      • getHeight

        public int getHeight()
        Get image height
        Returns:
        image height
      • getRedValues

        public double[][] getRedValues()
        Returns red color component for the entire image
        Returns:
        2d array in the form: [row][column]
      • getGreenValues

        public double[][] getGreenValues()
        Returns green color component for the entire image
        Returns:
        2d array in the form: [row][column]
      • getBlueValues

        public double[][] getBlueValues()
        Returns blue color component for the entire image
        Returns:
        2d array in the form: [row][column]
      • getFlattenedRgbValues

        public double[] getFlattenedRgbValues()
        Returns rgb data in a form: all red rows, all green rows, all blue rows
        Returns:
        All the red rows, followed by all the green rows, followed by all the blue rows.
      • equals

        public boolean equals(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.