# Extraction of City Roads Using Luojia 1-01 Nighttime Light Data
## 3 Method
### Shape Optimization through Morphological Operations  
The original extraction results from PCNN may have contained not only the road regions, but also some non-road regions, such as dark vehicles, shadows and trees, which have an intensity value less than that of an urban road. To eliminate influence from these pixels, thus improving the extraction accuracy, the following three morphological operations were conducted to the extraction results: clean, edge loss filling and close [46]. 1. Clean: The purpose of this operation was to eliminate the isolated pixels in extraction results. The shape of the road was often similar to a long strip. Additionally, there existed a high connectivity between roads. Thus, we designed a 3 \(\times\) 3 filter to distinguish pixels surrounded by 0 values and these pixels were marked as 'noises', the intensity of which were then set as 0 to avoid being detected as road pixels. 2. Edge loss filling: Due to the existence of vehicles, trees, shadows, ground noises or data loss, some road pixels, especially those located in the road edge, can be some tiny cavities with 0 light intensity, which can cause edge loss in final extraction results and influence the integrality and continuity or road networks. Therefore, we adopted this operation to fill up the tiny cavities in binary images. The main steps were as follows: searching for a potential road path, which can be realized by connecting furcate road pixels with terminal road pixels; calculating the average road width and comparing average road width with the width of each road unit to find out units influenced by cavities and need edge loss filling; performing the filling process in edge loss pixels to keep the width of road unit consistent with the average road width. The process can be described as Figure 5, where a short part of road is observed as narrower than the main part, caused by background noises or shadows. We recorded the coordinate of the central point \(P_{1}(x_{1},y_{1})\) of this small part and the central points \(P_{2}(x_{2},y_{2})\) and \(P_{3}(x_{3},y_{3})\) of two nearby road units. We adopted the following formulation to calculate the theoretical location of central point \(P_{1}^{\prime}\big{(}x_{1}^{\prime},y_{1}^{\prime}\big{)}\) without influences from tiny cavities [13]: \[x_{1}^{\prime}=(ax_{2}+x_{1}/a-y_{2}+y_{1})/(a+1/a)\] (14) \[y_{1}^{\prime}=y_{1}+a(x-x_{2})\] (15) where \(a\) is a constant. If \(x_{2}=x_{3}\), then \(x_{1}^{\prime}=x_{2}\), \(y_{1}^{\prime}=y_{1}\); if \(y_{2}=y_{3}\), then \(x_{1}^{\prime}=x_{1}\), \(y_{1}^{\prime}=y_{2}\). Finally, the road pavements were then filled according to its new central point \(P_{1}^{\prime}\) and average width. 3. Close: In an extraction process, a continuous road may be separated into serial isolated parts due to background noises or data loss. Therefore, we adopted the 'close'  
Figure 5: Process of edge loss filling. operation to connect these separated parts into a continuous road. The operation included two steps--dilation and erosion. The purpose of dilation is to enlarge the edge of roads to make adjacent roads connected. This step can be achieved through a structural element \(s(r,t)\), which will set the pixel value of location \((x,y)\) as the maximum value of their product in image \(f(x,y)\)[47]:  
\[f(x,y)\boxplus s(r,t)=maxf(x+r,y+t)\times s(r,t) \tag{16}\]  
After the dilation step, most road edges will be wider than the original edges and some unrelated roads may also be connected. The purpose of erosion is to shrink the edge of roads to separate roads that were not supposed to connect with each other.