A computer vision-based vehicle damage detection and identification method

The vehicle damage detection method based on polarized light imaging and Stokes parameter calculation solves the problems of traditional detection techniques being sensitive to light and having poor material adaptability, and achieves high-precision, adaptive vehicle damage identification and report generation.

CN121073891BActive Publication Date: 2026-07-03SHANGHAI XIMAN NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANGHAI XIMAN NETWORK TECH CO LTD
Filing Date
2025-08-08
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing vehicle damage inspection technologies are sensitive to changes in ambient light, making it difficult to detect minor dents or scratches. Furthermore, they have poor generalization ability for defect types under new vehicle body materials or painting processes, and the equipment costs are high, making it difficult to conduct large-scale on-site inspections.

Method used

By introducing polarized light imaging and multi-angle grayscale acquisition, combined with Stokes parameter calculation and polarization feature analysis, and by establishing an image coordinate system, unifying pixel indexes and standardizing acquisition angles, the degree of polarization and polarization angle are calculated, and adaptive threshold setting and morphological processing are performed to identify vehicle surface damage.

Benefits of technology

It improves the robustness and accuracy of vehicle damage detection, can accurately identify minor damage in complex environments, adapts to different paint materials and lighting conditions, and generates structured, traceable vehicle damage reports.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121073891B_ABST
    Figure CN121073891B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of computer vision-based vehicle damage detection and recognition, and discloses a computer vision-based vehicle damage detection and recognition method. The method covers image acquisition, polarized image acquisition, Stokes parameter calculation, polarization feature extraction, abnormality evaluation and connected region analysis. By setting an image coordinate system, collecting multi-angle polarized images, calculating the polarization degree and polarization angle of each pixel, and taking the artificially selected undamaged area as a reference, a polarization statistical model is established, and then the pixels are measured for abnormality and adaptively threshold segmented. Combined with corrosion, inflation and connected region analysis, the structured vehicle damage detection result is output. The polarization feature enhances the physical interpretability and detection accuracy, and even in the smooth or complex reflective surface of the vehicle body area, it can accurately identify the concave or scratch, and provide a standardized report containing position information and abnormality, effectively improving the automation and accuracy of vehicle damage evaluation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of vehicle damage detection and recognition technology based on computer vision, specifically to a vehicle damage detection and recognition method based on computer vision. Background Technology

[0002] With the rapid development of the automotive industry, the integrity and aesthetics of a vehicle's exterior have a significant impact on its value and safety performance. Traditional vehicle damage inspection mainly relies on manual visual inspection or simple optical image processing methods. Manual inspection is inefficient, highly subjective, and unsuitable for large-scale assembly line operations. Computer vision-based inspection methods capture vehicle images through cameras and utilize techniques such as image segmentation, edge detection, feature extraction, and classifiers to automatically identify defects such as scratches and dents.

[0003] By separating grayscale or color channels in vehicle body images and then extracting abnormal regions based on preset thresholds, a simple approach is implemented. However, it is extremely sensitive to changes in ambient lighting, making it difficult to maintain stability in real-world conditions. Furthermore, it can only detect obvious color or brightness abrupt changes, failing to detect minute dents or scratches. Another approach involves extracting image edges using operators like Canny and Sobel, combined with morphological dilation and erosion operations to generate candidate defect regions. This method is effective for structured defects (such as obvious cracks and deep scratches), but it is prone to generating numerous false positives or false negatives for micro-deformations (dents smaller than pixel resolution) and reflective highlights in complex backgrounds. A third approach uses manually extracted texture, shape, or color features, combined with traditional classifiers such as support vector machines and random forests, to classify defective and non-defective regions. This method relies on a large number of labeled samples and empirical features, exhibiting poor generalization ability for defect types under new vehicle body materials or painting processes, and requiring significant manual feature design work. Finally, using frameworks such as Convolutional Neural Networks (CNN), Faster R-CNN, and YOLO can achieve higher accuracy in scratch and dent detection. However, such methods are highly dependent on the size and diversity of the dataset, requiring the acquisition and annotation of a large number of images with different lighting conditions, viewing angles, vehicle body colors, and materials. Furthermore, when detecting minute dents, limitations in resolution and network structure often make it difficult to capture low-contrast, subtle deformation information. Multi-view images or structured light / laser scanning are used to obtain vehicle body point clouds, which are then reconstructed into a 3D model. The contours are compared with standard shapes to obtain convexity / concave variations. While these methods can quantify defect depth and volume, they are costly to implement, involve complex data processing, are not economical for large-scale on-site inspections, and are severely affected by reflective surfaces. Polarization imaging technology has applications in medical imaging, materials testing, and airborne remote sensing. By analyzing light polarization information, it can reveal surface microstructure and stress distribution. Stokes parameters can be used to separate polarization degree and polarization angle features from single or multiple polarization images. However, polarization imaging is not yet widespread in automotive exterior inspection; most inspection systems are still limited to RGB intensity information, making it difficult to fully utilize the high sensitivity of polarization to minute deformations.

[0004] Therefore, this case aims to propose a computer vision-based vehicle damage detection and recognition method. By introducing polarized light imaging and multi-angle grayscale acquisition, combined with Stokes parameter calculation and polarization feature analysis, it achieves highly robust identification of vehicle surface damage. The overall process of the method covers the entire process from environmental and equipment setup, multi-angle polarization map acquisition, physical quantity calculation (polarization degree and angle), polarization anomaly degree calculation by comparison with a non-destructive reference area, to binarization and morphological processing, connected component extraction and damage area labeling, forming an end-to-end automated damage detection system. Summary of the Invention

[0005] This invention provides a computer vision-based vehicle damage detection and recognition method, which helps to solve the problems mentioned in the background art.

[0006] This invention provides the following technical solution: a vehicle damage detection and recognition method based on computer vision, comprising:

[0007] Set the camera imaging plane as the image coordinate system, select the pixel coordinate range, calibrate the zero-degree direction of the polarizer, fix the polarizer to the rotatable device and set the preset polarization angle set, and combine with a uniform diffuse light source to acquire images;

[0008] The polarizer is rotated to multiple preset angles, and grayscale images of the corresponding polarization angles are acquired and stored.

[0009] Based on grayscale images with multiple polarization angles, Stokes parameters are calculated for each pixel, including total intensity and linear polarization difference in different directions;

[0010] Based on the Stokes parameters, the degree of polarization and the non-negative polarization angle of each pixel are calculated;

[0011] Manually select a flat, undamaged rectangular reference area in the image, calculate its average degree of polarization, polarization angle, and standard deviation, and set the corresponding tolerance threshold.

[0012] The polarization degree and polarization angle of any pixel are compared with the reference value of the reference area, and its polarization anomaly is calculated by normalizing the difference and Euclidean norm.

[0013] Calculate the segmentation threshold based on the anomaly metric statistics of the whole image, and generate an initial binary mask for the suspected damaged area;

[0014] Noise is removed by erosion and dilation operations, connected regions are identified, effective components are screened and centroids, bounding boxes and anomaly features are extracted to form a candidate vehicle damage area detection report.

[0015] Optionally, the steps of setting the camera imaging plane as an image coordinate system, selecting a pixel coordinate range, calibrating the zero-degree direction of the polarizer, fixing the polarizer to a rotatable device, and setting a preset set of polarization angles, combined with image acquisition using a uniformly diffused light source, specifically include:

[0016] Set the camera imaging plane as the image coordinate system, and represent pixel coordinates as follows: ;in, These are the pixel column coordinates, with a value range of [value range missing]. , This represents the number of horizontal pixels in the original image. Here are the pixel row coordinates, with values ​​ranging from 1 to 2. , This represents the number of vertical pixels in the original image.

[0017] Let the set of pixels of the entire image be denoted as ;

[0018] The zero-degree direction is calibrated on a linear rotatable polarizer, corresponding to the polarization angle. ;

[0019] The polarizer is placed firmly against the camera lens and fixed to a rotatable device, allowing it to rotate precisely to the following four angles:

[0020] ;in, This is a set of preset polarizer rotation angles; For the first A preset polarization angle, The range of values ​​is ;

[0021] Image acquisition is performed using a uniform diffused light source. During the acquisition process, the position and orientation of the camera and the surface of the vehicle being measured are kept still.

[0022] Optionally, the step of rotating the polarizer to multiple preset angles, acquiring and storing grayscale images corresponding to the polarization angles specifically includes:

[0023] For any pixel At the polarization angle The grayscale value collected below is denoted as ;in, The normalized value is the original 8-bit grayscale value of the camera divided by 255, corresponding to the polarization angle. ;

[0024] Rotate the polarizer to Collect a grayscale image, denoted as ;

[0025] Rotate the polarizer to Collect a grayscale image, denoted as ;

[0026] Rotate the polarizer to Collect a grayscale image, denoted as ;

[0027] Rotate the polarizer to Collect a grayscale image, denoted as ;

[0028] grayscale image Store in the database.

[0029] Optionally, the calculation of Stokes parameters for each pixel based on multiple polarization angle grayscale images specifically includes:

[0030] For each pixel ,calculate:

[0031] ;

[0032] ;

[0033] ;

[0034] in, Total strength; In order to be in Linear polarization difference in the direction; In order to be in Linear polarization difference in the direction.

[0035] Optionally, the calculation of the polarization degree and non-negative polarization angle of each pixel based on the Stokes parameters specifically includes:

[0036] For each pixel Calculate the degree of polarization :

[0037] ;in, To prevent division by zero constant;

[0038] when When, the light is completely unpolarized; when At that time, the light rays are completely linearly polarized;

[0039] For each pixel Calculate the polarization angle :

[0040] ;in, For the binocular arctangent function, for the input Return value range ,satisfy ;

[0041] Will Mapped to nonnegative values Specifically:

[0042] .

[0043] Optionally, the manual selection of a flat, undamaged rectangular reference region in the image, calculation of its average degree of polarization, polarization angle, and standard deviation, and setting of corresponding tolerance thresholds specifically includes:

[0044] Artificial pre-image Select a small rectangular area on the car body that has been confirmed to be flat, without scratches, and without dents, and denote it as... ;in, The coordinates of the top left corner of this area; This is the width of the area; The height of the region; the total number of pixels in the region. ;

[0045] exist Inside, collect all pixels polarization value And calculate the average polarization degree of the reference region respectively. and the standard deviation of polarization degree in the reference region :

[0046] ;

[0047] ;

[0048] exist Inside, collect all pixels non-negative polarization angle And calculate the average polarization angle of the reference region respectively. and the standard deviation of polarization angle in the reference region :

[0049] ;

[0050] ;

[0051] Set the polarization tolerance threshold to ;

[0052] Set the polarization angle tolerance threshold to .

[0053] Optionally, the step of comparing the polarization degree and polarization angle of any pixel with the reference value of the reference area, and calculating its polarization anomaly degree by normalizing the difference and Euclidean norm, specifically includes:

[0054] For any pixel Calculate its degree of polarization and the average degree of polarization of the reference region. absolute deviation ;

[0055] For any pixel First, obtain the non-negative polarization angle of the pixel. Then calculate the absolute deviation with wrap correction. Specifically:

[0056] ;

[0057] Calculate the polarization degree normalized to ;

[0058] Calculate the normalized polarization angle as ;

[0059] The normalized metrics are combined according to the Euclidean norm to obtain the overall pixel anomaly metric. for:

[0060] ;

[0061] like and ,but , , This indicates that the pixel is completely consistent with the reference area;

[0062] like and ,but , , This indicates that the pixel deviates the maximum from the reference area.

[0063] Optionally, the step of calculating the segmentation threshold based on the full-image anomaly metric statistics and generating an initial binary mask for the suspected damaged region specifically includes:

[0064] exist Inside, for each pixel of Form a set And calculate the average anomaly measure respectively. and the standard deviation of anomaly measurement :

[0065] ;

[0066] ;

[0067] Set the pixel binarization threshold to ;

[0068] For the entire image pixels Generate an initial binary mask Specifically:

[0069] ;

[0070] like , representing pixels This is suspected to be an injury;

[0071] like , representing pixels This is normal.

[0072] Optionally, the step of using erosion and dilation operations to remove noise, identify connected regions, screen effective components, and extract centroid, bounding box, and anomaly features to form a candidate vehicle damage area detection report specifically includes:

[0073] set up Cross-shaped neighborhood structural element for:

[0074] ;

[0075] in, The relative pixel offset within the structuring element;

[0076] For the initial binary mask Calculate corrosion results , Among them, indexes that exceed the boundary. Treat it as 0, that is ;

[0077] Corrosion results Calculate the expansion results :

[0078] , ;

[0079] Set the final denoised binary mask , ;

[0080] Traversal According to the 8-neighborhood connectivity rule, all points with a pixel value of 1 are labeled as connected components to obtain a set of connected components. ;in, For the first A connected component, for in The set of all connected pixel coordinates with a value of 1; The total number of connected components represents the number of all detected candidate regions;

[0081] The 8-neighborhood connectivity is defined as if two pixels are connected. and satisfy and If they are in the same connected component;

[0082] For each connected component Calculate pixel area , ;

[0083] Area of ​​all connected components Form a set and calculate its median. :

[0084] ;in, This is the median function. After sorting the input set of values, it takes the median value. If the number of elements is even, it takes the average of the two middle values. The result is an integer or a real number, representing the median level of the area of ​​the connected components.

[0085] Set the minimum effective area threshold to ;

[0086] For each component :

[0087] like If the component is not identified as noise, it is considered to be discarded.

[0088] like If so, the component is retained and added to the final candidate set;

[0089] For each connected component that is retained Calculate the following features:

[0090] S1, pixel centroid coordinates :

[0091] ;in, For components Centroid column coordinates; For components Centroid coordinates;

[0092] S2, coordinates of the two-dimensional bounding box :

[0093] , ;

[0094] , ;

[0095] in, For components Minimum column coordinates; For components Maximum column coordinate; For components Minimum row coordinate; For components Maximum row coordinate;

[0096] S3. Calculate the average outlier With maximum anomaly :

[0097] , ;

[0098] Each retained component The feature-generated detection report entries include the component number. Centroid coordinates Pixel area 2D bounding box coordinates Average outlier With maximum anomaly .

[0099] The present invention has the following beneficial effects:

[0100] 1. By introducing a rotatable polarizer into a traditional camera system, grayscale image acquisition at multiple polarization angles is achieved. This design significantly improves the robustness of images in complex reflective environments and avoids interference from lighting changes such as strong light or shadows on vehicle damage recognition. The precision of polarization angle control and the consistency of light source diffusion ensure the stability and repeatability of image acquisition, providing reliable input for subsequent polarization calculations. Compared with existing RGB image recognition technologies, this method can acquire more physical dimension information, such as the changes in polarization angle caused by surface micro-concavities and convexities, which are difficult to capture in traditional image processing. By establishing an image coordinate system, unifying pixel indexes, and standardizing acquisition angles, a foundation is laid for standardized processing of the entire system.

[0101] 2. By calculating the Stokes parameters, the original image data is transformed into two physically meaningful optical features: polarization degree and polarization angle. Polarization degree reflects the degree of polarization of light, while polarization angle reflects the principal polarization direction. This transformation effectively converts the grayscale image into a quantitative description of the polarization state, thereby enhancing the discriminability of damaged areas. Unlike existing technologies that directly use grayscale difference and texture analysis, this method extracts more discriminative physical features from the perspective of light wave behavior. Especially in vehicle damage scenarios such as shallow scratches and micro-dents, which are difficult to detect with traditional RGB methods, changes in polarization angle are often particularly sensitive. This step greatly enhances the system's ability to perceive changes in microstructure.

[0102] 3. By manually selecting reference regions confirmed to be undamaged in the images and calculating the polarization statistical characteristics (mean, standard deviation) of these regions, a baseline for the system's adaptive judgment of vehicle damage anomalies was established. The concept of baseline modeling was introduced, giving each image a dynamic threshold, avoiding the poor generalization ability problem caused by fixed threshold schemes. Compared to fixed feature templates or preset models, this method uses intra-image comparison, independent of the overall brightness or texture feature distribution of the image, effectively adapting to interference from different paint materials and different shooting lighting conditions. In practical applications, this mechanism greatly improves the algorithm's environmental adaptability and cross-scene generalization ability.

[0103] 4. A normalized Euclidean distance metric method integrating both polarization degree and polarization angle differences is proposed for refined anomaly assessment of each pixel. An angle difference calculation logic with surround correction is introduced, effectively solving the error problem caused by the periodicity of polar angles, enabling the system to accurately determine the degree of deviation from the reference area. Compared with conventional image binarization schemes, this method provides a full-link transformation from physical space to statistical space to metric space, enhancing the accuracy of anomaly identification. Against backgrounds with strong reflections on vehicle surfaces or complex paint colors, this method exhibits stronger discriminative power and robustness.

[0104] 5. A dynamic segmentation threshold is set using a combination of the mean and standard deviation of outlier metrics to achieve adaptive binarization of the image. Compared to traditional image segmentation methods using Otsu's method, fixed thresholds, or gradient methods, this method is better able to adapt to regional differences with varying polarization characteristics, improving the integrity and boundary accuracy of detectable damaged areas. This statistically driven binarization strategy reduces false positives and false negatives, and is particularly suitable for situations where vehicle damage areas are non-uniform and irregular in shape, laying a high-quality foundation for subsequent morphological processing and target extraction.

[0105] 6. By combining erosion-dilation operations and connected component labeling algorithms, isolated noise points in the initial segmentation results are cleaned up, and continuous regions are extracted as candidate vehicle damage areas. Further calculations are made of the centroid, area, bounding box, and anomaly features of each component to generate structured and traceable vehicle damage reports. Compared with existing deep learning black-box output or traditional edge detection, this method has high interpretability. The structured recognition method based on 8-neighborhood connectivity facilitates integration with subsequent rule engines or manual review systems, enabling truly engineered, controllable, and quantifiable intelligent vehicle damage recognition. Attached Figure Description

[0106] Figure 1 This is a schematic diagram of the process of the present invention. Detailed Implementation

[0107] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0108] Example, refer to Figure 1 A computer vision-based vehicle damage detection and recognition method includes:

[0109] Set the camera imaging plane as the image coordinate system, select the pixel coordinate range, calibrate the zero-degree direction of the polarizer, fix the polarizer to the rotatable device and set the preset polarization angle set, and combine with a uniform diffuse light source to acquire images;

[0110] The polarizer is rotated to multiple preset angles, and grayscale images of the corresponding polarization angles are acquired and stored.

[0111] Based on grayscale images with multiple polarization angles, Stokes parameters are calculated for each pixel, including total intensity and linear polarization difference in different directions;

[0112] Based on the Stokes parameters, the degree of polarization and the non-negative polarization angle of each pixel are calculated;

[0113] Manually select a flat, undamaged rectangular reference area in the image, calculate its average degree of polarization, polarization angle, and standard deviation, and set the corresponding tolerance threshold.

[0114] The polarization degree and polarization angle of any pixel are compared with the reference value of the reference area, and its polarization anomaly is calculated by normalizing the difference and Euclidean norm.

[0115] Calculate the segmentation threshold based on the anomaly metric statistics of the whole image, and generate an initial binary mask for the suspected damaged area;

[0116] Noise is removed by erosion and dilation operations, connected regions are identified, effective components are screened and centroids, bounding boxes and anomaly features are extracted to form a candidate vehicle damage area detection report.

[0117] This paper proposes a complete computer vision-based framework for vehicle damage detection, covering the entire process from image acquisition, image processing, polarization feature extraction, anomaly detection, and candidate damage region output. The core of this approach lies in introducing polarization imaging and Stokes parameters to calculate the degree and angle of polarization for each pixel. By comparing the results with statistical features of undamaged regions, the degree of abnormal deviation for each pixel is calculated, followed by adaptive threshold binary segmentation. Combined with morphological operations and connected component analysis, this achieves accurate localization and structured description of suspected vehicle damage. Through these steps, this method solves the problems of traditional RGB image recognition, such as sensitivity to illumination, susceptibility to color interference, and feature blurring, making vehicle damage detection more robust and physically interpretable. The dimensionality provided by polarization features is far higher than that of texture or edge features, enabling accurate identification of dents or scratches even in uniformly colored or highly reflective areas of the vehicle body. The final detection report not only includes location but also quantifies the degree of damage, greatly improving the efficiency and reliability of automated assessment and subsequent processing.

[0118] The process of setting the camera imaging plane as the image coordinate system, selecting the pixel coordinate range, calibrating the zero-degree direction of the polarizer, fixing the polarizer to the rotatable device and setting a preset polarization angle set, and acquiring images in conjunction with a uniformly diffused light source specifically includes:

[0119] Set the camera imaging plane as the image coordinate system, and represent pixel coordinates as follows: ;in, These are the pixel column coordinates, with a value range of [value range missing]. , This represents the number of horizontal pixels in the original image. Here are the pixel row coordinates, with values ​​ranging from 1 to 2. , Define the vertical pixel count of the original image; specify the image coordinate range for all subsequent calculations.

[0120] Let the set of pixels of the entire image be denoted as ; Serves as an index set for looping and statistics, unifying subsequent traversal;

[0121] The zero-degree direction is calibrated on a linear rotatable polarizer, corresponding to the polarization angle. ;

[0122] The polarizer is placed firmly against the camera lens and fixed to a rotatable device, allowing it to rotate precisely to the following four angles:

[0123] ;in, This is a set of preset polarizer rotation angles; For the first A preset polarization angle, The range of values ​​is Determine the four discrete polarization directions and use indexing. Correspondingly, ensure that the grayscale acquisition angle is consistent;

[0124] Image acquisition is performed using a uniform diffuse light source. During the acquisition process, the position and orientation of the camera and the surface of the vehicle being tested are kept still to eliminate the influence of uneven illumination on polarization characteristics and improve detection robustness. This ensures the comparability of data from four acquisitions under the same viewpoint and orientation.

[0125] The initialization settings of the image acquisition system were refined, including mapping the camera imaging plane to a pixel coordinate system, setting the polarizer to zero-degree orientation and fixing it to a rotatable device, and setting multiple polarization acquisition angles. This establishes a unified and stable spatial reference for image processing before shooting, while avoiding inconsistencies in detection caused by angle deviations and uneven lighting in traditional image acquisition. By using a uniform diffused light source and fixing the camera and vehicle body posture, interference caused by ambient light fluctuations was eliminated, ensuring high consistency among the acquired polarization images. This setting provides rigorous experimental control conditions for the subsequent accurate calculation of Stokes parameters and polarization characteristics. Especially in complex real-world environments (such as outdoors or in a repair shop), this setting ensures the reliability and repeatability of the algorithm, significantly improving the practicality and robustness of the entire system.

[0126] The step of rotating the polarizer to multiple preset angles, acquiring and storing grayscale images of the corresponding polarization angles, specifically includes:

[0127] For any pixel At the polarization angle The grayscale value collected below is denoted as ;in, The normalized value is the original 8-bit grayscale value of the camera divided by 255, corresponding to the polarization angle. ;

[0128] Rotate the polarizer to Collect a grayscale image, denoted as ;

[0129] Rotate the polarizer to Collect a grayscale image, denoted as ;

[0130] Rotate the polarizer to Collect a grayscale image, denoted as ;

[0131] Rotate the polarizer to Collect a grayscale image, denoted as ;

[0132] grayscale image Stored in the database; providing raw input data for subsequent calculations of Stokes parameters and polarization characteristics.

[0133] The specific operational procedures for acquiring grayscale images at different polarization angles were clarified. By precisely rotating the polarizer to four different angles and acquiring images separately, input data for subsequent Stokes parameter calculations was obtained. Image normalization processing and data storage management ensured data consistency and traceability. This step effectively solved the limitations of traditional single-image processing in terms of insufficient feature dimensions. Multi-angle grayscale images provide multiple sets of reflection information for each pixel, enabling the construction of complete polarization response features. Furthermore, this method does not rely on external calibration boards or prior models, thus exhibiting good adaptability to different vehicle models and paint materials. Its direct benefit is improved accuracy in polarization feature extraction, thereby providing high-quality input for subsequent anomaly detection.

[0134] The calculation of Stokes parameters for each pixel based on multiple polarization angle grayscale images specifically includes:

[0135] For each pixel ,calculate:

[0136] ;

[0137] ;

[0138] ;

[0139] in, Total strength; In order to be in Linear polarization difference in the direction; In order to be in Linear polarization difference in direction; physically interpretable polarization intensity parameters are extracted from four polarization grayscale images, laying the foundation for the calculation of polarization degree and polarization angle.

[0140] This method calculates the Stokes parameter for each pixel using four grayscale images of polarization angles. This parameter is a core indicator in polarization analysis and has a clear physical meaning. This processing step maps the original image data to a physical feature space, providing a foundation for subsequent calculations of polarization degree and angle. With the Stokes parameter, changes in reflectivity caused by indentations or scratches on a material surface can be accurately distinguished, thus achieving microscopic-level image feature enhancement. Compared to traditional feature extraction methods such as edge detection or SIFT algorithms, this method has stronger interpretability in optical reflection modeling, and is particularly suitable for highly reflective surfaces such as metals and car paint.

[0141] The calculation of the polarization degree and non-negative polarization angle of each pixel based on Stokes parameters specifically includes:

[0142] For each pixel Calculate the degree of polarization :

[0143] ;in, To prevent division by zero constants, it is recommended to take a value of [value to be filled in]. ;Quantitatively characterize the degree of polarization of pixel rays;

[0144] when When, the light is completely unpolarized; when At that time, the light rays are completely linearly polarized;

[0145] For each pixel Calculate the polarization angle :

[0146] ;in, For the binocular arctangent function, for the input Return value range ,satisfy ; Obtain the main polarization direction of the pixel in radians and distinguish the quadrants;

[0147] Will Mapped to nonnegative values Specifically:

[0148] Unify the polarization angle to This facilitates subsequent statistics and deviation calculations.

[0149] This step further calculates the degree of polarization and polarization angle of each pixel based on the Stokes parameters. The degree of polarization reflects the extent of light polarization, while the polarization angle represents the dominant polarization direction. To prevent division by zero errors in mathematical calculations, a suppression constant is introduced into the algorithm design. By unifying the polarization angle to a non-negative range, subsequent deviation calculations and statistical analysis become more convenient and stable. Through this step, a polarization fingerprint of each pixel in space is effectively established, making regions of different materials, structures, and states distinguishable in terms of polarization characteristics. Especially when there are slight dents or scratches on the vehicle surface, the polarization angle often changes, which is difficult to perceive with the naked eye or ordinary cameras. Therefore, this method can significantly improve the sensitivity to the perception of micro-damage.

[0150] The process involves manually selecting a flat, undamaged rectangular reference region from the image, calculating its average degree of polarization, polarization angle, and standard deviation, and setting corresponding tolerance thresholds. Specifically, this includes:

[0151] Artificial pre-image Select a small rectangular area on the car body that has been confirmed to be flat, without scratches, and without dents, and denote it as... ;in, The coordinates of the top left corner of this area; This is the width of the area; The height of the region; the total number of pixels in the region. Select a flat, undamaged area of ​​the vehicle body as the reference for subsequent polarization characteristics.

[0152] exist Inside, collect all pixels polarization value And calculate the average polarization degree of the reference region respectively. and the standard deviation of polarization degree in the reference region :

[0153] ;

[0154] ;

[0155] The average polarization degree and dispersion of the reference region are calculated for adaptive tolerance.

[0156] exist Inside, collect all pixels non-negative polarization angle And calculate the average polarization angle of the reference region respectively. and the standard deviation of polarization angle in the reference region :

[0157] ;

[0158] ;

[0159] Calculate the average polarization angle and dispersion of the reference region for subsequent deviation thresholding;

[0160] Set the polarization tolerance threshold to ;

[0161] Set the polarization angle tolerance threshold to ;

[0162] Determine the normal fluctuation range of polarization degree and polarization angle; anything exceeding this range is considered abnormal.

[0163] This step employs a "reference lossless region" selection mechanism to dynamically model the normal polarization state in the current image. A confirmed lossless region is manually selected within the image, and the mean and standard deviation of the polarization degree and polarization angle of its pixels are calculated and set as the baseline and tolerance threshold for the entire image. The advantage of this step is that it avoids the failure of fixed thresholds caused by differences in vehicle color and lighting conditions through adaptive modeling within the image. Compared to external sample models or neural network training methods, this approach requires no pre-training, is unaffected by training data offsets, and exhibits strong adaptability and good generalization ability. Furthermore, it provides a clear reference for subsequent anomaly measurement, greatly enhancing the algorithm's robustness.

[0164] The step of comparing the polarization degree and polarization angle of any pixel with the reference value of the reference area, and calculating its polarization anomaly degree by normalizing the difference and Euclidean norm, specifically includes:

[0165] For any pixel Calculate its degree of polarization and the average degree of polarization of the reference region. absolute deviation ;Measures the deviation of pixel polarization degree from the normal reference;

[0166] For any pixel First, obtain the non-negative polarization angle of the pixel. Then calculate the absolute deviation with wrap correction. Specifically:

[0167] ; Calculate the minimum polarization angle deviation after surround correction, and quantize the direction deviation;

[0168] Calculate the polarization degree normalized to ;

[0169] Calculate the normalized polarization angle as ;

[0170] Unify the two deviations to Intervals are easy to merge;

[0171] The normalized metrics are combined according to the Euclidean norm to obtain the overall pixel anomaly metric. for:

[0172] It comprehensively reflects the degree of deviation of pixels in both degree and angle, providing a basis for binarization;

[0173] like and ,but , , This indicates that the pixel is completely consistent with the reference area;

[0174] like and ,but , , This indicates that the pixel deviates the maximum from the reference area.

[0175] By calculating the normalized differences in polarization degree and polarization angle between each pixel and the reference area, and synthesizing them using the Euclidean norm, an "anomaly" index at a single scale is obtained. Its design considers the circumferential nature of the polarization angle, avoiding calculation errors caused by angular periodicity. This step achieves sensitive detection of damaged areas by precisely quantifying the deviation of each pixel. Traditional methods often rely on grayscale differences and are easily affected by surface illumination; however, the polarization anomaly index measures differences in vehicle surface structure from a physical reflection perspective, thus maintaining a high recognition rate even under complex lighting conditions or with varying paint colors. This method improves detection accuracy, sensitivity, and anti-interference capabilities.

[0176] The step of calculating the segmentation threshold based on the full-image anomaly metric statistics and generating an initial binary mask for the suspected damaged region specifically includes:

[0177] exist Inside, for each pixel of Form a set And calculate the average anomaly measure respectively. and the standard deviation of anomaly measurement :

[0178] ;

[0179] ;

[0180] Calculate the mean and standard deviation of the overall anomaly degree of the reference area, which are used for binarization thresholding;

[0181] Set the pixel binarization threshold to Determine the boundary value for normal / abnormal pixel division;

[0182] For the entire image pixels Generate an initial binary mask Specifically:

[0183] Initially mark all pixels with polarization aberrations to prepare for morphological denoising;

[0184] like , representing pixels This is suspected to be an injury;

[0185] like , representing pixels This is normal.

[0186] By statistically analyzing the distribution of pixel anomalies across the entire image, the mean and standard deviation are calculated, and a dynamic segmentation threshold is then set to generate an initial binary mask for suspected damaged areas. This threshold setting method, based on image statistical characteristics, balances accuracy and adaptability, avoiding false positives and false negatives. Its beneficial effects are primarily reflected in its strong adjustability and data-driven nature, adapting to the differences in polarization characteristic distributions under different vehicles and environments, automatically completing the initial screening of normal / abnormal pixels, and providing a clear and clean input foundation for subsequent morphological processing and region extraction. This is more robust than fixed threshold methods and more suitable for the highly structured polarization feature data in this scheme than traditional image histogram methods.

[0187] The process employs erosion and dilation operations to remove noise, identify connected regions, screen effective components, and extract centroid, bounding box, and anomaly features to generate a candidate vehicle damage area detection report. Specifically, this includes:

[0188] set up Cross-shaped neighborhood structural element for:

[0189] Define the shape and extent of the erosion / expansion neighborhood;

[0190] in, The relative pixel offset within the structuring element;

[0191] For the initial binary mask Calculate corrosion results , Among them, indexes that exceed the boundary. Treat it as 0, that is Remove isolated noise points smaller than the structuring element size;

[0192] Corrosion results Calculate the expansion results :

[0193] , Restoring the approximate shape of the eroded connected regions while maintaining noise removal effectiveness;

[0194] Set the final denoised binary mask , Generate the final denoising mask for connected component analysis;

[0195] Traversal According to the 8-neighborhood connectivity rule, all points with a pixel value of 1 are labeled as connected components to obtain a set of connected components. ;in, For the first A connected component, for in The set of all connected pixel coordinates with a value of 1; The total number of connected components represents the number of all detected candidate regions; grouping connected regions in the binary image provides units for region feature extraction.

[0196] The 8-neighborhood connectivity is defined as if two pixels are connected. and satisfy and If they are in the same connected component;

[0197] For each connected component Calculate pixel area , ; Calculate the number of pixels in each connected component to describe the region size and subsequent filtering;

[0198] Area of ​​all connected components Form a set and calculate its median. :

[0199] ;in, This is the median function. After sorting the input set of values, it takes the median value. If the number of elements is even, it takes the average of the two middle values. The result is an integer or a real number, representing the median level of the area of ​​the connected components.

[0200] Set the minimum effective area threshold to ;

[0201] The minimum effective area is adaptively set based on the median component area to filter out low-noise components.

[0202] For each component :

[0203] like If the component is not identified as noise, it is considered to be discarded.

[0204] like If so, the component is retained and added to the final candidate set;

[0205] For each connected component that is retained Calculate the following features:

[0206] S1, pixel centroid coordinates :

[0207] ;in, For components Centroid column coordinates; For components Centroid coordinates;

[0208] S2, coordinates of the two-dimensional bounding box :

[0209] , ;

[0210] , ;

[0211] in, For components Minimum column coordinates; For components Maximum column coordinate; For components Minimum row coordinate; For components Maximum row coordinate;

[0212] S3. Calculate the average outlier With maximum anomaly :

[0213] , ;

[0214] Each retained component The feature-generated detection report entries include the component number. Centroid coordinates Pixel area 2D bounding box coordinates Average outlier With maximum anomaly It provides complete localization and quantification information for each detected hypothetical damage area, facilitating subsequent assessment and treatment.

[0215] By employing morphological operations of erosion and dilation, isolated noise points are removed, and connected regions are extracted using the 8-neighborhood rule, ultimately forming clear candidate vehicle damage areas. For each connected component, information such as its centroid, bounding box, area, and average / maximum anomaly degree is further extracted to generate a standardized inspection report. This step effectively transforms pixel-level anomalies into region-level damage, making vehicle damage results quantifiable, locatable, and auditable, suitable for automated report generation and human-computer interaction systems. In particular, by adaptively setting the minimum effective component filtering threshold using the median area, small-area interference can be effectively eliminated, ensuring the practicality and accuracy of the results and improving the overall system's applicability in actual business processes.

[0216] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0217] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A computer vision-based vehicle damage detection and identification method, characterized in that, include: Set the camera imaging plane as the image coordinate system, select the pixel coordinate range, calibrate the zero-degree direction of the polarizer, fix the polarizer to the rotatable device and set the preset polarization angle set, and combine with a uniform diffuse light source to acquire images; The process of setting the camera imaging plane as the image coordinate system, selecting the pixel coordinate range, calibrating the zero-degree direction of the polarizer, fixing the polarizer to the rotatable device and setting a preset polarization angle set, and acquiring images in conjunction with a uniformly diffused light source specifically includes: The camera imaging plane is set as an image coordinate system, and a pixel coordinate is represented as ; wherein, is a pixel column coordinate, and the value range is , is a horizontal pixel number of the original image; is a pixel row coordinate, and the value range is , is a vertical pixel number of the original image; Let the set of pixels of the entire image be denoted as ; The zero-degree direction is calibrated on a linear rotatable polarizer, corresponding to the polarization angle. ; The polarizer is placed firmly against the camera lens and fixed to a rotatable device, allowing it to rotate precisely to the following four angles: ;in, This is a set of preset polarizer rotation angles; For the first A preset polarization angle, The range of values ​​is ; Image acquisition is performed using a uniform diffused light source. During the acquisition process, the position and orientation of the camera and the surface of the vehicle being measured are kept still. The polarizer is rotated to multiple preset angles, and grayscale images of the corresponding polarization angles are acquired and stored. The step of rotating the polarizer to multiple preset angles, acquiring and storing grayscale images of the corresponding polarization angles, specifically includes: For any pixel At the polarization angle The grayscale value collected below is denoted as ;in, The normalized value is the original 8-bit grayscale value of the camera divided by 255, corresponding to the polarization angle. ; Rotate the polarizer to Collect a grayscale image, denoted as ; Rotate the polarizer to Collect a grayscale image, denoted as ; Rotate the polarizer to Collect a grayscale image, denoted as ; Rotate the polarizer to Collect a grayscale image, denoted as ; grayscale image Store in the database; Based on grayscale images with multiple polarization angles, Stokes parameters are calculated for each pixel, including total intensity and linear polarization difference in different directions; The calculation of Stokes parameters for each pixel based on multiple polarization angle grayscale images specifically includes: For each pixel ,calculate: ; ; ; in, Total strength; In order to be in Linear polarization difference in the direction; In order to be in Linear polarization difference in the direction; Based on the Stokes parameters, the degree of polarization and the non-negative polarization angle of each pixel are calculated; The calculation of the polarization degree and non-negative polarization angle of each pixel based on Stokes parameters specifically includes: For each pixel Calculate the degree of polarization : ;in, To prevent division by zero constant; when When, the light is completely unpolarized; when At that time, the light rays are completely linearly polarized; For each pixel Calculate the polarization angle : ;in, For the binocular arctangent function, for the input Return value range ,satisfy ; Will Mapped to nonnegative values Specifically: ; Artificial pre-image Select a small rectangular area on the car body that has been confirmed to be flat, without scratches, and without dents as a reference area, denoted as: ;in, The coordinates of the top left corner of this area; This is the width of the area; The height of the region; the total number of pixels in the region. ; exist Inside, collect all pixels polarization value And calculate the average polarization degree of the reference region. : ; exist Inside, collect all pixels non-negative polarization angle And calculate the average polarization angle of the reference region. : ; The polarization degree and polarization angle of any pixel are compared with the reference value of the reference area, and its polarization anomaly is calculated by normalizing the difference and Euclidean norm. The reference region reference values ​​include the average polarization degree and the average polarization angle of the reference region. Calculate the segmentation threshold based on the anomaly metric statistics of the whole image, and generate an initial binary mask for the suspected damaged area; Noise is removed by erosion and dilation operations, connected regions are identified, effective components are screened and centroids, bounding boxes and anomaly features are extracted to form a candidate vehicle damage area detection report.

2. The vehicle damage detection and recognition method based on computer vision according to claim 1, characterized in that, The step of comparing the polarization degree and polarization angle of any pixel with the reference value of the reference area, and calculating its polarization anomaly degree by normalizing the difference and Euclidean norm, specifically includes: For any pixel Calculate its degree of polarization and the average degree of polarization of the reference region. absolute deviation ; For any pixel First, obtain the non-negative polarization angle of the pixel. Then calculate the absolute deviation with wrap correction. Specifically: ; Calculate the degree of polarization normalized to ; Calculate the normalized polarization angle as ; The normalized metrics are combined according to the Euclidean norm to obtain the overall pixel anomaly metric. for: ; like and ,but , , This indicates that the pixel is completely consistent with the reference area; like and ,but , , This indicates that the pixel deviates the maximum from the reference area.

3. The vehicle damage detection and recognition method based on computer vision according to claim 2, characterized in that, The step of calculating the segmentation threshold based on the full-image anomaly metric statistics and generating an initial binary mask for the suspected damaged region specifically includes: exist Inside, for each pixel of Form a set And calculate the average anomaly measure respectively. and the standard deviation of anomaly measurement : ; ; Set the pixel binarization threshold to ; For the entire image pixels Generate an initial binary mask Specifically: ; like , representing pixels This is suspected to be an injury; like , representing pixels This is normal.

4. The vehicle damage detection and recognition method based on computer vision according to claim 3, characterized in that, The process employs erosion and dilation operations to remove noise, identify connected regions, screen effective components, and extract centroid, bounding box, and anomaly features to generate a candidate vehicle damage area detection report. Specifically, this includes: set up Cross-shaped neighborhood structural element for: ; in, The relative pixel offset within the structuring element; For the initial binary mask Calculate corrosion results , Among them, indexes that exceed the boundary. Treat it as 0, that is ; Corrosion results Calculate the expansion results : , ; Set the final denoised binary mask , ; Traversal According to the 8-neighborhood connectivity rule, all points with a pixel value of 1 are labeled as connected components to obtain a set of connected components. ;in, For the first A connected component, for in The set of all connected pixel coordinates with a value of 1; The total number of connected components represents the number of all detected candidate regions; The 8-neighborhood connectivity is defined as if two pixels are connected. and satisfy and If they are in the same connected component; For each connected component Calculate pixel area , ; Area of ​​all connected components Form a set and calculate its median. : ;in, This is the median function. After sorting the input set of values, it takes the median value. If the number of elements is even, it takes the average of the two middle values. The result is an integer or a real number, representing the median level of the area of ​​the connected components. Set the minimum effective area threshold to ; For each component : like If the component is not identified as noise, it is considered to be discarded. like If so, the component is retained and added to the final candidate set; For each connected component that is retained Calculate the following features: S1, pixel centroid coordinates : ;in, For components Centroid column coordinates; For components Centroid coordinates; S2, coordinates of the two-dimensional bounding box : , ; , ; in, For components Minimum column coordinates; For components Maximum column coordinate; For components Minimum row coordinate; For components Maximum row coordinate; S3. Calculate the average outlier With maximum anomaly : , ; Each retained component The feature-generated detection report entries include the component number. Centroid coordinates Pixel area 2D bounding box coordinates Mean outlier and maximum outlier .

Citation Information

Patent Citations

  • Method for detecting surface and inner defects of bent glass

    CN110044932A

  • Laser additive manufacturing workpiece surface defect detection method

    CN115170485A