From ab6d584ca2af04512f27cc4266fb5d1a27cd50a8 Mon Sep 17 00:00:00 2001 From: jamesb Date: Wed, 24 Mar 2010 18:51:43 +0000 Subject: [PATCH] Document class CvHistogram. Prototype for cvGetHistValue_ git-svn-id: https://code.ros.org/svn/opencv/trunk@2898 73c94f0f-984f-4a5f-82bc-2d8db8d8ee08 --- opencv/doc/cv_histograms.tex | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/opencv/doc/cv_histograms.tex b/opencv/doc/cv_histograms.tex index b5bae9c4..27eb0da4 100644 --- a/opencv/doc/cv_histograms.tex +++ b/opencv/doc/cv_histograms.tex @@ -2,10 +2,10 @@ \ifCPy -\ifC -\cvfunc{CvHistogram}\label{CvHistogram} +\cvclass{CvHistogram}\label{CvHistogram} Multi-dimensional histogram. +\ifC \begin{lstlisting} typedef struct CvHistogram { @@ -19,6 +19,10 @@ CvHistogram; \end{lstlisting} \fi +\ifPy +A CvHistogram is a multi-dimensional histogram, created by function \cross{CreateHist}. It has an attribute \texttt{bins} a \cross{CvMatND} containing the histogram counts. +\fi + \cvCPyFunc{CalcBackProject} Calculates the back projection. @@ -311,6 +315,18 @@ bin ranges, they assume thy are equally spaced in 0 to 255 bins. \cvCPyFunc{GetHistValue*D} Returns a pointer to the histogram bin. +\cvdefC{float cvGetHistValue_1D(hist, idx0) \newline +float cvGetHistValue_2D(hist, idx0, idx1) \newline +float cvGetHistValue_3D(hist, idx0, idx1, idx2) \newline +float cvGetHistValue_nD(hist, idx) \newline +} + +\begin{description} +\cvarg{hist}{Histogram} +\cvarg{idx0, idx1, idx2, idx3}{Indices of the bin} +\cvarg{idx}{Array of indices} +\end{description} + \begin{lstlisting} #define cvGetHistValue_1D( hist, idx0 ) ((float*)(cvPtr1D( (hist)->bins, (idx0), 0 )) @@ -322,12 +338,6 @@ Returns a pointer to the histogram bin. ((float*)(cvPtrND( (hist)->bins, (idx), 0 ))) \end{lstlisting} -\begin{description} -\cvarg{hist}{Histogram} -\cvarg{idx0, idx1, idx2, idx3}{Indices of the bin} -\cvarg{idx}{Array of indices} -\end{description} - The macros \texttt{GetHistValue} return a pointer to the specified bin of the 1D, 2D, 3D or N-D histogram. In the case of a sparse histogram the function creates a new bin and sets it to 0, unless it exists already. \fi % } -- 2.39.2