Motion Analysis and Object Tracking

cv::accumulate

Comments from the Wiki

void accumulate(const Mat& src, Mat& dst, const Mat& mask=Mat())

Adds image to the accumulator.

Parameters:
  • src – The input image, 1- or 3-channel, 8-bit or 32-bit floating point
  • dst – The accumulator image with the same number of channels as input image, 32-bit or 64-bit floating-point
  • mask – Optional operation mask

The function adds src , or some of its elements, to dst :

\texttt{dst} (x,y)  \leftarrow \texttt{dst} (x,y) +  \texttt{src} (x,y)  \quad \text{if} \quad \texttt{mask} (x,y)  \ne 0

The function supports multi-channel images; each channel is processed independently.

The functions accumulate* can be used, for example, to collect statistic of background of a scene, viewed by a still camera, for the further foreground-background segmentation.

See also: accumulateSquare() , accumulateProduct() , accumulateWeighted()

cv::accumulateSquare

Comments from the Wiki

void accumulateSquare(const Mat& src, Mat& dst, const Mat& mask=Mat())

Adds the square of the source image to the accumulator.

Parameters:
  • src – The input image, 1- or 3-channel, 8-bit or 32-bit floating point
  • dst – The accumulator image with the same number of channels as input image, 32-bit or 64-bit floating-point
  • mask – Optional operation mask

The function adds the input image src or its selected region, raised to power 2, to the accumulator dst :

\texttt{dst} (x,y)  \leftarrow \texttt{dst} (x,y) +  \texttt{src} (x,y)^2  \quad \text{if} \quad \texttt{mask} (x,y)  \ne 0

The function supports multi-channel images; each channel is processed independently.

See also: accumulateSquare() , accumulateProduct() , accumulateWeighted()

cv::accumulateProduct

Comments from the Wiki

void accumulateProduct(const Mat& src1, const Mat& src2, Mat& dst, const Mat& mask=Mat())

Adds the per-element product of two input images to the accumulator.

Parameters:
  • src1 – The first input image, 1- or 3-channel, 8-bit or 32-bit floating point
  • src2 – The second input image of the same type and the same size as src1
  • dst – Accumulator with the same number of channels as input images, 32-bit or 64-bit floating-point
  • mask – Optional operation mask

The function adds the product of 2 images or their selected regions to the accumulator dst :

\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

The function supports multi-channel images; each channel is processed independently.

See also: accumulate() , accumulateSquare() , accumulateWeighted()

cv::accumulateWeighted

Comments from the Wiki

void accumulateWeighted(const Mat& src, Mat& dst, double alpha, const Mat& mask=Mat())

Updates the running average.

Parameters:
  • src – The input image, 1- or 3-channel, 8-bit or 32-bit floating point
  • dst – The accumulator image with the same number of channels as input image, 32-bit or 64-bit floating-point
  • alpha – Weight of the input image
  • mask – Optional operation mask

The function calculates the weighted sum of the input image src and the accumulator dst so that dst becomes a running average of frame sequence:

\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

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.

See also: accumulate() , accumulateSquare() , accumulateProduct()

Table Of Contents

Previous topic

Planar Subdivisions

Next topic

Feature Detection

This Page