基于背景建模方法处理视频(常用的函数)

1、将帧叠加到累积器(accumulator)中

C++: void accumulate(InputArray src, InputOutputArray dst, InputArray mask=noArray() )

C: void cvAcc(const CvArr* image, CvArr* sum, const CvArr* mask=NULL )

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 :

\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(函数支持多通道图像。每个通道单独处理)。

2、用来更新移动平均

C++: void accumulateWeighted(InputArray src, InputOutputArray dst, double alpha,InputArray mask=noArray() )

C: void cvRunningAvg(const CvArr* image, CvArr* acc, double alpha, const CvArr* mask=NULL )

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:

\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


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值