## 2 Materials and Methods
### Calibration of Device  
Camera calibration is necessary to mathematically correct for variations due to camera design and lens effects. Camera calibration is critical for real-world measurements using in-camera measurements, and the relationship between image points, distance lengths, and projections is important. Calibration results in defining the geometric properties of the camera and the defocus model from the lenses. The calibration process entails the estimation of both intrinsic and extrinsic camera parameters. These parameters are fundamental to the camera model, as they facilitate the exploitation of relationships, transformations, and projections between the camera coordinate system, 2D image (pixel) coordinates, and the real-world coordinate system [23]. The internal parameters of the camera refer to its internal characteristics and should remain unchanged during calibration and scanning as part of its use in digitization. Modifications to these parameters can be effected by altering the camera settings, such as adjusting the focus or switching lenses. The internal parameters of the camera include focal length, optical center, image distortion, and pixel size. Focal length is defined as the distance between the optical sensor and the optical center. The optical center, alternatively designated as the principal point, is the point of intersection of the optical axis and the image plane, thereby defining the origin of the image co-ordination system. Distortion is caused by curvature of the image by the lens or by misalignment of the sensor. Tangential distortion is characterized by the rounding of straight lines, while radial distortion is caused by misalignment of the sensor and lens. In the context of camera calibration, the internal parameters of the camera are represented by the camera matrix (mtx) and the distortion coefficients (dist) [24]. The external parameters of the camera delineate its position and orientation relative to the real-world coordinate system. These parameters are subject to alteration during the calibration or digitization processes, should there be a change in the camera's position or orientation. The external parameters are defined by the rotation matrix (R) and the translation vectors (T). The rotation matrix, denoted by R, represents the orientation of the camera, defined by the rotation angles of the axes of the camera coordinate system relative to the world coordinate system. The translation vectors delineate the position of the optical center of the camera relative to the world coordinate system. The calibration of both the  
Figure 4: The CameraWebServer graphical user interface (GUI) when utilized with a pair of ESP32-CAM devices. internal and external parameters of a single camera in a scene can be achieved through the utilization of the OpenCV libraries and the cv2.calibrateCamera function [25]. A variety of objects can be utilized as calibration objects, with their visual elements being suitably registered. Currently, checkerboard patterns with alternating white and black squares or dot patterns with well-defined pattern dimensions are employed in camera calibration. These patterns offer distinct advantages over three-dimensional calibration objects, primarily due to their high contrast properties. Additionally, their printability on standard office paper facilitates their use in practical applications. Given the known dimensions of the checkerboard pattern, its position and rotation angle relative to the scene and camera coordinate systems can be defined through calibration. To ensure sufficient accuracy in the calibration process, it is imperative to scan the pattern multiple times and rotate it in various directions during the scanning procedure. It is recommended to obtain a minimum of 31 scans of the calibration pattern.