8.4.2.22. histogram
(packages/opencv/histogram.lsh)


dummy function that adds OpenCV C header files in C file

8.4.2.22.0. (cvCalcEMD signature1 size1 signature2 size2 dims dist_type dist_func lower_bound user_param)
(packages/opencv/histogram.lsh)


 /*F///////////////////////////////////////////////////////////////////////////////////////
 //    Name:       cvCalcEMD
 //    Purpose:    Computes Earth mover distance(and/or lower bound of it) for given pair
 //                of signatures. Ground distance can calculated as
 //                L1, L2 or C distance between features' coordinate vectors or
 //                using user-defined distance function.
 //    Context:
 //    Parameters:
 //      signature1  - first signature - array of size1 *(dims + 1) elements
 //      signature2  - second signature - array of size2 *(dims + 1) elements
 //      dims        - number of dimensions in feature space. If 0, then
 //                    signature1 and signature2 are considered as simple 1D histograms,
 //                    else both signatures must look as follows:
 //                   (weight_i0, x0_i0, x1_i0, ..., x(dims-1)_i0,
 //                     weight_i1, x0_i1, x1_i1, ..., x(dims-1)_i1,
 //                     ...
 //                     weight_(size1-1),x0_(size1-1),x1_(size1-1,...,x(dims-1)_(size1-1))
 //
 //                     where weight_ik - weight of ik cluster.
 //                     x0_ik,...,x(dims-1)_ik - coordinates of ik cluster.
 //
 //      dist_type   - CV_DIST_L1, CV_DIST_L2, CV_DIST_C mean one of standard metrics.
 //                   ((CvDisType)-1) means user-defined distance function, which is
 //                    passes two coordinate vectors and user parameter, and which returns
 //                    distance between those feature points.
 //      emd         - pointer to calculated emd distance
 //      lower_bound - pointer to calculated lower bound.
 //                    if 0, this quantity is not calculated(only emd is calculated).
 //                    else if calculated lower bound is greater or equal to the value,
 //                    stored at this pointer, then the true emd is not calculated, but
 //                    is set to that lower_bound.
 //    Returns:
 //    Notes:
 //F*/
 OPENCVAPI  float  cvCalcEMD( const float* signature1, int size1,
                              const float* signature2, int size2,
                              int dims, CvDisType dist_type,
                              CvDistanceFunction dist_func,
                              float* lower_bound,
                              void* user_param );


8.4.2.22.1. (cvCreateHist c_dims dims type ranges uniform)
(packages/opencv/histogram.lsh)


 /*F///////////////////////////////////////////////////////////////////////////////////////
 //    Name:       cvCreateHist
 //    Purpose:    Creates histogram
 //    Context:
 //    Parameters:
 //      c_dims - number of dimension in the histogram
 //      dims   - array, containing number of bins per each dimension
 //      type   - type of histogram. Now, CV_HIST_ARRAY is only supported type.
 //      ranges - array of bin ranges.
 //      uniform - flag; non 0 if histogram bins are evenly spaced.
 //    Returns:
 //      Created histogram.
 //F*/
 OPENCVAPI  CvHistogram*  cvCreateHist( int c_dims, int* dims,
                                     CvHistType type,
                                     float** ranges CV_DEFAULT(0),
                                     int uniform CV_DEFAULT(1));


8.4.2.22.2. (cvSetHistBinRanges hist ranges uniform)
(packages/opencv/histogram.lsh)


 /*F///////////////////////////////////////////////////////////////////////////////////////
 //    Name:       cvSetHistBinRanges
 //    Purpose:    Sets histogram bins' ranges
 //    Context:
 //    Parameters:
 //      ranges - array of bin ranges.
 //      uniform - flag; non 0 if histogram bins are evenly spaced.
 //    Returns:
 //      nothing
 //    Notes:      if uniform parameter is not NULL then thresh[i][0] - minimum value,
 //                thresh[i][1] - maximum value of thresholds for dimension i
 //F*/
 OPENCVAPI void  cvSetHistBinRanges( CvHistogram* hist, float** ranges,
                                  int uniform CV_DEFAULT(1));


8.4.2.22.3. (cvMakeHistHeaderForArray c_dims dims hist data ranges uniform)
(packages/opencv/histogram.lsh)


 /*F///////////////////////////////////////////////////////////////////////////////////////
 //    Name:       cvMakeHistHeaderForArray
 //    Purpose:    Initializes histogram header and sets
 //                its data pointer to given value
 //    Context:
 //    Parameters:
 //      c_dims - number of dimension in the histogram
 //      dims   - array, containing number of bins per each dimension
 //      hist   - pointer to histogram structure. It will have CV_HIST_ARRAY type.
 //      data   - histogram data
 //    Returns:
 //F*/
 OPENCVAPI  void  cvMakeHistHeaderForArray( int  c_dims, int* dims, CvHistogram* hist,
                                            float* data, float** ranges CV_DEFAULT(0),
                                            int uniform CV_DEFAULT(1));


8.4.2.22.4. (cvReleaseHist hist)
(packages/opencv/histogram.lsh)


 /*F///////////////////////////////////////////////////////////////////////////////////////
 //    Name:       cvReleaseHist
 //    Purpose:    Releases histogram header and underlying data
 //    Context:
 //    Parameters:
 //      hist - pointer to released histogram.
 //    Returns:
 //F*/
 OPENCVAPI  void  cvReleaseHist( CvHistogram** hist );


8.4.2.22.5. (cvClearHist hist)
(packages/opencv/histogram.lsh)


 /*F///////////////////////////////////////////////////////////////////////////////////////
 //    Name:       cvClearHist
 //    Purpose:    Clears histogram(sets all bins to zero)
 //    Context:
 //    Parameters:
 //      hist - pointer to cleared histogram.
 //    Returns:
 //F*/
 OPENCVAPI  void  cvClearHist( CvHistogram* hist);


8.4.2.22.6. (cvQueryHistValue_1D hist idx0)
(packages/opencv/histogram.lsh)


 /*F///////////////////////////////////////////////////////////////////////////////////////
 //    Name:       cvQueryHistValue....
 //    Purpose:    Returns value or histogram bin, given its cooridinates
 //    Context:
 //    Parameters:
 //      hist - pointer to histogram.
 //      idx0 - index for the 1st dimension
 //      idx1 - index for the 2nd dimension
 //             ...
 //      idx  - array of coordinates(for multi-dimensonal histogram)
 //    Returns:
 //      Value of histogram bin
 //    Notes:
 //      For non-array histogram function returns 0 if the specified element isn't present
 //F*/
 OPENCVAPI  float  cvQueryHistValue_1D( CvHistogram* hist, int idx0 );


8.4.2.22.7. (cvqueryhistvalue_2d hist idx0 idx1)
(packages/opencv/histogram.lsh)


 OPENCVAPI  float  cvQueryHistValue_2D( CvHistogram* hist, int idx0, int idx1 );


8.4.2.22.8. (cvqueryhistvalue_3d hist idx0 idx1 idx2)
(packages/opencv/histogram.lsh)


 OPENCVAPI  float  cvQueryHistValue_3D( CvHistogram* hist, int idx0, int idx1, int idx2 );


8.4.2.22.9. (cvqueryhistvalue_nd hist idx)
(packages/opencv/histogram.lsh)


 OPENCVAPI  float  cvQueryHistValue_nD( CvHistogram* hist, int* idx );


8.4.2.22.9.0. (cvGetHistValue_1D hist idx0)
(packages/opencv/histogram.lsh)


 /*F///////////////////////////////////////////////////////////////////////////////////////
 //    Name:       cvGetHistValue....
 //    Purpose:    Returns pointer to histogram bin, given its cooridinates
 //    Context:
 //    Parameters:
 //      hist - pointer to histogram.
 //      idx0 - index for the 1st dimension
 //      idx1 - index for the 2nd dimension
 //             ...
 //      idx  - array of coordinates(for multi-dimensonal histogram).
 //             must have hist->c_dims elements.
 //    Returns:
 //      Pointer to histogram bin
 //    Notes:
 //      For non-array histogram function creates a new element if it is not exists.
 //F*/
 OPENCVAPI  float*  cvGetHistValue_1D( CvHistogram* hist, int idx0 );


8.4.2.22.10. (cvgethistvalue_2d hist idx0 idx1)
(packages/opencv/histogram.lsh)


 OPENCVAPI  float*  cvGetHistValue_2D( CvHistogram* hist, int idx0, int idx1 );


8.4.2.22.11. (cvgethistvalue_3d hist idx0 idx1 idx2)
(packages/opencv/histogram.lsh)


 OPENCVAPI  float*  cvGetHistValue_3D( CvHistogram* hist, int idx0, int idx1, int idx2 );


8.4.2.22.12. (cvgethistvalue_nd hist idx)
(packages/opencv/histogram.lsh)


 OPENCVAPI  float*  cvGetHistValue_nD( CvHistogram* hist, int* idx );


8.4.2.22.12.0. (cvGetMinMaxHistValue hist value_min value_max idx_min idx_max)
(packages/opencv/histogram.lsh)


 /*F///////////////////////////////////////////////////////////////////////////////////////
 //    Name:       cvGetMinMaxHistValue
 //    Purpose:    Finds coordinates and numerical values of minimum and maximum
 //                histogram bins
 //    Context:
 //    Parameters:
 //      hist - pointer to histogram.
 //      idx_min - pointer to array of coordinates for minimum.
 //                if not NULL, must have hist->c_dims elements.
 //      value_min - pointer to minimum value of histogram( Can be NULL).
 //      idx_max - pointer to array of coordinates for maximum.
 //                if not NULL, must have hist->c_dims elements.
 //      value_max - pointer to maximum value of histogram( Can be NULL).
 //    Returns:
 //F*/
 OPENCVAPI  void  cvGetMinMaxHistValue( CvHistogram* hist,
                                     float* value_min, float* value_max,
                                     int* idx_min CV_DEFAULT(0), 
                                     int* idx_max CV_DEFAULT(0));


8.4.2.22.12.1. (cvNormalizeHist hist factor)
(packages/opencv/histogram.lsh)


 /*F///////////////////////////////////////////////////////////////////////////////////////
 //    Name:     cvNormalizeHist
 //    Purpose:  Normalizes histogram(such that sum of histogram bins becomes factor)
 //    Context:
 //    Parameters:
 //      hist - pointer to normalized histogram.
 //    Returns:
 //F*/
 OPENCVAPI  void  cvNormalizeHist( CvHistogram* hist, double factor );


8.4.2.22.12.2. (cvThreshHist hist thresh)
(packages/opencv/histogram.lsh)


 /*F///////////////////////////////////////////////////////////////////////////////////////
 //    Name:     cvThreshHist
 //    Purpose:  Clears histogram bins that are below specified level
 //    Context:
 //    Parameters:
 //      hist - pointer to histogram.
 //      thresh - threshold level
 //    Returns:
 //F*/
 OPENCVAPI  void  cvThreshHist( CvHistogram* hist, double thresh );


8.4.2.22.12.3. (cvCompareHist hist1 hist2 method)
(packages/opencv/histogram.lsh)


 /*F///////////////////////////////////////////////////////////////////////////////////////
 //    Name:     cvCompareHist
 //    Purpose:  compares two histograms using specified method
 //    Context:
 //    Parameters:
 //      hist1 - first compared histogram.
 //      hist2 - second compared histogram.
 //      method - comparison method
 //    Returns:
 //      value, that characterizes similarity(or difference) of two histograms
 //    Notes:
 //F*/
 OPENCVAPI  double  cvCompareHist( CvHistogram*  hist1,
                                CvHistogram*  hist2,
                                CvCompareMethod method);


8.4.2.22.12.4. (cvCopyHist src dst)
(packages/opencv/histogram.lsh)


 /*F///////////////////////////////////////////////////////////////////////////////////////
 //    Name:       cvCopyHist
 //    Purpose:    Copying one histogram to another
 //    Context:
 //    Parameters:
 //      src - source histogram
 //      dst - destination histogram
 //    Returns:
 //    Notes:      if second parameter is pointer to NULL(*dst == 0) then second
 //                histogram will be created.
 //                both histograms(if second histogram present) must be equal
 //                types & sizes
 //F*/
 OPENCVAPI void  cvCopyHist( CvHistogram* src, CvHistogram** dst );


8.4.2.22.12.5. (cvCalcBayesianProb src number dst)
(packages/opencv/histogram.lsh)


 /*F///////////////////////////////////////////////////////////////////////////////////////
 //    Name:       cvCalcBayesianProb
 //    Purpose:    Calculates bayesian probabilistic histograms
 //    Context:
 //    Parameters:
 //      src - array of source histograms
 //      number - number of source/destination histograms 
 //      dst - array of destination histograms
 //    Returns:
 //    Notes:
 //F*/
 OPENCVAPI void  cvCalcBayesianProb( CvHistogram** src, int number,
                                   CvHistogram** dst);


8.4.2.22.12.6. (cvCalcHist img hist donotclear mask)
(packages/opencv/histogram.lsh)


 /*F///////////////////////////////////////////////////////////////////////////////////////
 //    Name:       cvCalcHist
 //    Purpose:    Calculating histogram from array of one-channel images
 //    Context:
 //    Parameters:
 //      img - array of single-channel images
 //      hist - histogram to be calculated. It must have as many dimensions as number of
 //             images in <img> array.
 //      doNotClear - if not 0, the histogram is not cleared before calculations.
 //      mask - optional mask that determines pixels that participate in histogram
 //             accumulation.
 //    Returns:
 //    Notes:      if doNotClear parameter is NULL then histogram clearing before
 //                calculating(all values sets to NULL)
 //F*/
 OPENCVAPI  void  cvCalcHist( IplImage** img, CvHistogram* hist,
                           int doNotClear CV_DEFAULT(0),
                           IplImage* mask CV_DEFAULT(0) );


8.4.2.22.12.7. (cvCalcBackProject img dst hist)
(packages/opencv/histogram.lsh)


 /*F///////////////////////////////////////////////////////////////////////////////////////
 //    Name:       cvCalcBackProject
 //    Purpose:    Calculates back project of histogram
 //      img - array of input single-channel images
 //      dst - destination single-channel image
 //      hist - histogram, used for calculating back project. It must have as many
 //             dimensions as the number of images in the <img> array.
 //    Context:
 //    Parameters:
 //    Returns:
 //    Notes:
 //F*/
 OPENCVAPI  void  cvCalcBackProject( IplImage** img, IplImage* dst,
                                  CvHistogram* hist );


8.4.2.22.12.8. (cvCalcBackProjectPatch img dst range hist method normfactor)
(packages/opencv/histogram.lsh)


 /*F///////////////////////////////////////////////////////////////////////////////////////
 //    Name:       cvCalcBackProjectPatch
 //    Purpose:    Calculating back project patch of histogram
 //    Context:
 //    Parameters:
 //    Returns:
 //    Notes:
 //F*/
 OPENCVAPI  void  cvCalcBackProjectPatch( IplImage** img, IplImage* dst, CvSize range,
                                       CvHistogram* hist, CvCompareMethod method,
                                       double normFactor );