# Application of Convolutional Neural Networks in Visual Feedback of Movable Camera Mounting Control
## 2 Materials and Methods
### Data Flow of the Proposed System  
The overall system incorporates all components described in previous subsections. The data flow between the components is presented in Figure 6.  
As stated above, the system is divided into two parts: the operator side and the surveillance camera side. On the operator's side, the head orientation on video frames is estimated. Rare video frames from the operator's web camera are preprocessed and passed on to a series of CNN estimators. Both preprocessing and estimation are held on the operator's computer (no need to use GPU computers). The head orientation class, from Table 1, is wirelessly transmitted to the side of the system's CCTV camera. In particular, to maintain fast system performance, the information is sent only if a change is detected in the orientation class, either in the vertical or horizontal direction.  
Communication between parts of the system is wireless to maintain the compactness and portability of the solution. Additionally, the system does not involve any external network source, as it is designed to create its own WiFi Access Point and dedicated server.  
The processing unit (on the surveillance camera side of the system) is responsible for generating the control signal for the servomechanisms. There are two distinct control signals for vertical and horizontal movements of the camera mounting. Several different control strategies were examined on volunteer operators. The one that was the most intuitive and comfortable for the users was chosen.  
Moving the operator's head in each direction generates control signals for vertical and horizontal movement corresponding to that direction. For the users' convenience, it has been proposed to incorporate the head orientation classes in hysteresis to generate control signals. The most distant head orientations (HT, HD, HL, HR) generate control signals of camera mounting. Slight head orientations (ST, SD, SL, SR) are used as hysteresis of the control signal, causing the previous control action to be maintained. Example control signals for a pair, current and previous head orientation class, are gathered in Table 4.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline  & \multicolumn{2}{c}{**Vertical Movement**} & \multicolumn{4}{c}{**Horizontal Movement**} \\ \hline
**Current** & **Previous** & **Control** & **Current** & **Previous** & **Control** \\
**Orient.** & **Orient.** & **Signal** & **Orient.** & **Orient.** & **Signal** \\ \hline SL & C & stop & ST & C & stop \\ \hline SL & HL & move left & ST & HT & move top \\ \hline SR & C & stop & SD & C & stop \\ \hline SR & HR & move right & SD & HD & move bottom \\ \hline \hline \end{tabular}
\end{table}
Table 4: Control signals for example pairs of current and previous head orientation classes.  
Figure 6: Data flow between the basic components of the proposed system; solid lines represent wire connections, whereas dashed lines denote wireless connections.  
The operator can view the video from both cameras; that is, the webcam (with a bounding box) and the CCTV camera. Hysteresis applied to the control action ensured a decrease in operator fatigue. If an operator's task is to keep the position of the surveillance camera fixed for a given time, slight movements of the head are possible without generating any control action.