public class Histogram_F64 extends TupleDesc_F64
A multi dimensional histogram. This is an extension of TupleDesc_F64 to faciliate comparision of different
histograms. Each dimension in the histogram coverages a range from the minimum to maximum value. This range is
divided by the number of bins in a dimension. Data is stored in a row major format from lower dimension to upper
dimension. For a 3D histogram a coordinate (a,b,c) would have index = c + b*length[0] + a*length[0]*length[1].
Usage example for RGB image:
Histogram_F64 hist = new Histogram_F64(20,20,20); hist.setRange(0,0,255); hist.setRange(1,0,255); hist.setRange(2,0,255); GHistogramFeatureOps.histogram(image,hist);
value| Constructor and Description |
|---|
Histogram_F64(int... lengths)
Creates a multi dimensional histogram where each dimension has the specified lengths.
|
| Modifier and Type | Method and Description |
|---|---|
Histogram_F64 |
copy()
Creates an exact copy of "this" histogram
|
double |
get(int[] coordinate)
Returns the value at the N-D coordinate
|
double |
get(int i,
int j)
Returns the value at the 2D coordinate
|
double |
get(int i,
int j,
int k)
Returns the value at the 3D coordinate
|
int |
getDimensionIndex(int dimension,
double value)
Given a value it returns the corresponding bin index in this histogram for the specified dimension.
|
int |
getDimensionIndex(int dimension,
int value)
Given a value it returns the corresponding bin index in this histogram for integer values.
|
int |
getDimensions()
The number of dimensions in the histogram.
|
int |
getIndex(int[] coordinate)
For a N-Dimensional histogram it will return the array index for the N-D coordinate
|
int |
getIndex(int i,
int j)
For a 2D histogram it returns the array index for coordinate (i,j)
|
int |
getIndex(int i,
int j,
int k)
For a 3D histogram it returns the array index for coordinate (i,j,k)
|
int |
getLength(int dimension)
Number of elements/bins along the specified dimension
|
double |
getMaximum(int dimension)
Returns the maximum allowed value in a dimension
|
double |
getMinimum(int dimension)
Returns the minimum allowed value in a dimension
|
boolean |
isRangeSet()
Returns true if the min and max value for each dimension has been set
|
Histogram_F64 |
newInstance()
Creates a new instance of this histogram which has the same "shape" and min / max values.
|
void |
setMaximum(int dimension,
double value)
Sets the maximum allowed value in a particular dimension
|
void |
setMinimum(int dimension,
double value)
Sets the minimum allowed value in a particular dimension
|
void |
setRange(int dimension,
double min,
double max)
Specifies the minimum and maximum values for a specific dimension
|
public Histogram_F64(int... lengths)
lengths - Number of elements in each dimensionpublic boolean isRangeSet()
public int getDimensions()
public int getLength(int dimension)
dimension - Which dimensionpublic void setRange(int dimension,
double min,
double max)
dimension - Which dimensionmin - The minimum valuemax - The maximum valuepublic void setMinimum(int dimension,
double value)
dimension - Which dimensionvalue - minimum valuepublic void setMaximum(int dimension,
double value)
dimension - Which dimensionvalue - maximum valuepublic double getMinimum(int dimension)
dimension - Which dimensionpublic double getMaximum(int dimension)
dimension - Which dimensionpublic int getDimensionIndex(int dimension,
double value)
dimension - Which dimension the value belongs tovalue - Floating point value between min and max, inclusive.public int getDimensionIndex(int dimension,
int value)
dimension - Which dimension the value belongs tovalue - Floating point value between min and max, inclusive.public final int getIndex(int i,
int j)
i - index along axis 0j - index along axis 1public final int getIndex(int i,
int j,
int k)
i - index along axis 0j - index along axis 1k - index along axis 2public final int getIndex(int[] coordinate)
coordinate - N-D coordinatepublic double get(int i,
int j)
i - index along axis-0j - index along axis-1public double get(int i,
int j,
int k)
i - index along axis-0j - index along axis-1k - index along axis-2public double get(int[] coordinate)
coordinate - N-D coordinatepublic Histogram_F64 copy()
copy in interface TupleDesc<TupleDesc_F64>copy in class TupleDesc_F64public Histogram_F64 newInstance()