boofcv.alg.feature.color
Class Histogram_F64
- java.lang.Object
-
- boofcv.struct.feature.TupleDesc_F64
-
- boofcv.alg.feature.color.Histogram_F64
-
- All Implemented Interfaces:
- TupleDesc<TupleDesc_F64>
public class Histogram_F64 extends TupleDesc_F64
A multi dimensional histogram. This is an extension of
TupleDesc_F64to 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);
-
-
Field Summary
-
Fields inherited from class boofcv.struct.feature.TupleDesc_F64
value
-
-
Constructor Summary
Constructors Constructor and Description Histogram_F64(int... lengths)Creates a multi dimensional histogram where each dimension has the specified lengths.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description Histogram_F64copy()Creates an exact copy of "this" histogramdoubleget(int[] coordinate)Returns the value at the N-D coordinatedoubleget(int i, int j)Returns the value at the 2D coordinatedoubleget(int i, int j, int k)Returns the value at the 3D coordinateintgetDimensionIndex(int dimension, double value)Given a value it returns the corresponding bin index in this histogram for the specified dimension.intgetDimensionIndex(int dimension, int value)Given a value it returns the corresponding bin index in this histogram for integer values.intgetDimensions()The number of dimensions in the histogram.intgetIndex(int[] coordinate)For a N-Dimensional histogram it will return the array index for the N-D coordinateintgetIndex(int i, int j)For a 2D histogram it returns the array index for coordinate (i,j)intgetIndex(int i, int j, int k)For a 3D histogram it returns the array index for coordinate (i,j,k)intgetLength(int dimension)Number of elements/bins along the specified dimensiondoublegetMaximum(int dimension)Returns the maximum allowed value in a dimensiondoublegetMinimum(int dimension)Returns the minimum allowed value in a dimensionbooleanisRangeSet()Returns true if the min and max value for each dimension has been setHistogram_F64newInstance()Creates a new instance of this histogram which has the same "shape" and min / max values.voidsetMaximum(int dimension, double value)Sets the maximum allowed value in a particular dimensionvoidsetMinimum(int dimension, double value)Sets the minimum allowed value in a particular dimensionvoidsetRange(int dimension, double min, double max)Specifies the minimum and maximum values for a specific dimension
-
-
-
Constructor Detail
-
Histogram_F64
public Histogram_F64(int... lengths)
Creates a multi dimensional histogram where each dimension has the specified lengths.- Parameters:
lengths- Number of elements in each dimension
-
-
Method Detail
-
isRangeSet
public boolean isRangeSet()
Returns true if the min and max value for each dimension has been set- Returns:
- true if range has been set
-
getDimensions
public int getDimensions()
The number of dimensions in the histogram.- Returns:
- dimensions
-
getLength
public int getLength(int dimension)
Number of elements/bins along the specified dimension- Parameters:
dimension- Which dimension- Returns:
- Number of bins
-
setRange
public void setRange(int dimension, double min, double max)Specifies the minimum and maximum values for a specific dimension- Parameters:
dimension- Which dimensionmin- The minimum valuemax- The maximum value
-
setMinimum
public void setMinimum(int dimension, double value)Sets the minimum allowed value in a particular dimension- Parameters:
dimension- Which dimensionvalue- minimum value
-
setMaximum
public void setMaximum(int dimension, double value)Sets the maximum allowed value in a particular dimension- Parameters:
dimension- Which dimensionvalue- maximum value
-
getMinimum
public double getMinimum(int dimension)
Returns the minimum allowed value in a dimension- Parameters:
dimension- Which dimension- Returns:
- minimum value
-
getMaximum
public double getMaximum(int dimension)
Returns the maximum allowed value in a dimension- Parameters:
dimension- Which dimension- Returns:
- maximum value
-
getDimensionIndex
public int getDimensionIndex(int dimension, double value)Given a value it returns the corresponding bin index in this histogram for the specified dimension. This is for floating point values.- Parameters:
dimension- Which dimension the value belongs tovalue- Floating point value between min and max, inclusive.- Returns:
- The index/bin
-
getDimensionIndex
public int getDimensionIndex(int dimension, int value)Given a value it returns the corresponding bin index in this histogram for integer values. The discretion is taken in account and 1 is added to the range.- Parameters:
dimension- Which dimension the value belongs tovalue- Floating point value between min and max, inclusive.- Returns:
- The index/bin
-
getIndex
public final int getIndex(int i, int j)For a 2D histogram it returns the array index for coordinate (i,j)- Parameters:
i- index along axis 0j- index along axis 1- Returns:
- array index
-
getIndex
public final int getIndex(int i, int j, int k)For a 3D histogram it returns the array index for coordinate (i,j,k)- Parameters:
i- index along axis 0j- index along axis 1k- index along axis 2- Returns:
- array index
-
getIndex
public final int getIndex(int[] coordinate)
For a N-Dimensional histogram it will return the array index for the N-D coordinate- Parameters:
coordinate- N-D coordinate- Returns:
- index
-
get
public double get(int i, int j)Returns the value at the 2D coordinate- Parameters:
i- index along axis-0j- index along axis-1- Returns:
- histogram value
-
get
public double get(int i, int j, int k)Returns the value at the 3D coordinate- Parameters:
i- index along axis-0j- index along axis-1k- index along axis-2- Returns:
- histogram value
-
get
public double get(int[] coordinate)
Returns the value at the N-D coordinate- Parameters:
coordinate- N-D coordinate- Returns:
- histogram value
-
copy
public Histogram_F64 copy()
Creates an exact copy of "this" histogram- Specified by:
copyin interfaceTupleDesc<TupleDesc_F64>- Overrides:
copyin classTupleDesc_F64- Returns:
- Copy
-
newInstance
public Histogram_F64 newInstance()
Creates a new instance of this histogram which has the same "shape" and min / max values.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG