# Smart Building Surveillance System as Shared Sensory System for Localization of AGVs
## 2 Test Benches and Methods  
There are more options of detecting an object in an image as compared to a survey of Parekh [30]. For image processing and tag marker detection we used OpenCV library [31] and methodology described in [32] for detecting an Aruco 3D gridboard, which improves the reliability and accuracy of the detection in comparison with basic 2D tags. The gridboard (Figure 2) represents a coordinate frame and may be placed on a robot.  
The OpenCV Aruco module analyzes an image from a camera and calculates the transformation from a tag to the camera. This transformation is represented by a homogenous transformation matrix, including the position and rotation of the detected coordinate frame. Every unique marker may represent a unique robot or device. When there are more of them placed in the field of view of a camera, the transformation between them is calculated directly, or in reference to the base coordinate frame. The homogenous transformation matrix from a global coordinate frame (base frame B) to the robot frame is calculated by Equation (1). The \(T_{BC}\) is a known transformation from the global coordinate frame to the camera frame. The \(T_{CR}\) is the detected transformation from the camera frame to the robot frame, obtained from image processing. The transformation matrices, in terms of robot kinematics, are described by [PERSON] [33].  
\[T_{BR}=T_{BC}T_{CR} \tag{1}\]  
We assume that the placements of all cameras are known, the transformations between the cameras may be determined by their layout related to a world coordinate frame. With this information, it is possible to track and calculate the positions between tagged objects even if they are in different parts of a building. Number of cameras has an impact on the accuracy of the detection, as it is described in Section 3. Results show, however, that even a single camera provides reliable data on the location of an AGV. To demonstrate the difference between the number of cameras used, we designed a camera system with 3 cameras of the same type, which is shown in Figure 3 schematically and in Figure 4 as captures of simulation. Finally, the same system was deployed in the experiment, which is shown in  
Figure 1: A robot pose determination: **(a)** Nowadays robots inform control systems about their pose; **(b)** Proposed method of determination of any device pose, robots may provide their own pose estimation so two-way detection is performed.  
Figure 2: Aruco 3D gridboard with detected coordinate frame XYZ—red, green, blue, respectively.  
Figure 5. Fields of view of those cameras intersect and are described in Figure 3. Such a system might serve, for example, as a face-recognition every time a human wants to enter a door. If this person is allowed to enter, the door can automatically unlock and open, which may be appreciated in clean rooms, such as biomedical labs, where, for example, samples of dangerous diseases are analyzed. Our methodology utilizes these kinds of cameras for AGVs localization and makes them multipurpose.  
Figure 4: Simulation environment: (**a**) top view; (**b**) red camera view; (**c**) blue camera view; (**d**) yellow camera view. Resolution for every camera was set to 1280 \(\times\) 720 px this time.  
Figure 3: Schematics of cameras placement: (**a**) top view; (**b**) side view.