# Design and Validation of a Camera-Based Safety System for Fenceless Robotic Work Cells
## 3 Design of the Image-Based Safety System
### Locating the Camera(s)
The objective function to maximize the scanned area (A\({}_{\text{max}}\)) is  
Figure 1:0  
In a 3000 mm diameter workspace, the camera projection area is expected to be larger not exceeding 4000 mm in diameter; that is, the first constraint is that the major axis (a) should be longer than 3000 mm and less than 4000 mm. According to the working environment's constraints, the camera placement height is expected to remain below a certain distance, and it was assumed as 10,000 mm as the second constraint for the experimental study. The third constraint is that the camera lens angle (2\(\alpha\)) should be between 30\({}^{\circ}\) and 70\({}^{\circ}\). The extremum points of a continuous objective function are the points where the derivative is zero. For f(\(\alpha,\text{h}\)), the function's derivatives are taken with respect to \(\alpha\) and h. The solution set for this point is shown in Equation (6). \[ \begin{array}{c}\alpha_{1}=\pi n,\;n\in Z\\ \alpha_{2}=\pi n-1/2(\cos^{-1}(-3)),\;n\in Z\\ \alpha_{3}=\pi n+1/2(\cos^{-1}(-3)),\;n\in Z\end{array}  \tag{6}\]  
Since \(\alpha\) values 0 and over \(\pi\) obtained from the equalities of \(\alpha_{1}\) and \(\alpha_{3}\) are not reasonable, we considered using \(\alpha_{2}\). Therefore, the optimal \(\alpha\) was obtained as 0.505 radians (28.94\({}^{\circ}\)), and this value represents half of the camera lens angle. Figure 5 shows the graphical representation of the area that the objective function scans for the given constraints. In this graph, the area of the safety zone is directly proportional to h and \(\alpha\). Therefore, although the yellow area shown in Figure 6 has the highest area for the safety zone, it is seen that the optimal point should be sought in this region due to the height constraints. Therefore, the optimal region for the optimal angle of the camera lens and h height values between 4000 to 10,000 mm is marked in red color. Figure 5: Projected area by one camera versus camera height and semi-lens angle. The image resolution represents the details that the image contains. This term applies to digital images, motion images, and other image types. Higher resolution means more detailed images. Image resolution can be measured in several ways. A resolution unit depends on a physical dimension, in other words, the overall size of an image. The resolution of digital cameras can be defined in various ways, such as pixel, spatial, spectral, and temporal resolutions. The pixel resolution is an important factor in the safety system because the actual portion of the image corresponding to each pixel varies with the camera height. According to international standards on digital cameras, \"total pixel count\" is the major specification concerning image sensors instead of the resolution. The term \"registered pixels\" is usually equal to the number of pixels [27; 28]. The camera's projection forms an exact circle when it is placed vertically. However, since the camera is placed at a certain angle, the projection is an ellipse, and the optimization is performed based on the equation of the ellipse. The size of the detected object is critical in the safety system. Camera height and camera resolution are proportional to the number of pixels in the scanned area. Even if the dimensions of the detected object remain constant, the number of pixels that need to be scanned vary based on the camera height and resolution. Thus, the proposed mathematical model is a dynamic one that can adapt to these changes. A generic and dynamic mathematical model including all the critical variables is needed for the image-based safety system. This system model is expected to practically adapt to various cases and constraints in the industry. The camera lens angle and the minimum object size to detect are the main input variables, the safety distance may or may not be an independent variable based on dimensions of the work cell, and the maximum camera height is the main constraint.