# Robust Parking Block Segmentation from a Surveillance Camera Perspective
## 2 Methodology  
Recall that our objective is to segment parking blocks on the surveillance camera perspective. We previously mentioned how satellite views simplify the task of recognizing parking spots. These approaches have been neatly fitted into a two-category taxonomy by [PERSON] [12]--car-driven and space-driven. However, in this work we took a joint approach that detects parking blocks from the camera perspective. Convolutional neural networks (CNNs) were successfully used to detect parking lot patches from aerial imagery in Reference [19] with a best test classification accuracy of 94.3%. Authors in [20] use a CNN based on AlexNet for occupancy detection over PKLot and their own dataset CNRPark, achieving roughly a 3% overall accuracy improvement compared with previous methods based on two textural descriptors, namely Local Binary Patterns and Local Phase Quantization presented in Reference [9]. The Cityscapes challenge [21] provides segmented parking areas (not necessarily parking blocks). However, Cityscapes does not provide accuracy values for evaluating this class performance and whenever a car or other object is in front, the resulting class is this other object and not the parking area. One domain from a satellite perspective that is remarkably similar to parking block segmentation is building block segmentation [22; 23; 24]. In fact, the front page image of Reference [22] shows parking block areas segmented by mistake. This is a clear hint that their method would also perform well on parking blocks, given that our method could be considered a more general case. The best results in both cases were obtained by fully convolutional networks (FCNs) with 88.5% overall accuracy and 0.69 intersection over union (IoU) (XD_XD algorithm on las Vegas) respectively. Fully convolutional networks are a generalization over CNNs and were introduced by [PERSON] [25]. Given that they don't have fully connected layers they can manage different input sizes and arefaster. U-Net [26] is an improved version of the original FCN that has in the upsampling part a large number of feature channels to better propagate context information to higher resolution layers. In this work we used a modification of U-Net that was implemented by [PERSON] and [PERSON] in Reference [10]. In brief, we use a CNN to segment the parking blocks from an satellite view. Even though it is quite simple, this approach has never been taken in previous works at the time of writing, maybe due to the lack of a dataset that could serve for training. Recall that our solution proposal consists of using the segmentation of a public satellite image and combine it with the surveillance camera view to generate an extremely accurate segmentation of the surveillance camera, regardless of any temporal or obstacles interfering with camera's view. An outline of the developed method is given in Algorithm 1. Also, a graphical overview of the proposed method is provided in Figure 2.  
```
0:\(NET\)--Pre-Trained CNN
0:\(SAT\)--Satellite image
0:\(PMS\)--Camera extrinsic parameters
0:\(SEG\)--Segmented camera-view parking lot
1:procedureSegmentCamera(\(NET\), \(PMS\))
2:\(IMG\leftarrow\) ExtractCameraFrame() \(\triangleright\) Read image from camera
3:\(SAT\leftarrow\) CropScale(\(SAT\)) \(\triangleright\) Crop and scale the satellite image
4:if\(PMS\equiv\partial\)then
5:\(PMS\leftarrow\) GetExtrinsicParams() \(\triangleright\) Get camera parameters
6:endif
7:\(HOM\leftarrow\) GetHomography(\(SAT\),\(IMG\),\(PMS\)) \(\triangleright\) Get homography from correspondence points
8:\(SSAT\leftarrow\) SegmentSatellite(\(NET\), \(SAT\)) \(\triangleright\) Use ANN to segment satellite image
9:\(SEG\leftarrow\) Apply(\(HOM\),\(SSAT\)) \(\triangleright\) Apply hom. to segmented satellite image
10:return\(SEG\)
11:endprocedure
```  
**Algorithm 1** Parking Block Segmentation from a Surveillance Camera Perspective  
Figure 2: Our Proposal. First, a satellite photo perspective of the same parking area (**a**) is cropped and scaled (**b**).