# Pothole Classification Model Using Edge Detection in Road Image
## 3 Pothole Classification Model Using Edge Detection in Road Image  
### Image Pre-Processing Using Object Detection  
The road damage image there are so many objects such as people, cars, trees, street lights, and buildings. Also, it costs a lot in calculating a multi-channel image such as RGB. A preprocessing process is necessary for efficient analysis to solve this. Methods for image preprocessing include gray-scale, binarization, enlargement and reduction, rotation and transformation. The gray-scale method reduces the amount of data by converting a multi-channel image such as RGB into a single channel. This can be converted without significantly damaging the shape of the image [32]. The binarization method is used to transform the threshold into black or white. This greatly reduces the number of data [33]. The enlargement and reduction methods can adjust the range by enlarging or reducing the image when there is a large or small amount of data in the image [34]. The rotation and transformation methods are used when the object to be detected in the image is not in the designated form [35]. A pothole has a feature that does not have the color of RGB. In the road surface data, however, there are various objects such as trees and cars around the pothole. Therefore, if all of them are converted to black or white in order to recognize each feature, it is difficult to analyze the features. The pothole image used in this study is converted into a single channel using a gray-scale as a pre-processing method to minimize the loss. The pothole image used is data collected directly from the road. This is done using the OpenCV library. OpenCV (Open Source Computer Vision) is a library that provides various algorithms related to computer vision and machine learning [36]. Accordingly, the transformed gray-scale image is quantified according to pixels to form a matrix. In addition, an object detection algorithm is used to detect objects in the image. YOLO is the algorithm used for object detection. YOLO can extract features at a time for real-time data using a single network and create a bounding box. It can also classify classes [23]. Accordingly, the detected object is removed to replace the pixel value with 255 to create a background. This is because the color of the road and pothole is gray, replace the background to 255 can highlight the importance of road and pothole detection. Figure 2 shows the preprocessing process using object detection.  
In Figure 2, the pre-processing using object detection proceeds in two stages. In the first stage, the image data for analysis is RGB data having 1,098,000 pixels. This is changed to data having 366,000 pixels through gray-scale. This reduces the size of the data to 1/3 and represents it as a two-dimensional matrix with a size of (732,500). The second stage detects the object using the YOLO algorithm in the data converted to gray-scale. Among the detected objects, objects excluding the pothole are removed to change the pixel value to 255 and create a background. Therefore, other objects excluding the pothole are removed through the pre-processing process.