]> rtime.felk.cvut.cz Git - opencv.git/commitdiff
improved cv::integral & cvIntegral documentation, fixed formulas (thanks to zeppe)
authorvp153 <vp153@73c94f0f-984f-4a5f-82bc-2d8db8d8ee08>
Wed, 31 Mar 2010 19:36:40 +0000 (19:36 +0000)
committervp153 <vp153@73c94f0f-984f-4a5f-82bc-2d8db8d8ee08>
Wed, 31 Mar 2010 19:36:40 +0000 (19:36 +0000)
git-svn-id: https://code.ros.org/svn/opencv/trunk@2964 73c94f0f-984f-4a5f-82bc-2d8db8d8ee08

opencv/doc/cv_image_transform.tex
opencv/doc/pics/integral.png [new file with mode: 0644]

index 3e0da75a5b8c534531f00a802013e250d6b31417..62c1fb5e6d75819eb6096fa51ff23ced0ced9b9a 100644 (file)
@@ -519,7 +519,7 @@ The function calculates one or more integral images for the source image as foll
 \]
 
 \[
-\texttt{tiltedSum}(X,Y) = \sum_{y<Y,abs(x-X)<y} \texttt{image}(x,y)
+\texttt{tiltedSum}(X,Y) = \sum_{y<Y,abs(x-X+1)\leq Y-y-1} \texttt{image}(x,y)
 \]
 
 Using these integral images, one may calculate sum, mean and standard deviation over a specific up-right or rotated rectangular region of the image in a constant time, for example:
@@ -1119,7 +1119,7 @@ The functions \texttt{integral} calculate one or more integral images for the so
 \]
 
 \[
-\texttt{tilted}(X,Y) = \sum_{y<Y,abs(x-X)<y} \texttt{image}(x,y)
+\texttt{tilted}(X,Y) = \sum_{y<Y,abs(x-X+1)\leq Y-y-1} \texttt{image}(x,y)
 \]
 
 Using these integral images, one may calculate sum, mean and standard deviation over a specific up-right or rotated rectangular region of the image in a constant time, for example:
@@ -1130,6 +1130,9 @@ Using these integral images, one may calculate sum, mean and standard deviation
 
 It makes possible to do a fast blurring or fast block correlation with variable window size, for example. In the case of multi-channel images, sums for each channel are accumulated independently.
 
+As a practical example, the next figure shows the calculation of the integral of a straight rectangle \texttt{Rect(3,3,3,2)} and of a tilted rectangle \texttt{Rect(5,1,2,3)}. The selected pixels in the original \texttt{image} are shown, as well as the relative pixels in the integral images \texttt{sum} and \texttt{tilted}.
+\begin{center}\includegraphics[width=0.8\textwidth]{pics/integral.png}\end{center}
 
 \cvCppFunc{threshold}
 Applies a fixed-level threshold to each array element
diff --git a/opencv/doc/pics/integral.png b/opencv/doc/pics/integral.png
new file mode 100644 (file)
index 0000000..97a69c6
Binary files /dev/null and b/opencv/doc/pics/integral.png differ