\ifCPy
-\ifC
-\cvfunc{CvHistogram}\label{CvHistogram}
+\cvclass{CvHistogram}\label{CvHistogram}
Multi-dimensional histogram.
+\ifC
\begin{lstlisting}
typedef struct 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.
\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 ))
((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 % }