## 4 Methodologies and Results Analysis
### Final Phase  
After the completion of the secondary phase, if the system has not been able to capture the facial features of the trespasser, it will execute the final phase. In this phase, if a detected intruder is a human, it will track the motion of the detected human object and notify the house owner about the presence of a stranger in the house by sending the latest captured image and a compressed video (at 45 fps). Furthermore, the system is intelligent enough to capture the intruder based on the variations of the face; a dynamic threshold has been set to capture the brightest part of the face even if an intruder has fully covered his/her face with some type of transparent, solid, plastic, and/or leather material. The system can also detect intruders at night or in poor light conditions. This requires an ordinary analog camera, which makes the system very economical. To detect the intruder's motion, reference images (\(a\), \(b\)) and the captured video frames were obtained from the captured video sequence. A binary motion detection mask M (\(a\), \(b\)) can be calculated as follows  
\[M(a,b)=\left\{ \begin{array}{c}1,if|I_{t}(a,b)-B(a,b)|>T\\ 0,if|I_{t}(a,b)-B(a,b)|\leq T\end{array} \right. \tag{6}\]  
Here, \(T\) is the predefined threshold which captures the moving objects in a captured video frame. If the outright contrast between a reference picture and an approaching video outline does not surpass \(T\), the pixels of the identification cover are named \"0,\" which implies that it contains background. Generally, dynamic pixels are named \"1\", which is assigned for moving objects. To capture complex scenes, a simple statistical difference method was applied, using the mean value and the standard deviation. This method computes the mean value for each and every pixel of the captured video frames. The pixel value of each pixel \(\mu_{xy}\) has been calculated from a collection of all the previously captured frames in the given time interval (\(t_{0}\), \(t_{k-1}\)). For every computed pixel, the threshold is given by a standard deviation \(\sigma_{ab}\) as follows. \[\mu_{ab}=\frac{1}{k}\overset{k-1}{\underset{k=0}{\sum}}I_{k}(a,b)\]  
\[\sigma_{ab}=\left(\frac{1}{k}\overset{k-1}{\underset{k=0}{\sum}}\Big{\{}\left( I_{k}(a,b)-\mu_{ab}\right)^{2}\Big{\}}^{1/2}\right) \tag{7}\]  
In order to achieve object motion detection, the difference between the background of the image and captured video frame was calculated. Here, the predefined parameter is \(\lambda\). If the exact difference between the captured video frame and image background is greater than \(\lambda\sigma_{xy}\) or less than \(\lambda\sigma_{ab}\), then the background pixel can be calculated as follows. \[M(a,b)=\left\{ \begin{array}{c}1,if|I_{t}(a,b)-B(a,b)|>\lambda\sigma_{xy}\\ 0,if|I_{t}(a,b)-B(a,b)|\leq\lambda\sigma_{xy}\end{array} \right. \tag{8}\]  
Figure 14 depicts various classifier images where an intruder has completely covered his/her face. It also shows classifier samples which have been captured at night with an ordinary analog camera. It is clear from the samples in Figure 14 that it is not necessary for an intruder to look directly at the camera in order to be captured. Once an intruder is in the projected area of the system it will capture the intruder even if he/she is not directly looking at the camera. As shown in Figure 15a, rigorous research experiments were conducted with approximately 10,000 face samples in scenarios where a detected intruder had fully covered his/her face with some type of transparent, solid, paper, plastic, or leather material. The above figure depicts the face detection rate analysis for 10,000 human samples with these variations. Faces were detected with accuracy of approximately 78% as shown in Figure 15a. Figure 15b represents face detection rate analysis of 78% accuracy cases in the form of the heat map representation. Figure 14: Final Stage Classifier Samples where an intruder has a fully covered face with some type of transparent, solid, plastic, leather material and detection in the dark night.