## 3 The CFSA Tracker
### Scale Estimation  
In the detection step, an ideal scale estimation approach should be robust to scale changes while being computationally efficient [42]. In order to deal with the scale variations, we proposed to use the water flow driven MBD algorithm [27] to detect object on an image patch centered at the estimated position of the target object. Then the scale is estimated using the detected object and the initial given ground truth. The main ideal of the water flow driven MBD algorithm is inspired by the natural phenomena of the water flow. Given an image, we assume seed pixels \(S\) (such as image boundary) as source of water, the water will flow from source pixels to other pixels with different flow cost. The flow cost is measured by MBD [43], which is widely used distance transform to measure pixel or region's connectivity to the image boundary. For one \(N\) channels image \(I\), the MBD of pixel \(i\) can be calculated as:\[D_{MBD}(i)=\min_{\pi\in\prod_{S,t}}\left[\frac{1}{N}\sum\limits_{ch=1}^{N}\left( \max\limits_{j\in[0,k]}I_{ch}(\pi(k))-\min\limits_{j\in[0,k]}I_{ch}(\pi(k)) \right)\right] \tag{8}\]  
where a path \(\pi=\{\pi(0),\ \pi(1),\ \ldots,\ \pi(k)\}\) on image \(I\) is a sequence of pixels where consecutive pairs of pixels are adjacent, \(\prod_{S,t}\) denotes the set of all paths connecting pixel \(t\) and seed pixels \(S\) and \(I_{ch}\) is one channel image. For a color image, the number of image channels \(N=3\) while \(N\) is set to 1 for a grey image. The process of detecting object and identifying the bounding box with the water flow driven MBD algorithm is as follows. In the initial, source pixels are flooded while all other pixels are droughty. The initial flooded pixels \(i\) are as following:  
\[\left\{ \begin{array}{l}U_{ch}(i)=I_{ch}(i)\\ L_{ch}(i)=I_{ch}(i)\\ D(i)=0\end{array} \right. \tag{9}\]  
where \(U\) and \(L\) denotes two auxiliary maps that are used to keep track of the maximum and the minimum values on current path for each pixel. Then, the water will firstly flow to the droughty pixel which is neighboring to flooded pixels with the lowest cost, and then this droughty pixel becomes a flooded pixel. For each neighbor droughty pixel \(d\) of source pixel \(i\), the flow from \(i\) to \(d\) can be estimated as:  
\[\left\{ \begin{array}{l}U_{ch}(d)=\max(U_{ch}(i),\ I_{ch}(d))\\ L_{ch}(d)=\min\limits_{i}(L_{ch}(i),\ I_{ch}(d))\\ D(d)=\frac{1}{N}\sum\limits_{ch=1}^{N}(U_{ch}(d)-L_{ch}(d))\end{array} \right. \tag{10}\]  
Furthermore, the flow process continues until all pixels are flooded and the flooded image can be defined as:  
\[flo(i)= \begin{cases}I(i)&if\ i\in seed\ pixels\\ D(i)&otherwise\end{cases}  \tag{11}\]  
As the target object always locates as the center of the image, all pixels of the image are emphasized according to its position. Moreover, post-processing including global smoothing filter, enhancement, and morphological smoothing are used to identify the object. The color image with the detected object is converted into grey image \(I_{g}\) and a binary image \(I_{b}\) is obtained with intensity using:  
\[I_{b}(i)= \begin{cases}1&if\ I_{g}(i)\geq iv\\ 0&otherwise\end{cases}  \tag{12}\]  
where \(iv\) denotes the intensity value of a pixel and is set to 150. Finally the bounding box b\({}^{\text{d}}\) is obtained, which compactly contains all pixels that the value of each pixel is 1 in the binary image \(I_{b}\). The water flow driven MBD algorithm only visit the image once, the post-processing and identifying bounding box of the detected object are all time-saving, the proposed method only needs about 6 ms to estimate the location and scale of an object in color image with the maximum dimension of 300 pixels. Due to the runtime and the interference in the image will increase with the increase of the dimension of the image, and the scale of the target object changes small in two consecutive frames, the scaling factor of the input image for scale estimation is set to 2 in this paper.