Motion Analysis and Object Tracking

accumulate

Adds an image to the accumulator.

C++: void accumulate(InputArray src, InputOutputArray dst, InputArray mask=noArray() )
Python: cv2.accumulate(src, dst[, mask]) → None
C: void cvAcc(const CvArr* src, CvArr* dst, const CvArr* mask=NULL )
Python: cv.Acc(src, dst, mask=None) → None
Parameters:
  • src – Input image as 1- or 3-channel, 8-bit or 32-bit floating point.
  • dst – 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 :

System Message: WARNING/2 (\texttt{dst} (x,y) \leftarrow \texttt{dst} (x,y) + \texttt{src} (x,y) \quad \text{if} \quad \texttt{mask} (x,y) \ne 0)

latex exited with error: [stderr] [stdout] This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian) entering extended mode (./math.tex LaTeX2e <2009/09/24> Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh yphenation, loaded. (/usr/share/texmf-texlive/tex/latex/base/article.cls Document Class: article 2007/10/19 v1.4h Standard LaTeX document class (/usr/share/texmf-texlive/tex/latex/base/size12.clo)) (/usr/share/texmf-texlive/tex/latex/base/inputenc.sty (/usr/share/texmf-texlive/tex/latex/ucs/utf8x.def)) (/usr/share/texmf-texlive/tex/latex/ucs/ucs.sty (/usr/share/texmf-texlive/tex/latex/ucs/data/uni-global.def)) (/usr/share/texmf-texlive/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?’ option. (/usr/share/texmf-texlive/tex/latex/amsmath/amstext.sty (/usr/share/texmf-texlive/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf-texlive/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf-texlive/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf-texlive/tex/latex/amscls/amsthm.sty) (/usr/share/texmf-texlive/tex/latex/amsfonts/amssymb.sty (/usr/share/texmf-texlive/tex/latex/amsfonts/amsfonts.sty)) (/usr/share/texmf-texlive/tex/latex/tools/bm.sty) (/usr/share/texmf-texlive/tex/latex/euler/euler.sty Package: `euler’ v2.5 <1995/03/05> (FJ and FMi) ) (/usr/share/texmf-texlive/tex/latex/graphics/color.sty (/etc/texmf/tex/latex/config/color.cfg) (/usr/share/texmf-texlive/tex/latex/graphics/dvips.def) (/usr/share/texmf-texlive/tex/latex/graphics/dvipsnam.def)) ! LaTeX Error: File `bbm.sty’ not found. Type X to quit or <RETURN> to proceed, or enter new name. (Default extension: sty) Enter file name: ! Emergency stop. <read *> l.11 ...ackage{amsmath}\usepackage{bbm}\usepackage {colortbl}^^M No pages of output. Transcript written on math.log.

The function supports multi-channel images. Each channel is processed independently.

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.

See also

accumulateSquare(), accumulateProduct(), accumulateWeighted()

accumulateSquare

Adds the square of a source image to the accumulator.

C++: void accumulateSquare(InputArray src, InputOutputArray dst, InputArray mask=noArray() )
Python: cv2.accumulateSquare(src, dst[, mask]) → None
C: void cvSquareAcc(const CvArr* src, CvArr* dst, const CvArr* mask=NULL )
Python: cv.SquareAcc(src, dst, mask=None) → None
Parameters:
  • src – Input image as 1- or 3-channel, 8-bit or 32-bit floating point.
  • dst – 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 a power of 2, to the accumulator dst :

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

latex exited with error: [stderr] [stdout] This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian) entering extended mode (./math.tex LaTeX2e <2009/09/24> Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh yphenation, loaded. (/usr/share/texmf-texlive/tex/latex/base/article.cls Document Class: article 2007/10/19 v1.4h Standard LaTeX document class (/usr/share/texmf-texlive/tex/latex/base/size12.clo)) (/usr/share/texmf-texlive/tex/latex/base/inputenc.sty (/usr/share/texmf-texlive/tex/latex/ucs/utf8x.def)) (/usr/share/texmf-texlive/tex/latex/ucs/ucs.sty (/usr/share/texmf-texlive/tex/latex/ucs/data/uni-global.def)) (/usr/share/texmf-texlive/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?’ option. (/usr/share/texmf-texlive/tex/latex/amsmath/amstext.sty (/usr/share/texmf-texlive/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf-texlive/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf-texlive/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf-texlive/tex/latex/amscls/amsthm.sty) (/usr/share/texmf-texlive/tex/latex/amsfonts/amssymb.sty (/usr/share/texmf-texlive/tex/latex/amsfonts/amsfonts.sty)) (/usr/share/texmf-texlive/tex/latex/tools/bm.sty) (/usr/share/texmf-texlive/tex/latex/euler/euler.sty Package: `euler’ v2.5 <1995/03/05> (FJ and FMi) ) (/usr/share/texmf-texlive/tex/latex/graphics/color.sty (/etc/texmf/tex/latex/config/color.cfg) (/usr/share/texmf-texlive/tex/latex/graphics/dvips.def) (/usr/share/texmf-texlive/tex/latex/graphics/dvipsnam.def)) ! LaTeX Error: File `bbm.sty’ not found. Type X to quit or <RETURN> to proceed, or enter new name. (Default extension: sty) Enter file name: ! Emergency stop. <read *> l.11 ...ackage{amsmath}\usepackage{bbm}\usepackage {colortbl}^^M No pages of output. Transcript written on math.log.

The function supports multi-channel images. Each channel is processed independently.

See also

accumulateSquare(), accumulateProduct(), accumulateWeighted()

accumulateProduct

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

C++: void accumulateProduct(InputArray src1, InputArray src2, InputOutputArray dst, InputArray mask=noArray() )
Python: cv2.accumulateProduct(src1, src2, dst[, mask]) → None
C: void cvMultiplyAcc(const CvArr* src1, const CvArr* src2, CvArr* dst, const CvArr* mask=NULL )
Python: cv.MultiplyAcc(src1, src2, dst, mask=None) → None
Parameters:
  • src1 – First input image, 1- or 3-channel, 8-bit or 32-bit floating point.
  • src2 – 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 two images or their selected regions to the accumulator dst :

System Message: WARNING/2 (\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)

latex exited with error: [stderr] [stdout] This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian) entering extended mode (./math.tex LaTeX2e <2009/09/24> Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh yphenation, loaded. (/usr/share/texmf-texlive/tex/latex/base/article.cls Document Class: article 2007/10/19 v1.4h Standard LaTeX document class (/usr/share/texmf-texlive/tex/latex/base/size12.clo)) (/usr/share/texmf-texlive/tex/latex/base/inputenc.sty (/usr/share/texmf-texlive/tex/latex/ucs/utf8x.def)) (/usr/share/texmf-texlive/tex/latex/ucs/ucs.sty (/usr/share/texmf-texlive/tex/latex/ucs/data/uni-global.def)) (/usr/share/texmf-texlive/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?’ option. (/usr/share/texmf-texlive/tex/latex/amsmath/amstext.sty (/usr/share/texmf-texlive/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf-texlive/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf-texlive/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf-texlive/tex/latex/amscls/amsthm.sty) (/usr/share/texmf-texlive/tex/latex/amsfonts/amssymb.sty (/usr/share/texmf-texlive/tex/latex/amsfonts/amsfonts.sty)) (/usr/share/texmf-texlive/tex/latex/tools/bm.sty) (/usr/share/texmf-texlive/tex/latex/euler/euler.sty Package: `euler’ v2.5 <1995/03/05> (FJ and FMi) ) (/usr/share/texmf-texlive/tex/latex/graphics/color.sty (/etc/texmf/tex/latex/config/color.cfg) (/usr/share/texmf-texlive/tex/latex/graphics/dvips.def) (/usr/share/texmf-texlive/tex/latex/graphics/dvipsnam.def)) ! LaTeX Error: File `bbm.sty’ not found. Type X to quit or <RETURN> to proceed, or enter new name. (Default extension: sty) Enter file name: ! Emergency stop. <read *> l.11 ...ackage{amsmath}\usepackage{bbm}\usepackage {colortbl}^^M No pages of output. Transcript written on math.log.

The function supports multi-channel images. Each channel is processed independently.

See also

accumulate(), accumulateSquare(), accumulateWeighted()

accumulateWeighted

Updates a running average.

C++: void accumulateWeighted(InputArray src, InputOutputArray dst, double alpha, InputArray mask=noArray() )
Python: cv2.accumulateWeighted(src, dst, alpha[, mask]) → None
C: void cvRunningAvg(const CvArr* src, CvArr* dst, double alpha, const CvArr* mask=NULL )
Python: cv.RunningAvg(src, dst, alpha, mask=None) → None
Parameters:
  • src – Input image as 1- or 3-channel, 8-bit or 32-bit floating point.
  • dst – 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 a frame sequence:

System Message: WARNING/2 (\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)

latex exited with error: [stderr] [stdout] This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian) entering extended mode (./math.tex LaTeX2e <2009/09/24> Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh yphenation, loaded. (/usr/share/texmf-texlive/tex/latex/base/article.cls Document Class: article 2007/10/19 v1.4h Standard LaTeX document class (/usr/share/texmf-texlive/tex/latex/base/size12.clo)) (/usr/share/texmf-texlive/tex/latex/base/inputenc.sty (/usr/share/texmf-texlive/tex/latex/ucs/utf8x.def)) (/usr/share/texmf-texlive/tex/latex/ucs/ucs.sty (/usr/share/texmf-texlive/tex/latex/ucs/data/uni-global.def)) (/usr/share/texmf-texlive/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?’ option. (/usr/share/texmf-texlive/tex/latex/amsmath/amstext.sty (/usr/share/texmf-texlive/tex/latex/amsmath/amsgen.sty)) (/usr/share/texmf-texlive/tex/latex/amsmath/amsbsy.sty) (/usr/share/texmf-texlive/tex/latex/amsmath/amsopn.sty)) (/usr/share/texmf-texlive/tex/latex/amscls/amsthm.sty) (/usr/share/texmf-texlive/tex/latex/amsfonts/amssymb.sty (/usr/share/texmf-texlive/tex/latex/amsfonts/amsfonts.sty)) (/usr/share/texmf-texlive/tex/latex/tools/bm.sty) (/usr/share/texmf-texlive/tex/latex/euler/euler.sty Package: `euler’ v2.5 <1995/03/05> (FJ and FMi) ) (/usr/share/texmf-texlive/tex/latex/graphics/color.sty (/etc/texmf/tex/latex/config/color.cfg) (/usr/share/texmf-texlive/tex/latex/graphics/dvips.def) (/usr/share/texmf-texlive/tex/latex/graphics/dvipsnam.def)) ! LaTeX Error: File `bbm.sty’ not found. Type X to quit or <RETURN> to proceed, or enter new name. (Default extension: sty) Enter file name: ! Emergency stop. <read *> l.11 ...ackage{amsmath}\usepackage{bbm}\usepackage {colortbl}^^M No pages of output. Transcript written on math.log.

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 (C API)

Next topic

Feature Detection

This Page