Class DenseHistogram
A Uniform Multi-dimensional Dense Histogram
public class DenseHistogram : Mat, IEquatable<Mat>, IInputOutputArray, IInputArrayOfArrays, IOutputArrayOfArrays, IOutputArray, IInputArray, IDisposable, ISerializable
- Inheritance
-
DenseHistogram
- Implements
- Inherited Members
- Extension Methods
Constructors
DenseHistogram(int, RangeF)
Creates a uniform 1-D histogram of the specified size
public DenseHistogram(int binSize, RangeF range)
Parameters
binSize
intThe number of bins in this 1-D histogram.
range
RangeFThe lower (inclusive) and upper (exclusive) boundary of the bin
DenseHistogram(int[], RangeF[])
Creates a uniform multi-dimension histogram of the specified size
public DenseHistogram(int[] binSizes, RangeF[] ranges)
Parameters
binSizes
int[]The length of this array is the dimension of the histogram. The values of the array contains the number of bins in each dimension. The total number of bins eaquals the multiplication of all numbers in the array
ranges
RangeF[]The lower (inclusive) and upper (exclusive) boundaries of the bins
Properties
BinDimension
Get the size of the bin dimensions
public int[] BinDimension { get; }
Property Value
- int[]
Ranges
Get the ranges of this histogram
public RangeF[] Ranges { get; }
Property Value
- RangeF[]
Methods
BackProject<TDepth>(Image<Gray, TDepth>[])
Backproject the histogram into a gray scale image
public Image<Gray, TDepth> BackProject<TDepth>(Image<Gray, TDepth>[] srcs) where TDepth : new()
Parameters
Returns
Type Parameters
TDepth
The type of depth of the image
BackProject<TDepth>(Matrix<TDepth>[])
Backproject the histogram into a matrix
public Matrix<TDepth> BackProject<TDepth>(Matrix<TDepth>[] srcs) where TDepth : new()
Parameters
srcs
Matrix<TDepth>[]Source matrices, all are of the same size and type
Returns
- Matrix<TDepth>
Destination back projection matrix of the sametype as the source matrices
Type Parameters
TDepth
The type of depth of the matrix
Calculate<TDepth>(Image<Gray, TDepth>[], bool, Image<Gray, byte>)
Project the images to the histogram bins
public void Calculate<TDepth>(Image<Gray, TDepth>[] imgs, bool accumulate, Image<Gray, byte> mask) where TDepth : new()
Parameters
imgs
Image<Gray, TDepth>[]images to project
accumulate
boolIf it is true, the histogram is not cleared in the beginning. This feature allows user to compute a single histogram from several images, or to update the histogram online.
mask
Image<Gray, byte>Can be null if not needed. The operation mask, determines what pixels of the source images are counted
Type Parameters
TDepth
The type of depth of the image
Calculate<TDepth>(Matrix<TDepth>[], bool, Matrix<byte>)
Project the matrices to the histogram bins
public void Calculate<TDepth>(Matrix<TDepth>[] matrices, bool accumulate, Matrix<byte> mask) where TDepth : new()
Parameters
matrices
Matrix<TDepth>[]Matrices to project
accumulate
boolIf it is true, the histogram is not cleared in the beginning. This feature allows user to compute a single histogram from several images, or to update the histogram online.
mask
Matrix<byte>Can be null if not needed. The operation mask, determines what pixels of the source images are counted
Type Parameters
TDepth
The type of depth of the image
Clear()
Clear this histogram
public void Clear()
GetBinValues()
Gets the bin values.
public float[] GetBinValues()
Returns
- float[]
The bin values