|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.neuroph.contrib.imgrec.FractionRgbData
public class FractionRgbData
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.
Field Summary | |
---|---|
protected double[][] |
blueValues
Array which contains blue componenet of the color for each image pixel |
protected double[] |
flattenedRgbValues
Single array with the red, green and blue componenets of the color for each image pixel |
protected double[][] |
greenValues
Array which contains green componenet of the color for each image pixel |
protected double[][] |
redValues
Array which contains red componenet of the color for each image pixel |
Constructor Summary | |
---|---|
FractionRgbData(java.awt.image.BufferedImage img)
Creates rgb data for the specified image. |
Method Summary | |
---|---|
static double[] |
convertRgbInputToBinaryBlackAndWhite(double[] inputRGB)
Converts image rgb data to binary black and white data |
boolean |
equals(java.lang.Object obj)
|
double[][] |
getBlueValues()
Returns blue color component for the entire image |
double[] |
getFlattenedRgbValues()
Returns rgb data in a form: all red rows, all green rows, all blue rows |
double[][] |
getGreenValues()
Returns green color component for the entire image |
int |
getHeight()
Get image height |
double[][] |
getRedValues()
Returns red color component for the entire image |
int |
getWidth()
Get image width |
int |
hashCode()
|
protected void |
populateRGBArrays(java.awt.image.BufferedImage img)
Fills the rgb arrays from image |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected double[][] redValues
protected double[][] greenValues
protected double[][] blueValues
protected double[] flattenedRgbValues
Constructor Detail |
---|
public FractionRgbData(java.awt.image.BufferedImage img)
img
- image to cretae rgb data forMethod Detail |
---|
protected void populateRGBArrays(java.awt.image.BufferedImage img)
img
- image to get rgb data frompublic static double[] convertRgbInputToBinaryBlackAndWhite(double[] inputRGB)
inputRGB
- flatten rgb data
public int getWidth()
public int getHeight()
public double[][] getRedValues()
public double[][] getGreenValues()
public double[][] getBlueValues()
public double[] getFlattenedRgbValues()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |