Creates a histogram of the specified size and returns the pointer to the created histogram. If the array ranges is 0, the histogram bin ranges must be specified later via The function cvSetHistBinRanges, though cvCalcHist and cvCalcBackProject may process 8-bit images without setting bin ranges, they assume equally spaced in 0..255 bins

Namespace: Emgu.CV
Assembly: Emgu.CV (in Emgu.CV.dll) Version: (


public static IntPtr cvCreateHist(
	int dims,
	int[] sizes,
	HIST_TYPE type,
	IntPtr[] ranges,
	bool uniform
Visual Basic
Public Shared Function cvCreateHist ( 
	dims As Integer,
	sizes As Integer(),
	type As HIST_TYPE,
	ranges As IntPtr(),
	uniform As Boolean
) As IntPtr
Visual C++
static IntPtr cvCreateHist(
	int dims, 
	[InAttribute] array<int>^ sizes, 
	HIST_TYPE type, 
	[InAttribute] array<IntPtr>^ ranges, 
	bool uniform
static member cvCreateHist : 
        dims : int * 
        sizes : int[] * 
        type : HIST_TYPE * 
        ranges : IntPtr[] * 
        uniform : bool -> IntPtr 


Type: System..::..Int32
Number of histogram dimensions
Type: array<System..::..Int32>[]()[][]
Array of histogram dimension sizes
Type: Emgu.CV.CvEnum..::..HIST_TYPE
Histogram representation format: CV_HIST_ARRAY means that histogram data is represented as an multi-dimensional dense array CvMatND; CV_HIST_SPARSE means that histogram data is represented as a multi-dimensional sparse array CvSparseMat
Type: array<System..::..IntPtr>[]()[][]
Array of ranges for histogram bins. Its meaning depends on the uniform parameter value. The ranges are used for when histogram is calculated or backprojected to determine, which histogram bin corresponds to which value/tuple of values from the input image[s].
Type: System..::..Boolean
Uniformity flag; if true, the histogram has evenly spaced bins and for every 0<=i<cDims ranges[i] is array of two numbers: lower and upper boundaries for the i-th histogram dimension. The whole range [lower,upper] is split then into dims[i] equal parts to determine i-th input tuple value ranges for every histogram bin. And if uniform=false, then i-th element of ranges array contains dims[i]+1 elements: lower0, upper0, lower1, upper1 == lower2, ..., upperdims[i]-1, where lowerj and upperj are lower and upper boundaries of i-th input tuple value for j-th bin, respectively. In either case, the input values that are beyond the specified range for a histogram bin, are not counted by cvCalcHist and filled with 0 by cvCalcBackProject

Return Value

Type: IntPtr
A pointer to the histogram

See Also