## 2 Detection Model
### Foreground Motion Blocks Extraction
#### 2.1.1 Sampling Areas Determination
Finally, it updates \(P_{r}^{\prime}(r_{s})\) by the following rule:

\[P_{r}^{\prime}(r_{s})=\frac{\sum\sum\limits_{i}\sum\limits_{j\in\mathbb{I}_{i} }\delta(x_{j}^{i}\
ot\in\mathbb{I}_{i}^{\prime})\delta(Q(mv_{j}^{i})=r_{s})+n_ {s}^{\prime}}{\sum\limits_{i}\sum\limits_{j\in\mathbb{I}_{i}}\delta(x_{j}^{i} \
ot\in\mathbb{I}_{i}^{\prime})+n_{s}^{\prime}}. \tag{5}\]

where \(\delta(x)\) is the indicator function: \(\delta(x)=x\equiv\texttt{True? }1:0,\mathbb{I}_{i}^{\prime}\) is the previous sampled intercoded block set of the \(i\)th area, \(n_{s}^{\prime}\) stands for the previous number of sampled blocks, and \(Q(mv)\) represents the quantized level of a MV. Please note that the updating rule recalculates \(P_{r}^{\prime}(r_{s})\) by updating the previous and current sampling sets with different sampling blocks. At the first P-frame, all the intercoded blocks in \(\mathbf{X}_{i}\) are added into sampling set \(\mathbb{X}\). Then, the filter algorithm reduces the \"error\" blocks via an updating process to get the correct sampling blocks for global motion detection. #### 2.1.2 Camera Status Detection

The global motion estimation (GME) method handles for these situations specifically: stable, camera panning, camera zoom in/out and others. A status assemble \(\mathcal{H}=\{C_{s},C_{p},C_{zi},C_{zo},C^{\prime}\}\) is defined according to the listed situations. Each camera state and its decision model are demonstrated in details:

Figure 2: An illustration of sampling areas. * **Panning** To determine _Camera Panning_, an intuitive approach is to compare the norm and direction of MVs among different sampling areas. For each area \(\mathbf{X}_{i}\), its average MV value is computed as follows: \[ \begin{cases}\overline{mv_{i}}(x)&=\frac{1}{\|\overline{l}_{i}}\sum\limits_{j \in\overline{l}_{i}}mv_{j}(x)\\ \overline{mv_{i}}(y)&=\frac{1}{\|\overline{l}_{i}}\sum\limits_{j\in\overline{l} _{i}}mv_{j}(y)\end{cases} \] (6) We define MV set \(\mathcal{MV}(\mathbb{X})=\{\overline{mv_{1}},\cdots,\overline{mv_{8}}\}\). For normalization, we have: \[ \begin{cases}\overline{mv_{i}}(x)&=\overline{mv_{i}}(x)/(mv_{max}(x)-mv_{min} (x))\\ \overline{mv_{i}}(y)&=\overline{mv_{i}}(y)/(mv_{max}(y)-mv_{min}(y))\end{cases} \] (7) and their variance without the minimum and maximum values are listed below: \[ \begin{cases}&Var(mv(x))=\frac{1}{N}\sum\limits_{i\in\mathcal{MV}(\mathbb{X} )}(\overline{mv_{i}}(x)-\overline{mv}(x))^{2}\\ &Var(mv(y))=\frac{1}{N}\sum\limits_{i\in\mathcal{MV}(\mathbb{X})}(\overline{mv _{i}}(y)-\overline{mv}(x))^{2}\end{cases} \] (8) Please note that \(\overline{mv}(\cdot)\) denotes the average values of \(\overline{mv_{i}}(\cdot)\), and \(N\) equals to the size of \(\mathcal{MV}(\mathbb{X})\). Meanwhile, the angle components of \(\mathcal{MV}(\mathbb{X})\) are taken into consideration as well. Let \(\theta_{i}\) be the angle component for \(\overline{mv_{i}}(x)\): \[\theta_{i}=\arctan\frac{|\overline{mv_{i}}(x)|}{|\overline{mv_{i}}(y)|},\] (9) and its variance is followed by: \[Var(\theta)=\frac{1}{N}\sum\limits_{i}(\theta_{i}-\bar{\theta})^{2}\;(1\leq i \leq N).\] (10) Then, a score parameter \(S_{cp}\) for judging camera panning is formed as: \[S_{cp}=[1-\frac{1}{2}(Var(mv(x))+Var(mv(y)))]|\ln(1-Var(\theta))+1|^{-1}.\] (11) \(S_{cp}\) is within a range of (0,1) since normalization process is done before calculation, and \(\ln(1-Var(\theta))\) is treated as the penalty function. When \(Var(\theta)\to 1\), \(S_{cp}\simeq 0\) since we attempt to put more weight on the variance of \(\theta\) to decide the camera panning circumstance. * **Zoom-In and Out**: In this status, each sampling area has a different direction of motion vector. An illustration for the zooming model is displayed in Figure 3.

Obviously, the directions of motion vectors for these sampling areas can be regarded as a factor to determine the zooming in and out situation. Also, the norm of motion vectors is relevant with the distance between the anchor point and each center of the character block.