## 3 Materials and Methods
### BeePIV
#### 3.3.3 Color Variation
Let \(\mathtt{CLV}_{I}\) and \(\mathtt{CLV}_{u}\) be experimentally observed lower and upper bounds, respectively, for the values of \(\mathtt{CLV}^{V}\). In other words, for any \(V\in C\), \(\mathtt{CLV}_{I}\leq\mathtt{CLV}^{V}\leq\mathtt{CLV}_{u}\). Let \(\theta_{I}\) and \(\theta_{u}\) be the experimentally selected lower and upper bounds, respectively, for \(\mathtt{CLV}\), that hold for all videos in the sample. Then \(\Theta^{V}\) in Equation (15) can be constrained to lie between \(\theta_{I}\) and \(\theta_{u}\), as shown in Equation (16). \[\Theta^{V}=\theta_{I}+(\theta_{u}-\theta_{I})(\mathtt{CLV}^{V}-\mathtt{CLV}_{ I})/(\mathtt{CLV}_{u}-\mathtt{CLV}_{I}) \tag{16}\]  
The frame thresholding operator, \(T_{\Theta^{V}}(S_{t,\Delta})\), is defined in Equation (17), where, for any position \((r,c)\) in \(S^{V}_{t,\Delta}\), \(S^{\Theta^{V}}_{t,\Delta}(r,c)=S^{V}_{t,\Delta}(r,c)\) if \(S^{V}_{t,\Delta}(r,c)\geq\Theta^{V}\) and \(S^{\Theta^{V}}_{t,\Delta}(r,c)=0\), otherwise. The video thresholding operator, \(T^{*}_{\Theta^{V}}(Z)\), applies \(T_{\Theta^{V}}\) to every frame in \(H^{*}(Z)\) and returns a sequence of smoothed tresholded difference frames \(S^{\Theta^{V}}_{t,\Delta}\), as defined in Equation (18), where \(Z=\left(S^{V}_{t,\Delta},\ldots,S^{V}_{t+\Delta}\right)\). \[T_{\Theta^{V}}\left(S_{t,\Delta}\right)=S^{\Theta^{V}}_{t,\Delta}. \tag{17}\]  
\[T^{*}_{\Theta^{V}}\left(Z\right)=\left(T_{\Theta^{V}}\left(S_{t,\Delta}\right),\ldots,T_{\Theta^{V}}\left(S_{t+k,\Delta}\right)\right)=\left(S^{\Theta^{V} }_{t,\Delta},\ldots,S^{\Theta^{V}}_{t+k,\Delta}\right). \tag{18}\]  
In Section 4.2, we give the actual values of \(\theta_{I}\) and \(\theta_{u}\) we found by experimenting with the videos on our testbed dataset. Figure 7 shows the background frame of the video in Figure 2 and the value of \(\Theta^{V}\) computed from \(\mathtt{MXV}^{V}\) for the video. Figure 8 shows the impact  
Figure 6: \(V_{1}\) is a low bee traffic video with 745 frames; \(B^{V_{1}}_{745,744}\) is the background frame of \(V_{1}\); \(MXV^{V_{1}}\) is the maximum color variation frame for \(V_{1}\); \(V_{2}\) is a high bee traffic video with 745 frames; \(B^{V_{2}}_{745,744}\) is the background frame of \(V_{2}\); \(MXV^{V_{2}}\) is maximum color variation frame for \(V_{2}\). of smoothing difference frames with the smoothing operation \(H\) (see Equation (9)) and then thresholding them with \(\Theta^{V}\) computed from \(\texttt{MXV}^{V}\). Figure 8: Frames \(F_{1}^{V},F_{4}^{V},F_{7}^{V},F_{9}^{V}\) in left column are from video \(V\) in Figure 2; frames \(D_{1,3}^{V},D_{4,3}^{V},D_{7,3}^{V},D_{9,3}^{V}\) in middle column are corresponding difference frames computed from frames in left column; frames \(\Theta_{1,3}^{V},\)\(\Theta_{4,3}^{V},\)\(\Theta_{3,3}^{V},\)\(\Theta_{3,3}^{V}\) are computed from corresponding frames in middle column by smoothing them and thresholding their pixel values at \(\Theta^{V}=11.35\). Figure 7: Background frame \(B_{12,11}^{V}\) (**a**) for 12 frames of video \(V\) in Figure 2 and (**b**) corresponding \(MXV^{V}\) for \(V\) that holds values and positions of highest color variations across all 12 frames in \(V\); value of \(CLV^{V}\) computed from \(MXV^{V}\) is 13.59; value of \(\Theta^{V}\) is 11.35; \(\Theta^{V}\) is computed by \(\Gamma\) function in Equation (33) in Section 4.2. The values of \(\Theta^{V}\) are used to threshold smoothed difference frames \(S_{t,\Delta}\) from a video \(V\) and the values of \(d^{V}\), as we explain below, are used to determine which pixels are in close proximity to local maxima and should be eroded. Higher values of \(\Theta^{V}\) indicate the presence of higher bee traffic and, consequently, must be accompanied by smaller values \(d^{V}\) between maxima points, because in higher traffic videos, multiple bees fly in close proximity to each other. On the other hand, lower values of \(\Theta^{V}\) indicate lower traffic and must be accompanied by higher values of \(d^{V}\), because in lower traffic videos bees typically fly farther apart.