Road defect driving risk assessment method, device, equipment and medium
By generating disparity maps using binocular cameras and the SGBM algorithm, and combining attention mechanisms and grid cell analysis, the type, area, and distance of road defects are quantified. This solves the problem of high false detection rate in existing technologies, enables accurate detection and risk assessment of road defects, and improves driving safety.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHERY AUTOMOBILE CO LTD
- Filing Date
- 2026-01-12
- Publication Date
- 2026-05-01
AI Technical Summary
Existing vision-based road detection systems have a high false detection rate in real-world driving environments and cannot adapt to dynamic and complex road conditions, resulting in insufficient detection accuracy and reliability.
Road images are acquired using a binocular camera, a disparity map is generated using the SGBM algorithm, the coordinates of the defect center point are extracted, and a comprehensive risk value is calculated by combining the defect type, area, and distance. Defect detection is performed using an attention mechanism and a grid cell analysis algorithm to quantify the risk level.
It enables accurate detection and dynamic risk assessment of road defects, improving practicality and safety in real driving scenarios and reducing false detection rates.
Smart Images

Figure CN121947504A_ABST
Abstract
Description
A method, apparatus, equipment and medium for assessing driving risks due to road defects Technical Field
[0001] This application belongs to the field of driving safety, and in particular relates to a method, device, equipment and medium for assessing driving risks due to road defects. Background Technology
[0002] Vision-based road inspection systems are used to detect and identify road defects, aiming to help highway management systems reduce or replace manual visual inspections, thereby improving inspection efficiency. These systems typically focus on specific scenarios, such as images taken by drones, rather than the actual driving environment of on-road vehicles.
[0003] Existing technologies use drones to acquire images and specifically crop the input images to include only the target cracks, avoiding interference from irrelevant objects. The system uses visual algorithms to detect potholes and has been tested in controlled environments such as artificial vertical walls, achieving preliminary identification and classification of cracks. However, this method relies on simplified images and does not consider the complexity of real road environments.
[0004] In existing technologies that rely on image cropping and controlled environment testing, the unexpected nature of pothole shapes and the lack of verification in real-world road scenarios make the system prone to false detections in practical applications. Furthermore, the input images do not contain interference factors encountered in actual driving, making the system unable to adapt to the dynamic environment of land vehicles, thus limiting its accuracy and reliability in real-world driving risk assessment. Summary of the Invention
[0005] The purpose of this application is to overcome the deficiencies in the prior art and provide a method, device, equipment and medium for assessing road defect driving risks.
[0006] This application provides a method for assessing driving risk due to road defects, comprising: acquiring binocular images of a road from a binocular camera; generating a disparity map based on the binocular images using the SGBM algorithm; extracting the coordinates of the center point of a predicted bounding box for a road defect from the disparity map; calculating the distance to the road defect based on the center point coordinates; detecting road defects from the binocular images to obtain defect types and detection boxes; quantifying a type risk value δ1 based on the defect type, wherein the type risk value δ1 is based on a predetermined quantization value for the defect type; calculating a size ratio δ2 based on the ratio of the pixel area of the detection box to the average pixel area of defects of the same type; calculating a distance ratio δ3 based on the distance and a preset safety distance; calculating a comprehensive risk value δ based on the type risk value δ1, the size ratio δ2, and the distance ratio δ3; and determining a driving risk level based on the comprehensive risk value δ, wherein the driving risk level includes safe, warning, and dangerous.
[0007] Optionally, detecting road defects from the stereo image to obtain defect types and detection boxes includes: inputting the stereo image into a defect detection network, the defect detection network including a backbone network and an enhanced feature extraction network; integrating an attention module at the connection feature layer between the backbone network and the enhanced feature extraction network, the attention module including a channel attention mechanism and a spatial attention mechanism; performing weighted processing on the feature map of the stereo image through the attention module to generate enhanced features; and performing defect detection operations based on the enhanced features to obtain the defect type and the detection box.
[0008] Optionally, detecting road defects from the binocular image to obtain the defect type and detection box includes: applying a grid cell analysis algorithm to the binocular image, wherein the grid cell analysis algorithm is an image processing method that simulates biological grid cells for identifying textures and reducing shadow errors; processing the binocular image through the grid cell analysis algorithm to generate a shadow-reduced image; and inputting the shadow-reduced image into the defect detection device for defect detection to obtain the defect type and the detection box.
[0009] Optionally, quantifying the type risk value δ1 according to the defect type includes: mapping the defect type to a numerical risk value according to a predetermined defect type risk mapping table, wherein the defect type risk mapping table is established based on expert subjective assessment; wherein the defect type risk mapping table includes pits corresponding to high risk values, alligator cracks corresponding to medium risk values, and longitudinal cracks and transverse cracks corresponding to low risk values; and determining the type risk value δ1 based on the mapping result.
[0010] Optionally, calculating the size ratio δ2 based on the ratio of the pixel area of the detection frame to the average pixel area of defects of the same type includes: obtaining the average pixel area of defects of the same type from historical data; calculating the ratio of the pixel area of the detection frame to the average pixel area; and determining the ratio as the size ratio δ2.
[0011] Optionally, extracting the center point coordinates of the predicted bounding box of the road defect from the disparity map includes: reading the predicted bounding box coordinates of the road defect from the disparity map, the predicted bounding box coordinates including a maximum coordinate and a minimum coordinate; and calculating the center point coordinates based on the predicted bounding box coordinates, the center point coordinates being determined based on the average of the maximum coordinate and the minimum coordinate.
[0012] Optionally, calculating the comprehensive risk value δ based on the type risk value δ1, the size ratio δ2, and the distance ratio δ3 includes: determining weight values according to expert statistical methods, wherein the weight values include a first weight corresponding to the type risk value δ1, a second weight corresponding to the size ratio δ2, and a third weight corresponding to the distance ratio δ3; applying the weight values to the type risk value δ1, the size ratio δ2, and the distance ratio δ3 to perform a weighted summation calculation; and determining the weighted summation result as the comprehensive risk value δ.
[0013] This application also provides a road defect driving risk assessment device, comprising: an acquisition module for acquiring binocular images of a road from a binocular camera; a disparity module for generating a disparity map based on the binocular images using an SGBM algorithm; a center module for extracting the coordinates of the center point of a predicted bounding box of a road defect from the disparity map; a calculation module for calculating the distance of the road defect based on the center point coordinates; a defect module for detecting road defects from the binocular images and obtaining defect types and detection boxes; a type module for quantizing a type risk value δ1 based on the defect type, wherein the type risk value δ1 is based on a predetermined quantization value for the defect type; an area module for calculating a size ratio δ2 based on the ratio of the pixel area of the detection box to the average pixel area of defects of the same type; a distance module for calculating a distance ratio δ3 based on the distance and a preset safe distance; a comprehensive module for calculating a comprehensive risk value δ based on the type risk value δ1, the size ratio δ2, and the distance ratio δ3; and a judgment module for determining a driving risk level based on the comprehensive risk value δ, wherein the driving risk level includes safe, warning, and dangerous.
[0014] This application also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor, when executing the computer program, controls the execution of the method as described above.
[0015] This application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to control the execution of the above-described method.
[0016] The beneficial effects of this application are as follows: This application provides a method for assessing driving risks due to road defects, comprising: acquiring binocular images of a road from a binocular camera; generating a disparity map based on the binocular images using the SGBM algorithm; extracting the coordinates of the center point of a predicted bounding box for a road defect from the disparity map; calculating the distance to the road defect based on the center point coordinates; detecting road defects from the binocular images to obtain defect types and detection boxes; quantifying a type risk value δ1 based on the defect type, wherein the type risk value δ1 is based on a predetermined quantization value for the defect type; calculating a size ratio δ2 based on the ratio of the pixel area of the detection box to the average pixel area of defects of the same type; calculating a distance ratio δ3 based on the distance and a preset safe distance; calculating a comprehensive risk value δ based on the type risk value δ1, the size ratio δ2, and the distance ratio δ3; and determining a driving risk level based on the comprehensive risk value δ, wherein the driving risk level includes safe, warning, and dangerous. This application acquires road images from a binocular camera, applies the SGBM algorithm to generate a disparity map, extracts the coordinates of the center point of the predicted bounding box of road defects to calculate the distance, and combines the defect type and size information to quantify the risk value. Finally, it calculates the comprehensive risk value and determines the driving risk level, realizing accurate detection and dynamic risk assessment of road defects. This overcomes the false detection problem caused by unrealistic images and lack of environmental adaptability in existing technologies, and improves the practicality and safety in real driving scenarios. Attached Figure Description
[0017] Figure 1 is a schematic diagram of the road defect driving risk assessment process in this application; Figure 2 is a schematic diagram of the road defect detection and driving risk assessment process in this application; Figure 3 is a schematic diagram of the image with prediction boxes in this application; Figure 4 is a schematic diagram of the process of generating disparity maps using the SGBM algorithm in this application; Figure 5 is a schematic diagram of risk level classification. Detailed Implementation
[0018] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that various forms of implementation of the present disclosure are possible and should not be limited to the embodiments set forth herein. Rather, the embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0019] Referring to Figures 1 and 2, this application provides a method for assessing driving risks due to road defects, applied in the field of road safety, to solve the problem of automatically and non-destructively visually detecting road defects and assessing driving risks.
[0020] The road defect driving risk assessment method includes: S101, acquiring binocular images of the road from a binocular camera.
[0021] Acquiring stereo images of roads from stereo cameras refers to using stereo cameras mounted on vehicles to collect stereo image data of the roads, which is then used for subsequent processing.
[0022] Binocular cameras can capture images from both the left and right eye perspectives simultaneously, thus providing depth information.
[0023] For example, in the actual road environment of a certain city, binocular cameras acquire images in real time to cover different driving styles and road conditions.
[0024] After acquiring binocular images, preprocessing is required, such as distortion correction and stereo correction, to ensure image quality and provide input data for subsequent algorithms.
[0025] S102. Based on the stereo image, generate a disparity map using the SGBM algorithm.
[0026] Referring to Figures 3 and 4, generating a disparity map based on binocular images using the SGBM algorithm refers to using a semi-global block matching algorithm to perform stereo matching on the left and right images, calculate the disparity value of each pixel, and thus generate a disparity map.
[0027] The SGBM algorithm is characterized by its good disparity performance and high speed, making it an algorithm that balances matching accuracy and processing speed. The disparity map contains the coordinate information of each pixel, reflecting the depth of the scene.
[0028] For example, by processing binocular images using the SGBM algorithm, a disparity map as shown in Figure 3 is generated, which displays the relative positions of road defects.
[0029] S103. Extract the center point coordinates of the prediction box for road defects from the disparity map.
[0030] Extracting the center point coordinates of the predicted bounding box for road defects from a disparity map involves reading the coordinates of the predicted bounding box for the road defect area in the disparity map. These coordinates include the maximum and minimum coordinates, and then calculating the center point coordinates. The center point coordinates are determined based on the average of the maximum and minimum coordinates, using the following formula: (x 0 y 0 ) = ((x) max +x min ) / 2, (y max +y min ) / 2) where x0 and y0 represent the horizontal and vertical coordinates of the center point of the prediction box, x max and x min The y-coordinates represent the maximum and minimum coordinates of the predicted bounding box in the horizontal direction. max and y min This represents the maximum and minimum coordinates of the prediction box in the vertical direction.
[0031] This calculation accurately locates the center of road defects, providing a basis for distance measurement.
[0032] For example, in real-time detection, the prediction box is usually a rectangle, and the coordinates of the center point are used to represent the actual location of the defect.
[0033] S104. Calculate the distance of the road defect based on the coordinates of the center point.
[0034] Calculating the distance to road defects based on center point coordinates involves using depth information from a disparity map to convert the center point coordinates into a distance value in the real world. This is achieved by calibrating a stereo camera, acquiring its intrinsic and extrinsic parameters, performing stereo correction and distortion correction on the input stereo image, and then performing stereo matching to calculate the image depth information.
[0035] By inputting the center point coordinates, the z-coordinate of the center point in the real world is obtained, thus determining the distance d between the road defect and the vehicle-mounted binocular camera. Distance d is one of the key factors in assessing driving risk; for example, at high speeds, the closer the distance, the higher the risk.
[0036] S105. Detect road defects from the binocular image and obtain the defect type and detection box.
[0037] Detecting road defects from binocular images and obtaining defect types and detection boxes involves using an object detection network to analyze the image and identify the type and location of road defects. The detection network consists of a backbone network and a reinforcement feature extraction network. An attention module is integrated at the connection layer between the backbone network and the reinforcement feature extraction network. This attention module combines channel attention and spatial attention mechanisms, enabling the network to pay closer attention to important features in the image.
[0038] Channel attention mechanisms such as SENET or ECA adjust the channel weights of the feature layer, while spatial attention mechanisms such as CBAM focus on spatial regions in the feature map. The feature maps of the stereo image are weighted by an attention module to generate enhanced features, and then defect detection is performed based on these enhanced features to obtain the defect type and detection bounding box.
[0039] Defect types include longitudinal cracks, transverse cracks, alligator cracks, and potholes. The detection frame is a standard rectangular frame, as shown in Figure 2. The size of the frame is related to the actual size of the road defect.
[0040] The detection process employs a grid cell analysis algorithm, which simulates the image processing method of biological grid cells to identify textures and reduce shadow errors.
[0041] Binocular images are processed using a grid cell analysis algorithm to generate shadow-reduced images. These shadow-reduced images are then input into a defect detection network for defect detection, yielding defect types and detection boxes. This helps reduce false detections of shadow boundaries and improves detection accuracy.
[0042] For example, in poor lighting conditions, grid cell analysis can effectively distinguish between real defects and shadows.
[0043] Furthermore, SENET (squeeze and excitation networks) obtains the input feature layers and the weights of each channel, and then adjusts them so that the network can focus on the channels that need the most attention. CBAM (convolution block attention module) combines channel attention and spatial attention mechanisms, enabling the network to pay more attention to important features in the graph. ECA (efficient channel attention) improves upon SENET by replacing the fully connected structure with 1D convolutions, thereby improving the overall inference speed.
[0044] S106. Quantify the type risk value δ1 according to the defect type.
[0045] The quantification of type risk value δ1 based on defect type refers to mapping the detected defect type to a numerical risk value based on a predetermined defect type risk mapping table.
[0046] The defect type risk mapping table is established based on expert subjective assessment, where potholes correspond to a high-risk value of 2, alligator cracks correspond to a medium-risk value of 1, and longitudinal and transverse cracks correspond to a low-risk value of 0. The risk value δ1 represents the impact of the type of road defect on the risk of driving a vehicle.
[0047] For example, potholes pose the highest risk because they can cause vehicles to lose control. The quantification process is achieved by looking up a mapping table, ensuring the objectivity of the risk assessment.
[0048] S107. Calculate the size ratio δ2 based on the ratio of the pixel area of the detection frame to the average pixel area of the same type of defect.
[0049] The size ratio δ2 is calculated based on the ratio of the pixel area of the detection frame to the average pixel area of the same type of defect. It is a value used to measure the impact of the size of road defects on driving risk.
[0050] First, the average pixel area of the same type of defect is obtained from historical data, which comes from datasets such as the 2020 IEEE Big Data Cup Challenge Global Road Damage Detection Challenge and self-collected data.
[0051] Then, the ratio of the pixel area of the detection box to the average pixel area is calculated, which is δ2.
[0052] For example, if the pixel area of the detection box is large, it indicates that the defect size is large and the risk is higher.
[0053] This method uses pixel area instead of actual size, simplifying the calculation.
[0054] The dataset used in this application consists of 3 / 5 sourced from the 2020 IEEE Big Data Cup Global Road Damage Detection Challenge, and the remaining 2 / 5 collected independently using a stereo camera. The expanded dataset consists of labeled stereo images. It includes labels for four types of road damage: longitudinal cracks, transverse cracks, alligator cracks, and potholes.
[0055] S108. Calculate the distance ratio δ3 based on the distance and the preset safety distance.
[0056] The distance ratio δ3, calculated based on the distance and the preset safety distance, refers to the distance used when the safety distance D is [missing information]. safe The ratio of distance to road defect distance d is used as a numerical measure of the impact of distance on driving risk. The formula for calculating the distance ratio δ3 is: δ 3 =D safe / d where δ3 represents the risk value of the distance to the road defect for driving, D safe This is the preset safety distance, where d is the distance from the road defect to the vehicle-mounted binocular camera. Safety distance D safe The settings are based on actual conditions, such as calculations based on factors like vehicle speed and braking performance.
[0057] The formula for calculating the safe distance is: D act =V t +D brak +d s Among them, D act V represents the actual safe distance, t represents the vehicle speed, and t represents the response time for obstacle avoidance decisions and control operations during driving. brak d is the distance required for a vehicle to come to a complete stop from the start of braking. s To provide a safety margin, it is generally set to the length of the vehicle.
[0058] D brak It is subject to factors such as vehicle speed, braking performance, and road conditions.
[0059] This ratio quantifies the contribution of distance to risk.
[0060] S109. Calculate the comprehensive risk value δ based on the type risk value δ1, the size ratio δ2, and the distance ratio δ3.
[0061] The comprehensive risk value δ is calculated based on the type risk value δ1, size ratio δ2, and distance ratio δ3. This involves using a linear weighted mathematical model to comprehensively evaluate these three indicators. The formula for calculating the comprehensive risk value δ is: δ = δ1ω1 + δ2ω2 + δ3ω3, where δ represents the comprehensive assessment result of road defects on driving risk, δ1 represents the risk value of the type of road defect on driving, δ2 represents the impact of the size of the road defect on driving risk, δ3 represents the risk value of the distance of the road defect on driving risk, and ω1, ω2, and ω3 are the weights of each factor.
[0062] The weight values were determined based on expert statistical methods. Relevant experts and experienced testers set risk level labels for road defect data samples and processed them using statistical methods. The final results were ω1=0.4, ω2=0.3, and ω3=0.3.
[0063] The weighted summation process ensures the independent contribution of each indicator; for example, type risk has a higher weight because defect type directly affects severity.
[0064] S110. Determine the driving risk level based on the comprehensive risk value δ.
[0065] Please refer to Figure 5. Determining the driving risk level based on the comprehensive risk value δ means comparing the δ value with a preset threshold and classifying it into a safe, warning, or dangerous level.
[0066] The risk level classification criteria are as follows: when δ < 1, the risk level is safe; when 1 ≤ δ < 2, the risk level is warning; when δ ≥ 2, the risk level is dangerous.
[0067] For example, a low overall risk value indicates that road defects have little impact on driving and vehicles can pass safely; a high value, however, requires warning measures.
[0068] This classification helps drivers or autonomous driving systems make decisions.
[0069] Road defect detection and driving risk assessment are crucial components of safe driving. This application employs an object detection network and incorporates an attention mechanism to improve it, investigating the impact of the type and location of the attention mechanism. The final results show that the best performance is achieved in the connection feature layer between the backbone network and the enhanced feature extraction network, reaching a network accuracy of 49.05%. Simultaneously, the SGBM algorithm is integrated to measure the distance of road defects, and a driving risk assessment model is built based on the different characteristics of each road defect. Experimental results demonstrate that the proposed method can effectively perform road defect detection, distance measurement, and risk assessment.
[0070] This application also provides a road defect driving risk assessment device, comprising: an acquisition module for acquiring binocular images of a road from a binocular camera; a disparity module for generating a disparity map based on the binocular images using an SGBM algorithm; a center module for extracting the coordinates of the center point of a predicted bounding box of a road defect from the disparity map; a calculation module for calculating the distance of the road defect based on the center point coordinates; a defect module for detecting road defects from the binocular images and obtaining defect types and detection boxes; a type module for quantizing a type risk value δ1 based on the defect type, wherein the type risk value δ1 is based on a predetermined quantization value for the defect type; an area module for calculating a size ratio δ2 based on the ratio of the pixel area of the detection box to the average pixel area of defects of the same type; a distance module for calculating a distance ratio δ3 based on the distance and a preset safe distance; a comprehensive module for calculating a comprehensive risk value δ based on the type risk value δ1, the size ratio δ2, and the distance ratio δ3; and a judgment module for determining a driving risk level based on the comprehensive risk value δ, wherein the driving risk level includes safe, warning, and dangerous.
[0071] This application also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor, when executing the computer program, controls the execution of the method as described above.
[0072] This application also provides a computer-readable storage medium storing a computer program that, when executed in a computer, causes the computer to control the execution of the above-described method.
Claims
1. A method for assessing driving risks due to road defects, characterized in that, include: Acquire stereo images of the road from a stereo camera; Based on the stereo images, the SGBM algorithm is applied to generate a disparity map; The center point coordinates of the predicted bounding box for road defects are extracted from the disparity map; the distance to the road defects is calculated based on the center point coordinates; road defects are detected from the binocular image to obtain defect types and detection boxes; a type risk value δ1 is quantized based on the defect type, where the type risk value δ1 is based on a predetermined quantization value for the defect type; a size ratio δ2 is calculated based on the ratio of the pixel area of the detection box to the average pixel area of defects of the same type; a distance ratio δ3 is calculated based on the distance and a preset safety distance; and a comprehensive risk value δ is calculated based on the type risk value δ1, the size ratio δ2, and the distance ratio δ3. The driving risk level is determined based on the comprehensive risk value δ, and the driving risk level includes safe, warning, and danger.
2. The method according to claim 1, characterized in that, Detecting road defects from the stereo image and obtaining the defect type and detection box includes: inputting the stereo image into a defect detection network, the defect detection network including a backbone network and an enhanced feature extraction network; integrating an attention module at the connection feature layer between the backbone network and the enhanced feature extraction network, the attention module including a channel attention mechanism and a spatial attention mechanism; performing weighted processing on the feature map of the stereo image through the attention module to generate enhanced features; and performing a defect detection operation based on the enhanced features to obtain the defect type and the detection box.
3. The method according to claim 1, characterized in that, Detecting road defects from the binocular image to obtain the defect type and detection box includes: applying a grid cell analysis algorithm to the binocular image, wherein the grid cell analysis algorithm is an image processing method that simulates biological grid cells and is used to identify textures and reduce shadow errors; processing the binocular image through the grid cell analysis algorithm to generate a shadow-reduced image; and inputting the shadow-reduced image into the defect detection device for defect detection to obtain the defect type and the detection box.
4. The method according to claim 1, characterized in that, The method for quantifying the type risk value δ1 based on the defect type includes: mapping the defect type to a numerical risk value according to a predetermined defect type risk mapping table, wherein the defect type risk mapping table is established based on expert subjective assessment; wherein the defect type risk mapping table includes pits corresponding to high risk values, alligator cracks corresponding to medium risk values, and longitudinal cracks and transverse cracks corresponding to low risk values; and determining the type risk value δ1 based on the mapping result.
5. The method according to claim 1, characterized in that, The size ratio δ2 is calculated based on the ratio of the pixel area of the detection frame to the average pixel area of the same type of defect, including: obtaining the average pixel area of the same type of defect from historical data; calculating the ratio of the pixel area of the detection frame to the average pixel area; and determining the ratio as the size ratio δ2.
6. The method according to claim 1, characterized in that, Extracting the center point coordinates of the predicted bounding box of the road defect from the disparity map includes: reading the predicted bounding box coordinates of the road defect from the disparity map, the predicted bounding box coordinates including the maximum coordinates and the minimum coordinates; calculating the center point coordinates based on the predicted bounding box coordinates, the center point coordinates being determined based on the average of the maximum coordinates and the minimum coordinates.
7. The method according to claim 1, characterized in that, The comprehensive risk value δ is calculated based on the type risk value δ1, the size ratio δ2, and the distance ratio δ3, including: determining weight values according to expert statistical methods, wherein the weight values include a first weight corresponding to the type risk value δ1, a second weight corresponding to the size ratio δ2, and a third weight corresponding to the distance ratio δ3; applying the weight values to the type risk value δ1, the size ratio δ2, and the distance ratio δ3 to perform a weighted summation calculation; and determining the weighted summation result as the comprehensive risk value δ.
8. A road defect driving risk assessment device, characterized in that, include: The acquisition module acquires stereo images of the road from the stereo camera; The system includes a disparity module that generates a disparity map based on the binocular image using the SGBM algorithm; a center module that extracts the coordinates of the center point of the predicted bounding box for road defects from the disparity map; a calculation module that calculates the distance to the road defects based on the coordinates of the center point; and a defect module that detects road defects from the binocular image and obtains the defect type and detection box. The type module quantifies a type risk value δ1 based on the defect type, wherein the type risk value δ1 is based on a predetermined quantization value for the defect type. The area module calculates the size ratio δ2 based on the ratio of the pixel area of the detection frame to the average pixel area of the same type of defect; The distance module calculates the distance ratio δ3 based on the stated distance and the preset safety distance; The comprehensive module calculates the comprehensive risk value δ based on the type risk value δ1, the size ratio δ2, and the distance ratio δ3. The determination module determines the driving risk level based on the comprehensive risk value δ, which includes safe, warning, and dangerous levels.
9. An electronic device, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program, and the processor, when executing the computer program, controls the execution of the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed in a computer, causes the computer to control the execution of the method according to any one of claims 1-7.