2011-02-22 21:43:26 +01:00
Motion Analysis and Object Tracking
===================================
2011-04-19 13:41:12 +02:00
.. highlight :: cpp
2011-02-22 21:43:26 +01:00
.. index :: accumulate
2011-02-28 22:26:43 +01:00
accumulate
2011-02-22 21:43:26 +01:00
--------------
2011-06-08 08:55:04 +02:00
.. cpp:function :: void accumulate( InputArray src, InputOutputArray dst, InputArray mask=noArray() )
2011-02-22 21:43:26 +01:00
2011-04-24 23:02:14 +02:00
Adds an image to the accumulator.
2011-02-22 21:43:26 +01:00
2011-04-24 23:02:14 +02:00
:param src: Input image as 1- or 3-channel, 8-bit or 32-bit floating point.
2011-02-22 21:43:26 +01:00
2011-04-24 23:02:14 +02:00
:param dst: Accumulator image with the same number of channels as input image, 32-bit or 64-bit floating-point.
2011-02-22 21:43:26 +01:00
2011-04-24 23:02:14 +02:00
:param mask: Optional operation mask.
2011-02-22 21:43:26 +01:00
2011-04-24 23:02:14 +02:00
The function adds `` src `` or some of its elements to `` dst `` :
2011-02-22 21:43:26 +01:00
.. math ::
2011-02-26 12:05:10 +01:00
\texttt{dst} (x,y) \leftarrow \texttt{dst} (x,y) + \texttt{src} (x,y) \quad \text{if} \quad \texttt{mask} (x,y) \ne 0
2011-02-22 21:43:26 +01:00
2011-04-24 23:02:14 +02:00
The function supports multi-channel images. Each channel is processed independently.
2011-02-22 21:43:26 +01:00
2011-04-24 23:02:14 +02:00
The functions `` accumulate* `` can be used, for example, to collect statistics of a scene background viewed by a still camera and for the further foreground-background segmentation.
2011-02-22 21:43:26 +01:00
2011-04-24 23:02:14 +02:00
See Also:
2011-06-08 00:51:31 +02:00
:cpp:func: `accumulateSquare` ,
:cpp:func: `accumulateProduct` ,
:cpp:func: `accumulateWeighted`
2011-04-30 15:52:10 +02:00
2011-02-22 21:43:26 +01:00
.. index :: accumulateSquare
2011-02-28 22:26:43 +01:00
accumulateSquare
2011-02-22 21:43:26 +01:00
--------------------
2011-06-08 08:55:04 +02:00
.. cpp:function :: void accumulateSquare( InputArray src, InputOutputArray dst, InputArray mask=noArray() )
2011-02-22 21:43:26 +01:00
2011-04-24 23:02:14 +02:00
Adds the square of a source image to the accumulator.
2011-02-22 21:43:26 +01:00
2011-04-24 23:02:14 +02:00
:param src: Input image as 1- or 3-channel, 8-bit or 32-bit floating point.
2011-02-22 21:43:26 +01:00
2011-04-24 23:02:14 +02:00
:param dst: Accumulator image with the same number of channels as input image, 32-bit or 64-bit floating-point.
2011-02-22 21:43:26 +01:00
2011-04-24 23:02:14 +02:00
:param mask: Optional operation mask.
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
The function adds the input image `` src `` or its selected region, raised to power 2, to the accumulator `` dst `` :
2011-02-22 21:43:26 +01:00
.. math ::
2011-02-26 12:05:10 +01:00
\texttt{dst} (x,y) \leftarrow \texttt{dst} (x,y) + \texttt{src} (x,y)^2 \quad \text{if} \quad \texttt{mask} (x,y) \ne 0
2011-02-22 21:43:26 +01:00
2011-04-24 23:02:14 +02:00
The function supports multi-channel images Each channel is processed independently.
See Also:
2011-06-08 00:51:31 +02:00
:cpp:func: `accumulateSquare` ,
:cpp:func: `accumulateProduct` ,
:cpp:func: `accumulateWeighted`
2011-02-22 21:43:26 +01:00
.. index :: accumulateProduct
2011-02-28 22:26:43 +01:00
accumulateProduct
2011-02-22 21:43:26 +01:00
---------------------
2011-06-08 08:55:04 +02:00
.. cpp:function :: void accumulateProduct( InputArray src1, InputArray src2, InputOutputArray dst, InputArray mask=noArray() )
2011-02-22 21:43:26 +01:00
Adds the per-element product of two input images to the accumulator.
2011-04-24 23:02:14 +02:00
:param src1: The first input image, 1- or 3-channel, 8-bit or 32-bit floating point.
2011-02-22 21:43:26 +01:00
2011-04-24 23:02:14 +02:00
:param src2: The second input image of the same type and the same size as ``src1`` .
:param dst: Accumulator with the same number of channels as input images, 32-bit or 64-bit floating-point.
2011-02-22 21:43:26 +01:00
2011-04-24 23:02:14 +02:00
:param mask: Optional operation mask.
2011-02-22 21:43:26 +01:00
2011-02-26 12:05:10 +01:00
The function adds the product of 2 images or their selected regions to the accumulator `` dst `` :
2011-02-22 21:43:26 +01:00
.. math ::
2011-02-26 12:05:10 +01:00
\texttt{dst} (x,y) \leftarrow \texttt{dst} (x,y) + \texttt{src1} (x,y) \cdot \texttt{src2} (x,y) \quad \text{if} \quad \texttt{mask} (x,y) \ne 0
2011-02-22 21:43:26 +01:00
2011-04-24 23:02:14 +02:00
The function supports multi-channel images. Each channel is processed independently.
See Also:
2011-06-08 00:51:31 +02:00
:cpp:func: `accumulate` ,
:cpp:func: `accumulateSquare` ,
:cpp:func: `accumulateWeighted`
2011-02-22 21:43:26 +01:00
.. index :: accumulateWeighted
2011-02-28 22:26:43 +01:00
accumulateWeighted
2011-02-22 21:43:26 +01:00
----------------------
2011-06-08 08:55:04 +02:00
.. cpp:function :: void accumulateWeighted( InputArray src, InputOutputArray dst, double alpha, InputArray mask=noArray() )
2011-02-22 21:43:26 +01:00
2011-04-24 23:02:14 +02:00
Updates a running average.
2011-02-22 21:43:26 +01:00
2011-04-24 23:02:14 +02:00
:param src: Input image as 1- or 3-channel, 8-bit or 32-bit floating point.
2011-02-22 21:43:26 +01:00
2011-04-24 23:02:14 +02:00
:param dst: Accumulator image with the same number of channels as input image, 32-bit or 64-bit floating-point.
2011-02-22 21:43:26 +01:00
2011-04-24 23:02:14 +02:00
:param alpha: Weight of the input image.
2011-02-22 21:43:26 +01:00
2011-04-24 23:02:14 +02:00
:param mask: Optional operation mask.
2011-02-22 21:43:26 +01:00
2011-04-24 23:02:14 +02:00
The function calculates the weighted sum of the input image `` src `` and the accumulator `` dst `` so that `` dst `` becomes a running average of a frame sequence:
2011-02-22 21:43:26 +01:00
.. math ::
2011-02-26 12:05:10 +01:00
\texttt{dst} (x,y) \leftarrow (1- \texttt{alpha} ) \cdot \texttt{dst} (x,y) + \texttt{alpha} \cdot \texttt{src} (x,y) \quad \text{if} \quad \texttt{mask} (x,y) \ne 0
2011-02-22 21:43:26 +01:00
2011-04-24 23:02:14 +02:00
That is, `` alpha `` regulates the update speed (how fast the accumulator "forgets" about earlier images).
The function supports multi-channel images. Each channel is processed independently.
2011-02-22 21:43:26 +01:00
2011-04-24 23:02:14 +02:00
See Also:
2011-06-08 00:51:31 +02:00
:cpp:func: `accumulate` ,
:cpp:func: `accumulateSquare` ,
:cpp:func: `accumulateProduct`