## 4 Experiments
### Interrogation Window Size and Overlap in PIV  
To estimate the optimal values for the interrogation window size (i.e., the size of \(IA_{1}\) and \(IA_{2}\)) and window overlap (see Equation (26)), we ran a grid search on the videos in the testbed set. Since we use the FFT version of the correlation equation, \(IA_{1}\) and \(IA_{2}\) are of the same size in BeePIV.  
For the grid search, we tested all \(D\times D\) interrogation windows, where \(8\leq D\leq 19\), in increments of 1. We chose values for the grid search, because the mean size of an individual honey bee is \(\approx\)10 pixels. Thus, the dimension of the smallest \(8\times 8\) interrogation window is two pixels below the mean bee's size and the dimension of the largest \(19\times 19\) interrogation window is almost twice the mean bee's size.  
The control flow of the grid search was as follows. For each video \(V\) in the testbed set, for each window size in the interval \([8,19]\), for each overlap from 1% to 70%, we used the BeePIV Equation (see Equation (31)) to compute the counts of incoming, outgoing, and lateral displacement vectors (i.e., \(I_{w}^{\mathrm{s}},O_{w}^{\mathrm{s}},L_{w}^{\mathrm{s}}\), respectively). For each video, the overall omnidirectional count was computed as \(I_{w}^{\mathrm{s}}+O_{w}^{\mathrm{s}}+L_{w}^{\mathrm{s}}\) and was compared with the human ground truth count for the video in the corresponding CSV file. The absolute differencebetween the BeePIV count and human count (i.e., the absolute error) was recorded. Table 1 gives the interrogation window size and overlap for each video that resulted in the smallest absolute error for that video.  
On the basis of the grid search, we designed two functions \(\beta_{1}(\Theta^{V}):\mathbb{R}\rightarrow\mathbb{R}\times\mathbb{R}\), defined in Equation (34), and \(\beta_{2}(\Theta^{V}):\mathbb{R}\rightarrow\mathbb{R}\times\mathbb{R}\), defined in Equation (35), to map color variation (i.e., \(\Theta^{V}\)) to 2-tuples of interrogation window sizes and overlaps.  
The function \(\beta_{1}\), to which we henceforth refer as the DPIV_A method, splits the observed \(\Theta^{V}\) values into three intervals and outputs the mean window size and overlap of all window sizes and overlaps tried during the grid search that resulted in BeePIV achieving the smallest absolute error on all testbed videos whose \(\Theta^{V}\) values fall in the corresponding range (e.g., \(0\leq\Theta^{V}<18\)).  
\[\beta_{1}(\Theta^{V})=\begin{cases}(17,12)&\text{if }0\leq\Theta^{V}<18;\\ (17,18)&\text{if }18\leq\Theta^{V}<36;\\ (17,30)&\text{if }\Theta^{V}\geq 36.\end{cases} \tag{34}\]  
The function \(\beta_{2}\), to which we henceforth refer as the DPIV_B method, splits the observed \(\Theta^{V}\) values into five intervals and outputs the mean window size and overlap of all window sizes and overlaps tried during the grid search that resulted in BeePIV achieving the smallest absolute error on all testbed videos whose \(\Theta^{V}\) values fall in the  
\begin{table}
\begin{tabular}{c c c c c c} \hline
**Video \#** & **Window** & **Overlap (\%)** & **BeePIV** & **Human Count** & **Error** \\ \hline  
\end{tabular}
\end{table}
Table 1: Interrogation window size and overlap for each video in testbed that resulted in smallest absolute error between BeePIV and human counts for that video; values in BeePIV column are \(I_{w}^{*}(Z)+O_{w}^{*}(Z)+L_{w}^{*}(Z)\), where \(Z\) is motion frame sequence of corresponding video \(V\); values in Err column are absolute differences between corresponding values in Human Count and BeePIV columns.  
corresponding range (e.g., \(13\leq\Theta^{V}<16\)). Both methods reflect the general strategy of increasing the size of the interrogation window or the amount of overlap as \(\Theta^{V}\) increases.  
\[\beta_{2}(\Theta^{V})=\begin{cases}(15,20)&\text{if }0\leq\Theta^{V}<13;\\ (21,22)&\text{if }13\leq\Theta^{V}<16;\\ (25,28)&\text{if }16\leq\Theta^{V}<19;\\ (26,31)&\text{if }19\leq\Theta^{V}<21;\\ (27,50)&\text{if }\Theta^{V}\geq 21.\end{cases} \tag{35}\]