# An Energy Saving Road Sweeper Using Deep Vision for Garbage Detection
## 3 Description of The System
### Camera Optics and Placement  
Road width varies across the world and from rural to urban areas. A good assumption for a single lane of a two-lane road is 3.5 m. Typical cars are narrower, and sweeper trucks make no exception. Most sweepers reside in the width range of 2 to 2.5 m. Their sweeping brushes are usually placed laterally and can cover a total street space from 2.5 to 3 m. Thus, our camera shall cover at least that width (\(h_{wid}\)), and horizontal field of view shall be derived as a consequence. In order to choose the right vertical field of view, we will need to define \(d_{near}\) as the distance (in meters) between the nearest pixel framed by the camera and the camera itself. Similarly, \(d_{far}\) is the distance of the farthest pixel framed (Figure 2). Given an expected \(FPS\) (frames per second) for the system (more on that in Section 3.3) and a maximum vehicle speed \(v_{max}\), the first constraint to impose is the following:  
\[d_{far}-d_{near}>\frac{v_{max}}{FPS}\]  
to have a full coverage of the road ahead while the vehicle is moving. Most sweeper trucks are quite slow if compared to a normal car; in fact, peek speeds during cleaning operations may be in the range of 10 to 20 Km/h (about 3 to 5 m/s). Thus, if we aim to have a system that analyzes the street at 1 frame per second, we will need to cover at least 5 m of ahead \"vertical\" ground to analyze the road with continuity. Another important consideration for camera placement is the minimum distance we are targeting with our camera (\(d_{near}\)). The choice of this distance will present some performance tradeoffs. By choosing a small \(d_{near}\) we will have:  
* A more responsive system. If the camera is framing near ground, the system reacts faster during quick turns of the truck;
* Less perceived kinetic speed when the truck is turning (the vision point of view is turning with a smaller radius), thus less blur when turning;
* Bumps and asperities will have a lower impact on the 3D world coordinates reconstruction error;
* Less subject to fog and rain;
* Better depth of field (DOF). A known effect with cameras is that the depth of field (the z-coordinate range in which the objects appear on focus) is larger when framing near objects. While choosing a large \(d_{near}\) we will have:  
* More time to analyze the picture before having to act on the actuators (the objects to be analyzed are farther, so the vehicle takes more time to reach them, and the same goes for the deadline to the analysis to be completed. We called this concept _maximum latency of analysis_);
* Less blur when going straight (when moving straight and looking to near objects in perspective, they appear to move faster than far objects);
* Better perceived height for framed objects. Looking to a non-flat kind of trash (such as a bottle) is easier from a grazing angle than a top view. In practice, the only _hard_ constraint is the maximum allowed time to analyze a single frame (\(t_{frame}\)). In fact, the following must hold:  
\[d_{near}>v_{max}\cdot t_{frame}\]  
For simplicity, we impose \(t_{frame}=1/FPS\) (even if \(t_{frame}\), the _maximum_ allowed latency, could be higher than \(1/FPS\), the _average_ time of analysis for a frame in the system). With these conditions in mind, and with the additional constraint of a camera placed inside the cockpit at a height from the ground called \(cam_{h}\), which can be anywhere from 2 to 3 m, useful equations can be derived from simple geometrical equations. The vertical camera angle of view is:  
\[\alpha_{v}=atan(\frac{d_{far}}{cam_{h}})-atan(\frac{d_{near}}{cam_{h}})\]  
while the horizontal angle of view is:  
\[\alpha_{h}=2\cdotatan\left(\frac{h_{wild}}{2\cdot\sqrt{{d_{near}}^{2}+cam_{h} ^{2}}}\right)\]  
Figure 2: The “vertical” FOV of the system camera.