## 3 Design of a Computer Vision-Based Roadside Occupation Surveillance System (CVROSS)
### Decision Support in Roadside Parking
#### 3.3.2 Parking Spaces and Decision Support Functionalities  
Calculation of parking gaps is useful for computing the available parking spaces. After gathering data on parking gaps in traffic lanes, the CVROSS can carry out further processing by dividing the length of each gap by the lengths of different types of vehicles \(\omega\) (input as one of the parameters described in Section 3.3.1), via Equation (8) for a truck, van and private car. If the length is less than the length of a private car, the objects are classified as \"others\", e.g., obstacles in the road. Therefore,  
Figure 8: Four possible cases for capturing images.  
the information on available parking spaces (\(\text{S}_{\text{truck}}\), \(\text{S}_{\text{van}}\) and \(\text{S}_{\text{private car}}\)) for the three types of vehicles in each individual traffic lane, or even for the whole road, is produced, to inform road users about real-time roadside occupancy and vacancy. Consequently, the proposed system can provide three decision support functionalities: evaluation of average space utilization, measurement of loading and unloading activity and average waiting time for parking. Considering that there are p cameras in the whole traffic lane, the average space utilization (U) is calculated by dividing the total available parking gaps by the maximum length of the image (in pixels), as shown in Equation (9), where \(\text{G}_{ij}\) represents the available parking gap \(i\) determined by camera \(j\) and \(\text{Pixel}_{(j,\text{max})}\) represents the maximum pixel value of camera j. If the traffic space is occupied by trucks and cargo vans instead of private cars, these are regarded as engaging in loading and unloading activities. The indication of performing loading and unloading activities (LUA) is calculated by dividing the sum of the lengths of the vehicles, for \(\text{L}_{(x,n)}\geq 5\), by the actual total length of the traffic lane (\(\text{L}_{\text{traffic}}\)) under surveillance by camera \(p\), as in Equation (10). The indication of loading and unloading activities is assumed to be updated hourly in the proposed system, to conveniently track the traffic situation. For average waiting times for parking, the proposed system will determine the waiting time for the entire traffic lane when any available parking space \(\text{G}_{n}\) is less than the required parking space for a private car (representing the smallest parking space for the three types of vehicles). Therefore, users can make an appropriate decision according to the above three indicators:  
\[\text{S}_{k}\ =\frac{1}{\omega}\cdot[\text{G}_{n}\frac{L_{a}}{L_{p}}],\ \text{where}\ k=\text{ truck},\ \text{van or private car};\ \omega=5,\ 7\ \text{or}\ 11 \tag{8}\]  
\[U=\frac{\sum_{j=1}^{p}\sum_{1=1}^{n}\text{G}_{ij}}{\sum_{j=1}^{p}j\cdot\text{ Pixel}_{(j,\text{max})}} \tag{9}\]  
\[\text{LUA}=\frac{\sum_{j=1}^{p}\sum_{i=1}^{n}\text{L}_{(x,i)}^{j}}{\text{L}_ {\text{traffic}}},\text{for}\ \text{L}_{(x,i)}^{j}\geq 5 \tag{10}\]  
In addition, the CVROSS was run with a timestamp control. Frequently updating real-time information allows road users to obtain useful information about real-time roadside occupancy and vacancy. Thus, road users can make good use of the information to make real-time decisions, such as parking their vehicles on the road or finding other roads. In addition, running the program with a time delay can prevent overrunning and overloading of the server, thus maintaining a high level of stability and accuracy of calculation.