Method for positioning three-dimensional coordinates of paint defects, medium and device

By constructing 2D-3D feature point pairs and using dynamic weight fusion, the problems of low efficiency, poor accuracy, and limited precision in the detection of automotive paint defects in existing technologies are solved, and efficient and low-cost three-dimensional coordinate positioning is achieved.

CN121921378BActive Publication Date: 2026-06-02SPEEDBOT ROBOTICS CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SPEEDBOT ROBOTICS CO LTD
Filing Date
2026-03-26
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing technologies are inefficient, inaccurate, incompatible, and have limited precision when detecting defects in automotive paint, and the equipment is expensive and poses safety risks.

Method used

By acquiring and calibrating 2D images of the vehicle body, extracting 2D feature points and matching them with the prior 3D point cloud of the vehicle body, 2D-3D feature point pairs are constructed. The transformation matrix is ​​solved by minimizing the projection error, and the weight coefficients are calculated by combining the reprojection error and the point cloud registration error. Multiple methods are integrated to obtain the optimal transformation matrix, and finally the defect points are mapped to three-dimensional coordinates.

Benefits of technology

It improves detection efficiency and accuracy, reduces equipment costs, enhances the robustness and adaptability of the system, avoids positioning errors caused by the failure of a single method, and achieves high-precision defect coordinate positioning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121921378B_ABST
    Figure CN121921378B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of paint defects three-dimensional coordinate positioning method, medium and equipment, by constructing several 2D-3D feature points;Solving the first conversion matrix between each acquisition equipment coordinate system and vehicle body coordinate system, re-projection error value, second conversion matrix, inner point proportion and inner point root mean square error;Fusion re-projection error value, inner point proportion and inner point root mean square error, obtain basic weight coefficient, to obtain the optimal transformation matrix between vehicle body coordinate system and each acquisition equipment coordinate system according to basic weight coefficient;Create virtual scene, and import virtual acquisition equipment and automobile model;Collect several groups of current vehicle body 2D image, and obtain the defect point coordinates under each acquisition equipment coordinate system, according to optimal transformation matrix it is mapped to automobile model, obtains the three-dimensional coordinates of defect point.Improve the problems such as low efficiency, poor accuracy, insufficient compatibility and limited precision when detecting automobile paint defects in prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine vision technology, and in particular to a method, medium, and device for three-dimensional coordinate localization of paint surface defects. Background Technology

[0002] In the automotive manufacturing industry, the painting process is a crucial step in ensuring the aesthetics and quality of the vehicle body. The quality of the paint job directly affects performance indicators such as wear resistance and corrosion resistance. However, traditional manual inspection methods suffer from drawbacks such as visual fatigue, subjective misjudgment, low efficiency, and poor working environments, limiting production quality and efficiency. With the development of computer vision, the industry now largely adopts automated inspection methods, such as robotic arms carrying cameras and light sources, to identify and locate defects on the vehicle body surface. However, the aforementioned inspection methods still have many problems:

[0003] 1. High equipment cost: A single robotic arm is insufficient to cover the entire vehicle, requiring the deployment of multiple robotic arms to work together to complete a comprehensive scan, resulting in high overall system costs and limiting its promotion and application in small and medium-sized enterprises.

[0004] 2. Limited inspection efficiency: The vehicle body must remain stationary during the inspection process, and the robotic arm needs to take pictures point by point along a preset path. The overall process takes a long time and cannot match the production pace of modern high-speed production lines.

[0005] 3. System safety risks exist: The collaborative operation of multiple robotic arms relies on complex communication protocols and command scheduling mechanisms. Once a communication abnormality or command conflict occurs, it is very easy to cause collision accidents between robotic arms or between robotic arms and the vehicle body, resulting in serious economic losses.

[0006] 4. Limited positioning accuracy: The robotic arm solution has accumulated errors in joint movement, and the tunnel solution relies on the slide rail encoder to calculate the vehicle body position, both of which will lead to deviations in defect coordinate positioning; moreover, feature point matching of a single frame image is easily interfered with, and the accuracy of three-dimensional coordinate mapping is insufficient.

[0007] Therefore, how to improve the existing technology's low efficiency, poor accuracy, insufficient compatibility, and limited precision in detecting defects in automotive paint is a technical problem that urgently needs to be solved in this field. Summary of the Invention

[0008] Based on this, the purpose of this application is to provide a method, medium, and device for three-dimensional coordinate positioning of paint surface defects, so as to solve at least one of the technical problems mentioned in the background art.

[0009] Firstly, this application provides a method for three-dimensional coordinate localization of paint surface defects, including:

[0010] Several sets of calibrated vehicle body 2D images are collected, several 2D feature points are extracted from each set of images, and matched with the vehicle body prior 3D point cloud to construct several 2D-3D feature point pairs;

[0011] Based on feature point pairs, the first transformation matrix between the coordinate systems of each acquisition device and the vehicle body coordinate system is solved by minimizing the projection error, and the reprojection error value is calculated; 3D reconstruction is performed on each 2D image to obtain the point cloud to be registered, and the point cloud to be registered and the prior 3D point cloud of the vehicle body are registered using the first transformation matrix as the initial value to obtain the second transformation matrix between the coordinate systems of each acquisition device and the vehicle body coordinate system, and the interior point ratio and the root mean square error of the interior points are calculated;

[0012] By fusing the reprojection error value, the proportion of interior points and the root mean square error of interior points, the basic weight coefficient is obtained. The first transformation matrix and the second transformation matrix are then weighted and fused according to the basic weight coefficient to obtain the optimal transformation matrix between the vehicle coordinate system and the coordinate systems of each acquisition device.

[0013] Create a virtual scene and import the virtual acquisition devices and car models based on the prior intrinsic and extrinsic parameter matrices of each acquisition device and the optimal transformation matrix between the vehicle coordinate system and the coordinate system of each acquisition device.

[0014] Several sets of current 2D images of the vehicle body are acquired, and the coordinates of the defect points in the coordinate system of each acquisition device are obtained. The defect points are then mapped to the vehicle model according to the optimal transformation matrix to obtain the three-dimensional coordinates of the defect points.

[0015] Furthermore, the step of fusing the reprojection error value, the proportion of interior points, and the root mean square error of interior points to obtain the basic weighting coefficients includes:

[0016] The reprojection score is determined based on the reprojection error value; the point cloud registration score is determined based on the proportion of interior points and the root mean square error of interior points.

[0017] Determine whether the sum of the reprojection composite score and the point cloud registration composite score is 0, or whether the point cloud registration composite score is less than the composite score threshold. If yes, use the reprojection composite score as the base weighting coefficient; otherwise:

[0018] Determine if the reprojection composite score is less than the composite score threshold. If so, use the point cloud registration composite score as the base weighting coefficient; otherwise:

[0019] The sum of the reprojection score and the point cloud registration score is used to obtain the overall score.

[0020] Obtain the ratio of the reprojection composite score to the total composite score to get the basic weight coefficient.

[0021] Furthermore, the steps for determining the overall reprojection score based on the reprojection error value include:

[0022] Normalize the reprojection error value to obtain the unit reprojection error;

[0023] The difference between the upper limit of reprojection error and the unit reprojection error is obtained to obtain the reprojection error margin;

[0024] The ratio between the reprojection error margin and the reprojection error upper limit is used to obtain the overall reprojection score.

[0025] The steps for determining the overall score of point cloud registration based on the proportion of interior points and the root mean square error of interior points include:

[0026] Normalize the in-point root mean square error to obtain the unit root mean square error;

[0027] The difference between the upper limit of the root mean square error and the unit root mean square error is obtained to get the root mean square error margin.

[0028] The ratio between the root mean square error margin and the root mean square error upper limit is used to obtain the matching accuracy value.

[0029] The point cloud registration comprehensive score is obtained by weighting and summing the matching accuracy value and the proportion of interior points based on the prior matching accuracy weight and robustness weight.

[0030] Furthermore, before the step of obtaining the difference between the upper limit of the reprojection error and the unit reprojection error to obtain the reprojection error margin, the following steps are included:

[0031] If the unit reprojection error is greater than the upper limit of the reprojection error, the first adjustment value is used as the reprojection error margin; if the unit reprojection error is less than 0, the second adjustment value is used as the reprojection error margin.

[0032] Before obtaining the root mean square error margin by calculating the difference between the upper limit of the root mean square error and the unit root mean square error, the following steps are included:

[0033] If the unit root mean square error is greater than the upper limit of the root mean square error, the first adjustment value is used as the root mean square error margin; if the unit root mean square error is less than 0, the second adjustment value is used as the root mean square error margin.

[0034] Furthermore, the step of weighting and fusing each first transformation matrix and second transformation matrix according to the basic weight coefficients to obtain the optimal transformation matrix between the vehicle coordinate system and the coordinate systems of each acquisition device includes:

[0035] Decompose each of the first transformation matrix and the second transformation matrix to obtain several first translation vectors, first rotation matrices, second translation vectors, and second rotation matrices;

[0036] Convert each rotation matrix into a quaternion to obtain several first quaternions and second quaternions;

[0037] Based on the basic weights, the first quaternion and the second quaternion are weighted and summed to obtain several optimal quaternions; based on the basic weights, the first translation vector and the second translation vector are weighted and summed to obtain several optimal translation vectors.

[0038] By restoring the optimal quaternions, several optimal rotation matrices are obtained. Then, by concatenating the optimal translation vectors and the corresponding optimal rotation matrices, the optimal transformation matrix between the vehicle coordinate system and the coordinate systems of each acquisition device is obtained.

[0039] Further, the steps for obtaining the coordinates of defect points in each set of 2D images under the coordinate system of each acquisition device include:

[0040] Traverse and determine whether there are defect points in each 2D image. If so, obtain several adjacent 2D images of the 2D image as neighborhood images.

[0041] The coordinates of the defect points in each neighboring image are obtained so that the moving speed of the defect points can be determined based on the acquisition time interval of the acquisition device and the vehicle's moving direction.

[0042] The difference between the moving speed of the defect point and the preset moving speed of the vehicle body is obtained, and it is determined whether it is greater than the speed threshold. If it is, the corresponding defect point is removed; otherwise, it is determined to be a defect point.

[0043] Furthermore, after obtaining the coordinates of the defect points in each neighboring image, the process also includes:

[0044] Obtain the maximum and minimum coordinates of the defect point in the vertical direction of the vehicle's movement direction, and obtain the difference between the two. Determine whether the difference is greater than a threshold. If it is, remove the corresponding defect point; otherwise, determine that it is a defect point.

[0045] Furthermore, after obtaining the three-dimensional coordinates of the defect point, it also includes:

[0046] Set the neighborhood size and obtain the coordinates of all points within the set neighborhood of each defect point in the car model to construct the covariance matrix;

[0047] Eigenvalue decomposition is performed on the covariance matrix corresponding to each defect point in the car model to obtain several eigenvalues ​​and eigenvectors corresponding to each defect point.

[0048] Obtain the minimum eigenvalue corresponding to each defect point in the car model, and use the eigenvector corresponding to the minimum eigenvalue as the normal vector of each defect point in the car model.

[0049] Secondly, this application also provides a computer storage medium storing executable program code; the executable program code is used to execute the three-dimensional coordinate positioning method for paint surface defects as described in any one of the first aspects.

[0050] Thirdly, this application also provides a terminal device, including a memory and a processor; the memory stores program code that can be executed by the processor; the program code is used to execute the three-dimensional coordinate positioning method for paint surface defects as described in any one of the first aspects.

[0051] This application provides a method, medium, and device for three-dimensional coordinate localization of paint defects. The method involves acquiring several sets of calibrated 2D images of the vehicle body, extracting several 2D feature points from each set of images, and matching these points with the vehicle body's prior 3D point cloud to construct several 2D-3D feature point pairs. Based on these feature point pairs, the method solves for the first transformation matrix between the coordinate systems of each acquisition device and the vehicle body coordinate system by minimizing the projection error, and calculates the reprojection error value. The method then performs three-dimensional reconstruction on each 2D image to obtain a point cloud to be registered. Using the first transformation matrix as the initial value, the method performs point cloud registration with the prior 3D point cloud of the vehicle body to obtain a second transformation matrix between the coordinate systems of each acquisition device and the vehicle body coordinate system, and calculates the interior points. The system calculates the proportion and root mean square error of interior points; it fuses the reprojection error value, interior point proportion, and interior point root mean square error to obtain basic weighting coefficients. These coefficients are then used to weight and fuse the first and second transformation matrices to obtain the optimal transformation matrix between the vehicle coordinate system and the coordinate systems of each acquisition device. A virtual scene is created, and based on the prior intrinsic and extrinsic parameter matrices of each acquisition device and the optimal transformation matrix between the vehicle coordinate system and the coordinate systems of each acquisition device, the virtual acquisition devices and the vehicle model are imported. Several sets of current 2D images of the vehicle body are acquired, and the coordinates of defect points in the coordinate systems of each acquisition device are obtained. These coordinates are then mapped to the vehicle model using the optimal transformation matrix to obtain the 3D coordinates of the defect points. This method improves upon existing technologies that suffer from low efficiency, poor accuracy, insufficient compatibility, and limited precision in detecting automotive paint defects. Attached Figure Description

[0052] Figure 1 This is a flowchart of a three-dimensional coordinate localization method for paint surface defects according to an embodiment of the present invention. Detailed Implementation

[0053] 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 a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0054] It should be noted that if the embodiments of the present invention involve directional indications, such as up, down, left, right, front, back, etc., these directional indications are only used to explain the relative positional relationships and movement of the components in a specific posture. If the specific posture changes, the directional indications will also change accordingly. Furthermore, if the embodiments of the present invention involve descriptions such as "first," "second," "S1," "S2," "step one," "step two," etc., these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance, or implicitly indicating the number of technical features indicated or the execution order of the method. Those skilled in the art will understand that anything that does not violate the inventive concept should be included within the scope of protection of the present invention.

[0055] like Figure 1 As shown, the present invention provides a method for three-dimensional coordinate localization of paint surface defects, including:

[0056] S1: Collect several sets of calibrated vehicle body 2D images, extract several 2D feature points from each set of images, and match them with the vehicle body's prior 3D point cloud to construct several 2D-3D feature point pairs;

[0057] Specifically, but not limited to, several acquisition devices (such as industrial cameras) can be arranged at predetermined positions around the vehicle body. The movement of the vehicle to be calibrated or the acquisition devices can be controlled so that the acquisition devices can capture different areas of the vehicle body surface, thereby obtaining several sets of calibrated 2D images of the vehicle body. Subsequently, feature extraction algorithms (such as SIFT, ORB, etc.) or neural network models can be used to extract several 2D feature points (such as vehicle body contour corner points, positioning hole centers, etc.) from each set of images, and match them with a pre-built prior 3D point cloud of the vehicle body to construct several 2D-3D feature point pairs, providing a data foundation for subsequent coordinate system calibration.

[0058] S2: Based on feature point pairs, the first transformation matrix between the coordinate systems of each acquisition device and the vehicle body coordinate system is solved by minimizing the projection error, and the reprojection error value is calculated; 3D reconstruction is performed on each 2D image to obtain the point cloud to be registered, and the point cloud to be registered and the prior 3D point cloud of the vehicle body are registered using the first transformation matrix as the initial value to obtain the second transformation matrix between the coordinate systems of each acquisition device and the vehicle body coordinate system, and the interior point ratio and the root mean square error of the interior points are calculated;

[0059] Specifically, the following steps can be taken: First, based on the 2D-3D feature point pairs constructed in step S1, the Perspective-n-Point (PnP) algorithm is used to solve the initial transformation relationship between the coordinate systems of each acquisition device and the vehicle body coordinate system by minimizing the reprojection error. This is the first transformation matrix. At the same time, the reprojection error value is calculated to evaluate the quality of the initial solution. Then, 3D reconstruction is performed on each group of 2D images to generate a point cloud to be registered. Using the first transformation matrix as the initial pose, a point cloud registration algorithm (such as ICP and its variants) is used to perform fine registration between the point cloud to be registered and the prior 3D point cloud of the vehicle body, thereby obtaining a more accurate second transformation matrix. The inlier ratio and root mean square error of inlier points (InlierRMSE) during the registration process are statistically analyzed to quantify the accuracy and reliability of the point cloud registration.

[0060] S3: Combine the reprojection error value, the proportion of interior points and the root mean square error of interior points to obtain the basic weight coefficient. Then, weight and fuse each first transformation matrix and the second transformation matrix according to the basic weight coefficient to obtain the optimal transformation matrix between the vehicle coordinate system and the coordinate systems of each acquisition device.

[0061] Specifically, the reprojection error, inlier ratio, and root mean square error of inlier can be normalized and comprehensively scored to calculate the basic weight coefficients reflecting the reliability of the two transformation matrices. If the 2D-3D matching effect is better (small reprojection error), the first transformation matrix is ​​given a higher weight; if the 3D-3D registration effect is better (high inlier ratio and small root mean square error), the second transformation matrix is ​​given a higher weight. Finally, the first and second transformation matrices are weighted and fused using these weight coefficients to obtain the optimal transformation matrix that combines the advantages of both. Preferably, in actual industrial scenarios, there are differences in image quality (such as illumination and occlusion) and point cloud reconstruction quality (such as texture-deficient regions) under different acquisition perspectives, resulting in large fluctuations in the reliability of the transformation matrix obtained by a single method under different perspectives. This step achieves complementary advantages by dynamically fusing the calculation results of two independent paths: in regions with rich texture but simple geometric structure, the focus is on 2D-3D matching results; in regions with complex geometric structure but weak texture, the focus is on 3D-3D registration results. This adaptive weighting mechanism effectively avoids localization failure caused by abnormal single data source and significantly improves the robustness and localization accuracy of the system under various complex working conditions.

[0062] Preferably, the step of fusing the reprojection error value, the proportion of interior points, and the root mean square error of interior points to obtain the basic weighting coefficients includes:

[0063] S31: Determine the overall reprojection score based on the reprojection error value; determine the overall point cloud registration score based on the proportion of interior points and the root mean square error of interior points.

[0064] S32: Determine whether the sum of the reprojection comprehensive score and the point cloud registration comprehensive score is 0 or whether the point cloud registration comprehensive score is less than the comprehensive score threshold. If yes, use the reprojection comprehensive score as the base weighting coefficient; otherwise:

[0065] S33: Determine if the reprojection composite score is less than the composite score threshold. If yes, use the point cloud registration composite score as the base weighting coefficient; otherwise:

[0066] S34: Obtain the sum of the reprojection comprehensive score and the point cloud registration comprehensive score to get the total comprehensive score;

[0067] S35: Obtain the ratio of the reprojection composite score to the total composite score to obtain the basic weight coefficient.

[0068] Specifically, the accuracy of the first and second transformation matrices can be quantified separately to obtain the reprojection composite score and the point cloud registration composite score. A logical judgment mechanism is introduced: if the point cloud registration fails completely (score too low or total score of 0), the first transformation matrix is ​​fully trusted; conversely, if the accuracy of the first transformation matrix is ​​too low, the second transformation matrix is ​​fully trusted. When the accuracy of both is acceptable, the weighting coefficient can be determined by calculating the proportion of the reprojection score in the total score, achieving smooth dynamic adjustment. Preferably, this logical branch design greatly enhances the system's fault tolerance. In extreme cases (such as point cloud reconstruction failure or feature point matching error at a certain viewpoint), the system can automatically switch to a reliable single data source, avoiding the deterioration of results caused by the fusion of erroneous data. Under normal operating conditions, the proportional weighting method can delicately reflect the relative reliability of the two methods, ensuring that the optimal transformation matrix always tends towards the one with higher accuracy, thus improving the stability and adaptability of the overall positioning system.

[0069] For example, the basic weighting coefficients can be calculated according to Equation 3-1:

[0070] 3-1;

[0071] in, Based on the weighting coefficient, The overall score is determined by reprojection. The overall score is used for point cloud registration. The preferred score is when... When this happens, it means the PnP algorithm has failed. Equation 3-1 is ignored, and we directly set... 0, when When this occurs, it indicates that the ICP algorithm has failed. Equation 3-1 is ignored, and the algorithm is directly set to... 1.

[0072] Preferably, the step of determining the overall reprojection score based on the reprojection error value includes:

[0073] S311: Normalized reprojection error value, yielding unit reprojection error;

[0074] S312: Obtain the difference between the upper limit of reprojection error and the unit reprojection error to get the reprojection error margin;

[0075] S313: Obtain the ratio between the reprojection error margin and the reprojection error upper limit to get the overall reprojection score;

[0076] Specifically, an upper limit for reprojection error can be optionally set. The influence of different dimensions is eliminated through normalization processing, and the reprojection error value is transformed into a relative index between 0 and 1. The difference between the upper limit of reprojection error and the unit reprojection error is obtained to obtain the reprojection error margin, which can intuitively reflect the data quality.

[0077] For example, the reprojection composite score can be calculated using Equation 3-2:

[0078] 3-2;

[0079] in, The overall score is determined by reprojection. This is the upper limit of reprojection error. This represents the unit reprojection error. Preferably, The option is to set it to 5.

[0080] Preferably, the step of determining the comprehensive score for point cloud registration based on the proportion of interior points and the root mean square error of interior points includes:

[0081] S314: Normalize the root mean square error of interior points to obtain the unit root mean square error;

[0082] S315: Obtain the difference between the upper limit of the root mean square error and the unit root mean square error to get the root mean square error margin;

[0083] S316: Obtain the ratio between the root mean square error margin and the root mean square error upper limit to get the matching accuracy value;

[0084] S317: The point cloud registration comprehensive score is obtained by weighting and summing the matching accuracy value and the proportion of interior points according to the prior matching accuracy weight and robustness weight.

[0085] Specifically, an upper limit for the root mean square error can be optionally set. The influence of different dimensions is eliminated through normalization processing, and the root mean square error value is transformed into a relative index between 0 and 1. The root mean square error margin and the matching accuracy value are obtained to intuitively reflect the data quality. Furthermore, the matching accuracy value and the proportion of interior points are weighted and summed by prior matching accuracy weight and robustness weight to achieve a comprehensive evaluation of accuracy and robustness, obtain a comprehensive score for point cloud registration, and comprehensively evaluate the registration effect.

[0086] For example, the point cloud registration comprehensive score can be calculated using equations 3-3 and 3-4:

[0087] 3-3;

[0088] 3-4;

[0089] in, For matching precision values, This is the upper limit of the root mean square error. Unit root mean square error, The overall score for point cloud registration. Let q1 be the proportion of interior points, q2 be the matching accuracy weight, and q3 be the robustness weight; preferably, The value can be set to 0.1, q1 can be set to 0.4, and q2 can be set to 0.6.

[0090] A further preferred embodiment, before the step of obtaining the difference between the upper limit of the reprojection error and the unit reprojection error to obtain the reprojection error margin, includes:

[0091] S312': If the unit reprojection error is greater than the upper limit of the reprojection error, the first adjustment value is used as the reprojection error margin; if the unit reprojection error is less than 0, the second adjustment value is used as the reprojection error margin.

[0092] Before obtaining the root mean square error margin by calculating the difference between the upper limit of the root mean square error and the unit root mean square error, the following steps are included:

[0093] S315': If the unit root mean square error is greater than the upper limit of the root mean square error, the first adjustment value is used as the root mean square error margin; if the unit root mean square error is less than 0, the second adjustment value is used as the root mean square error margin.

[0094] Specifically, in actual algorithm operation, due to noise or algorithm convergence issues, error values ​​that occasionally exceed the theoretical range may occur. Therefore, a boundary protection mechanism can be optionally set. When the calculated error exceeds the preset upper limit (indicating the matching range) or an abnormal negative value occurs, an extremely low adjustment value is forcibly assigned as a margin to prevent abnormal data from having an uncontrollable impact on weight calculation. Thus, through the truncation and correction of the boundary protection mechanism, the numerical stability of the score calculation is guaranteed, and the overflow or logical error of the weight coefficient calculation due to individual extreme values ​​is avoided, further improving the engineering practicality of the system.

[0095] Preferably, the first adjustment value can be set to 0, and the second adjustment value can be set to 1. Pick , Pick ,like Pick , Pick .

[0096] Preferably, the step of weightedly fusing each first transformation matrix and second transformation matrix according to the basic weight coefficients to obtain the optimal transformation matrix between the vehicle coordinate system and the coordinate systems of each acquisition device may include:

[0097] S36: Decompose each of the first transformation matrix and the second transformation matrix to obtain several first translation vectors, first rotation matrices, second translation vectors and second rotation matrices;

[0098] S37: Convert each rotation matrix into quaternions to obtain several first quaternions and second quaternions;

[0099] Specifically, since the first transformation matrix and the second transformation matrix are rigid body transformation matrices, they cannot be directly weighted and fused. Therefore, it is possible to decompose each of the first transformation matrix and the second transformation matrix to obtain several first translation vectors, first rotation matrices, second translation vectors and second rotation matrices. Then, each rotation matrix is ​​converted into a quaternion to obtain several first quaternions and second quaternions.

[0100] For example, the first transformation matrix T can be optionally used. PnP The second transformation matrix T ICP Decomposed into the first rotation matrix R PnP The second rotation matrix R ICP First translation vector t PnP Second translation vector t ICP Then the first rotation matrix R PnP The second rotation matrix R ICP Convert to the first quaternion q PnP Second quaternion q ICP .

[0101] S38: Based on the basic weights, sum the weights of each first quaternion and second quaternion to obtain several optimal quaternions; based on the basic weights, sum the weights of each first translation vector and second translation vector to obtain several optimal translation vectors.

[0102] S39: Restore each optimal quaternion to obtain several optimal rotation matrices, and splice each optimal translation vector and the corresponding optimal rotation matrix to obtain the optimal transformation matrix between the vehicle coordinate system and the coordinate systems of each acquisition device.

[0103] Specifically, the first and second quaternions can be weighted and summed according to the basic weights to obtain the optimal quaternion. By performing a rotational averaging in the quaternion space, mathematical rigor is ensured and problems such as gimbal lock are avoided. At the same time, the first and second translation vectors are weighted and summed according to the basic weights to obtain the optimal translation vector. Finally, the optimal quaternion is restored to obtain the optimal rotation matrix. The optimal translation vector and the optimal rotation matrix are then concatenated to obtain the optimal transformation matrix between the vehicle coordinate system and the coordinate systems of each acquisition device.

[0104] For example, the optimal transformation matrix can be obtained by combining the optimal quaternion and the optimal translation vector according to Equations 3-5 and 3-6, as shown in Equation 3-7:

[0105] 3-5;

[0106] 3-6;

[0107] 3-7;

[0108] Where, q best For the optimal quaternion, β is the basic weighting coefficient, and t best R is the optimal translation vector. best T is the optimal rotation matrix after optimal quaternion restoration. best This is the optimal transformation matrix.

[0109] S4: Create a virtual scene and import the virtual acquisition devices and car models based on the prior intrinsic and extrinsic parameter matrices of each acquisition device and the optimal transformation matrix between the vehicle coordinate system and the coordinate system of each acquisition device.

[0110] Specifically, a virtual simulation scene that perfectly matches the physical environment can be constructed in the computer. First, the prior intrinsic parameter matrices (focal length, principal point, etc.) and extrinsic parameter matrices (installation position and attitude) of each acquisition device are loaded. Then, the optimal transformation matrices between each acquisition device and the vehicle body coordinate system calculated in step S3 are imported. This accurately restores the real position and attitude of the acquisition devices in the virtual scene. A high-precision digital model of the vehicle is then imported, thereby establishing a digital twin environment that can be used for defect mapping and verification. By constructing a virtual scene, the complex coordinate transformation problem in the physical world is transformed into intuitive geometric operations in virtual space. This not only facilitates the visualization and monitoring of the coverage and blind spots of each acquisition device, but also allows for algorithm verification and parameter debugging without interfering with the actual production line. At the same time, the virtual scene provides a unified coordinate reference system for the subsequent lossless mapping of defect points in 2D images to 3D models, ensuring the accuracy and traceability of defect location.

[0111] S5: Acquire several sets of current vehicle body 2D images and obtain the coordinates of defect points in the coordinate system of each acquisition device. Map them to the vehicle model according to the optimal transformation matrix to obtain the three-dimensional coordinates of the defect points.

[0112] Specifically, several sets of 2D images of the current vehicle body can be acquired in real time on the production line. Any existing technology (such as image processing algorithms) can be used to automatically identify and extract the pixel coordinates of defect points in the images. Then, the optimal transformation matrix obtained in step S3 is called to uniformly transform the coordinates of these defect points in the equipment coordinate system to the vehicle body coordinate system and project them onto the surface of the car model in the virtual scene, thereby obtaining the accurate three-dimensional spatial coordinates of the defect points. This achieves a seamless connection from 2D image detection to 3D spatial positioning. By using the pre-calibrated optimal transformation matrix, coordinate deviations caused by equipment vibration, temperature drift, or installation errors are eliminated.

[0113] Preferably, the step of obtaining the coordinates of defect points in each set of 2D images in the coordinate system of each acquisition device includes:

[0114] S51: Traverse and determine whether there are defect points in each 2D image. If so, obtain several adjacent 2D images of the 2D image as neighborhood images.

[0115] S52: Obtain the coordinates of the defect points in each neighboring image, so as to determine the moving speed of the defect points according to the acquisition time interval of the acquisition device and the moving direction of the vehicle body;

[0116] S53: Obtain the difference between the moving speed of the defect point and the preset moving speed of the vehicle body, and determine whether it is greater than the speed threshold. If it is, remove the corresponding defect point; otherwise, determine it as a defect point.

[0117] Specifically, after detecting a defect, the system can use time-series information to examine the movement trajectory of the defect in consecutive frames (neighborhood images). By calculating its apparent moving speed and comparing it with the known vehicle body transmission speed, if the difference is too large, it indicates that the "defect" may be a false positive caused by interference such as image noise, flying insects, or reflections, and it should be eliminated. If the speeds are consistent, it is confirmed as a genuine defect attached to the vehicle body. Thus, the motion characteristics of the production line are used to filter out false defects. Since traditional static image detection is prone to false alarms due to environmental interference, the introduction of speed consistency verification can effectively distinguish between transient interference on a static background and real defects moving with the vehicle body, significantly reducing the false detection rate and improving the signal-to-noise ratio of the detection system.

[0118] Preferably, after obtaining the coordinates of the defect points in each neighboring image, the method further includes:

[0119] S52': Obtain the maximum and minimum coordinates of the defect point in the vertical direction of the vehicle movement direction, and obtain the difference between the two. Determine whether it is greater than the threshold. If it is, remove the corresponding defect point. If not, determine it as a defect point.

[0120] Specifically, after obtaining the coordinates of the defect points in each neighboring image, it is optional to simultaneously analyze the jitter amplitude of the defect points in the direction perpendicular to the vehicle body's movement. Since the vehicle body moves smoothly along the preset trajectory, its coordinate fluctuation in the vertical direction should be very small. If the fluctuation amplitude exceeds the set threshold, it indicates that the target may be an unstable interference object (such as a hanging object, a vibrating water droplet, etc.), and it is removed. This supplements the speed verification in step S53 to remove interference objects that have the same speed in the direction of movement but are unstable in the vertical direction. Through dual kinematic constraints (speed consistency and trajectory stability), a rigorous logical defense is constructed to eliminate various dynamic interferences to the greatest extent and ensure that the final output defect points are all real vehicle body surface defects.

[0121] Preferably, after obtaining the three-dimensional coordinates of the defect point, the method further includes:

[0122] S54: Set the neighborhood size and obtain the coordinates of all points within the set neighborhood of each defect point in the car model to construct the covariance matrix;

[0123] S55: Perform eigenvalue decomposition on the covariance matrix corresponding to each defect point in the car model to obtain several eigenvalues ​​and eigenvectors corresponding to each defect point.

[0124] S56: Obtain the minimum eigenvalue corresponding to each defect point in the car model, and use the eigenvector corresponding to the minimum eigenvalue as the normal vector of each defect point in the car model.

[0125] Specifically, since the normal information of defect points is crucial for subsequent automated repair steps—for example, during automated polishing or spraying, the tool must be perpendicular to the paint surface to achieve the best results—it is possible to further analyze the local surface geometry after obtaining the three-dimensional coordinates of the defect point. By extracting the point cloud in the neighborhood of the defect point to construct a covariance matrix and performing eigenvalue decomposition, the eigenvector corresponding to the smallest eigenvalue represents the normal direction of the surface at that point. This provides key geometric guidance for the posture adjustment of the robot's end effector, realizing a closed-loop process from "defect discovery" to "repair guidance."

[0126] For example, the normal vector of each defect point in the car model can be calculated according to Equation 5-1:

[0127] 5-1;

[0128] Where C is the covariance matrix of the point cloud in the neighborhood of the defect point, and N is the number of points in the neighborhood. Let C be the coordinates of the i-th point in the neighborhood, u be the average coordinates of all points in the neighborhood, and T be the transpose of the matrix. Optionally, eigenvalue decomposition can be performed on C, and the eigenvector corresponding to the smallest eigenvalue can be taken as the defect point normal.

[0129] In this embodiment, a three-dimensional coordinate localization method for paint surface defects according to the present invention is presented, the core inventive point of which is:

[0130] 1. Acquire calibration images to construct 2D-3D feature point pairs, solve the first transformation matrix (based on projection error) and the second transformation matrix (based on point cloud registration) respectively, and fuse the reprojection error, inlier ratio, and root mean square error of inlier to obtain basic weight coefficients, and then perform weighted fusion to obtain the optimal transformation matrix; this "dual matrix solution + dynamic weight fusion" mechanism, compared with traditional methods that rely solely on projection or point cloud registration, has unique technical effects of higher accuracy, stronger robustness, and wider adaptability, specifically manifested in:

[0131] Complementary advantages overcome the limitations of single algorithms: The first transformation matrix, solved by minimizing projection error, has high accuracy when feature points are clear and textures are rich, but it is prone to failure when textures are missing or illumination changes drastically; the second transformation matrix, solved by point cloud registration, utilizes geometric structure information and has less dependence on texture, but registration accuracy decreases when point clouds are sparse or noisy. This scheme achieves complementary advantages between "texture features" and "geometric structure" by integrating the two. When one method's error increases due to environmental factors, the other method can provide reliable constraints, ensuring high-precision coordinate system transformation relationships can still be obtained under complex workshop environments (such as reflections, shadows, and partial occlusion).

[0132] Dynamic weight allocation for adaptive optimal solution: Traditional methods often use fixed weights or simple averaging, which cannot cope with performance differences between different acquisition devices or different vehicle body areas. This solution constructs a comprehensive evaluation system that includes reprojection error, inlier ratio, and root mean square error (RMS), and dynamically calculates the basic weight coefficients. If the projection method performs well (small error, high score), it is automatically assigned a higher weight; if the point cloud registration is more robust (more inliers, lower RMS), it is tilted towards that method. This adaptive mechanism ensures that the final optimal transformation matrix always approaches the theoretical optimal solution under the current data quality, significantly reducing the overall positioning error of the system.

[0133] Enhancing the global consistency of 3D reconstruction and defect localization: By unifying multi-view acquisition devices to the vehicle body coordinate system through an optimal transformation matrix, the cumulative errors and misalignments during multi-camera stitching are eliminated. This not only improves the realism of the virtual scene construction, but more importantly, ensures the coordinate accuracy of subsequent defect point mapping from 2D images to 3D models. It avoids misjudgment of defect location or dimensional measurement errors caused by coordinate system deviations, providing a reliable geometric benchmark for subsequent automated repair or quality grading.

[0134] 2. A phased, progressive feature score calculation and threshold judgment logic is adopted (first determining if the overall score is 0 or below the threshold, then judging the individual score, and finally calculating the ratio), and an adjustment value is introduced to handle abnormal errors (unit errors exceeding the upper limit or being less than 0). This refined weight calculation strategy, compared to simple linear normalization or fixed formulas, has extremely strong anti-interference capabilities and boundary protection capabilities, specifically reflected in:

[0135] Robustness Guarantee in Extreme Cases: In actual production, extreme situations such as calibration failure, feature point mismatch, or extremely high point cloud noise are inevitable, leading to abnormally large or even negative reprojection or root mean square errors (normalization anomalies). This solution, by setting a "comprehensive score threshold" and an "adjustment value" mechanism, can forcibly take over weight calculation in these extreme cases. For example, when point cloud registration completely fails (score too low), it automatically switches to relying solely on the projection method for scoring; when the error exceeds the physically possible range, an adjustment value is used to truncate the weight coefficients, preventing abnormal values ​​from contaminating the weight coefficients and avoiding the system outputting absurd transformation matrices, ensuring that the system can still maintain basic operation or safely degrade under non-ideal conditions.

[0136] Accuracy and discriminative power of quantitative evaluation: Through normalization, calculation of error margin and ratio, error indicators of different dimensions (pixel-level projection error, millimeter-level registration error, percentage of in-point proportion) are transformed into unified comparable scores. This processing method not only eliminates the influence of dimensions but also amplifies the score differences between high-quality and low-quality data, making the allocation of weight coefficients more sensitive and accurate. Even small improvements in accuracy are reflected in weight changes, thereby driving the fusion results to converge towards higher accuracy.

[0137] A logically rigorous decision-making chain: Multi-level judgment logic (sum equal to 0 → single-item threshold judgment → ratio calculation) constructs a rigorous decision tree. It prioritizes eliminating invalid data, then identifies the dominant advantage of a single aspect, and finally performs refined fusion when both aspects are valid. This logical structure avoids the coarse "one-size-fits-all" approach and ensures a reasonable weighting strategy under various data quality combinations (such as both excellent, one excellent and one inferior, both inferior but usable, etc.).

[0138] 3. When acquiring defect point coordinates, spatiotemporal neighborhood analysis is introduced. The moving speed of the defect point is calculated by combining the acquisition time interval and the vehicle's moving speed, and then compared with a preset speed for rejection. Simultaneously, the spatial continuity of the defect point is determined in the vertical direction by the difference in coordinate extreme values. This dual verification mechanism of "speed consistency + spatial continuity" has a much higher false detection rejection rate and true value retention rate compared to traditional single-frame image detection. Specifically, this includes:

[0139] Effective Removal of Dynamic Artifacts and Environmental Noise: On automobile production lines, the car body is in motion, and images often contain transient interference such as flying insects, dust, water stains, or flickering light. The relative positional changes of these artifacts between different frames are completely different from inherent defects on the car body. This solution calculates the speed at which defect points move relative to the car body, accurately identifying and removing false targets that "move with the camera" or "remain stationary" but should actually move with the car body. Only points whose speed is highly consistent with the car body's movement are judged as genuine defects attached to the car body, greatly reducing the false alarm rate.

[0140] Ensuring the spatial morphology of defects is crucial: Real paint defects (such as scratches, dents, and particles) possess a certain continuity and dimensional characteristics in physical space, and will not exhibit extremely discrete or abrupt coordinate distributions perpendicular to the direction of movement. By examining the extreme differences in coordinates of defect points in the neighboring image along the vertical direction, isolated noise points caused by image noise or abnormal detection boxes that do not conform to physical morphology can be filtered out. This step further purifies the defect point set, ensuring that every point input into the 3D reconstruction process is a physically meaningful and realistic defect.

[0141] Enhancing the reliability of 3D coordinate mapping: The coordinates of defect points, after double verification, possess highly reliable spatiotemporal properties. When mapped to the car model, accurate 3D coordinate correspondence is guaranteed, avoiding 3D positioning drift caused by front-end detection errors. This is crucial for subsequent calculations of defect depth and area, as well as guiding robots for precise grinding or painting, directly improving the success rate and finished product quality of the automated repair system.

[0142] 4. After obtaining the 3D coordinates of the defect point, a covariance matrix is ​​constructed based on the neighborhood points and eigenvalue decomposition is performed. The normal vector is determined using the eigenvector corresponding to the smallest eigenvalue. This normal estimation method based on local geometry has stronger local adaptability and noise resistance compared to directly using the global normal vector of the model or simple difference calculation. Specifically, this is reflected in the following aspects:

[0143] Precisely capturing local surface features: Automotive body surfaces are often complex hyperboloids with dramatic changes in normals at different locations. Directly referencing theoretical normals from CAD models may fail to reflect the minute deformations in actual manufacturing, while simple difference methods are easily affected by mesh generation. This solution constructs a covariance matrix within the neighborhood of the defect point, adaptively fitting a local tangent plane at that point based on the actual scanned or reconstructed point cloud distribution. The eigenvector corresponding to the minimum eigenvalue is the normal of the best-fit plane in that local area, accurately reflecting the geometric orientation of the defect location.

[0144] Suppressing noise interference and improving normal vector stability: Point cloud data inevitably contains measurement noise. Eigenvalue decomposition of the covariance matrix is ​​essentially a form of principal component analysis (PCA), which has excellent denoising properties. By analyzing the distribution trend of all points in the neighborhood, random noise fluctuations at individual points can be effectively smoothed out, resulting in a more stable and reliable normal vector. This is crucial for subsequent calculations of parameters such as defect depth and angle based on the normal vector, avoiding measurement data jumps caused by normal vector jitter.

[0145] Providing a precise benchmark for defect quantification analysis: An accurate normal is the baseline axis for defining the "depth" and "severity" of a defect. Only with an accurate normal can the deviation of a defect point from an ideal surface be correctly calculated. The precise normal provided by this method enables the system to quantitatively assess the three-dimensional morphology of defects (such as the depth of a pit or the direction of a scratch), providing richer dimensional information for quality assessment and facilitating the technological leap from "qualitative discovery" to "quantitative analysis."

[0146] On the other hand, the present invention also provides a computer storage medium storing executable program code; the executable program code is used to execute any of the above-mentioned three-dimensional coordinate positioning methods for paint surface defects.

[0147] On the other hand, the present invention also provides a terminal device, including a memory and a processor; the memory stores program code that can be executed by the processor; the program code is used to execute any of the above-mentioned three-dimensional coordinate positioning methods for paint surface defects.

[0148] For example, the program code can be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units can be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the program code in the terminal device.

[0149] The terminal device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The terminal device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that the terminal device may also include input / output devices, network access devices, buses, etc.

[0150] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.

[0151] The memory can be an internal storage unit of the terminal device, such as a hard drive or RAM. The memory can also be an external storage device of the terminal device, such as a plug-in hard drive, SmartMediaCard (SMC), Secure Digital (SD) card, or FlashCard. Furthermore, the memory can include both internal and external storage units of the terminal device. The memory is used to store the program code and other programs and data required by the terminal device. The memory can also be used to temporarily store data that has been output or will be output.

[0152] The aforementioned computer storage medium and terminal device are created based on the aforementioned three-coordinate positioning method for automotive paint defects. Their technical functions and beneficial effects will not be elaborated here. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0153] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention patent should be determined by the appended claims.

Claims

1. A method for three-dimensional coordinate localization of paint surface defects, characterized in that, include: Several sets of calibrated vehicle body 2D images are collected, several 2D feature points are extracted from each set of images, and matched with the vehicle body prior 3D point cloud to construct several 2D-3D feature point pairs; Based on feature point pairs, the first transformation matrix between the coordinate systems of each acquisition device and the vehicle body coordinate system is solved by minimizing the projection error, and the reprojection error value is calculated; 3D reconstruction is performed on each 2D image to obtain the point cloud to be registered, and the point cloud to be registered and the prior 3D point cloud of the vehicle body are registered using the first transformation matrix as the initial value to obtain the second transformation matrix between the coordinate systems of each acquisition device and the vehicle body coordinate system, and the interior point ratio and the root mean square error of the interior points are calculated; By fusing the reprojection error value, the proportion of interior points and the root mean square error of interior points, the basic weight coefficient is obtained. The first transformation matrix and the second transformation matrix are then weighted and fused according to the basic weight coefficient to obtain the optimal transformation matrix between the vehicle coordinate system and the coordinate systems of each acquisition device. Create a virtual scene and import the virtual acquisition devices and car models based on the prior intrinsic and extrinsic parameter matrices of each acquisition device and the optimal transformation matrix between the vehicle coordinate system and the coordinate system of each acquisition device. Several sets of current 2D images of the vehicle body are acquired, and the coordinates of the defect points in the coordinate system of each acquisition device are obtained. The defect points are then mapped to the vehicle model according to the optimal transformation matrix to obtain the three-dimensional coordinates of the defect points.

2. The method according to claim 1, characterized in that, The steps for obtaining the basic weighting coefficients by fusing the reprojection error value, the proportion of interior points, and the root mean square error of interior points include: The reprojection score is determined based on the reprojection error value; the point cloud registration score is determined based on the proportion of interior points and the root mean square error of interior points. Determine whether the sum of the reprojection composite score and the point cloud registration composite score is 0, or whether the point cloud registration composite score is less than the composite score threshold. If yes, use the reprojection composite score as the base weighting coefficient; otherwise: Determine if the reprojection composite score is less than the composite score threshold. If so, use the point cloud registration composite score as the base weighting coefficient; otherwise: The sum of the reprojection score and the point cloud registration score is used to obtain the overall score. Obtain the ratio of the reprojection composite score to the total composite score to get the basic weight coefficient.

3. The method according to claim 2, characterized in that, The steps for determining the overall reprojection score based on the reprojection error value include: Normalize the reprojection error value to obtain the unit reprojection error; The difference between the upper limit of reprojection error and the unit reprojection error is obtained to obtain the reprojection error margin; The ratio between the reprojection error margin and the reprojection error upper limit is used to obtain the overall reprojection score. The steps for determining the overall score of point cloud registration based on the proportion of interior points and the root mean square error of interior points include: Normalize the in-point root mean square error to obtain the unit root mean square error; The difference between the upper limit of the root mean square error and the unit root mean square error is obtained to get the root mean square error margin. The ratio between the root mean square error margin and the root mean square error upper limit is used to obtain the matching accuracy value. The point cloud registration comprehensive score is obtained by weighting and summing the matching accuracy value and the proportion of interior points based on the prior matching accuracy weight and robustness weight.

4. The method according to claim 3, characterized in that, Before obtaining the reprojection error margin by calculating the difference between the upper limit of the reprojection error and the unit reprojection error, the following steps are included: If the unit reprojection error is greater than the upper limit of the reprojection error, the first adjustment value is used as the reprojection error margin; if the unit reprojection error is less than 0, the second adjustment value is used as the reprojection error margin. Before obtaining the root mean square error margin by calculating the difference between the upper limit of the root mean square error and the unit root mean square error, the following steps are included: If the unit root mean square error is greater than the upper limit of the root mean square error, the first adjustment value is used as the root mean square error margin; if the unit root mean square error is less than 0, the second adjustment value is used as the root mean square error margin.

5. The method according to claim 1, characterized in that, The steps for obtaining the optimal transformation matrix between the vehicle coordinate system and the coordinate systems of each acquisition device by weighting and fusing each first and second transformation matrix according to the basic weight coefficients include: Decompose each of the first transformation matrix and the second transformation matrix to obtain several first translation vectors, first rotation matrices, second translation vectors, and second rotation matrices; Convert each rotation matrix into a quaternion to obtain several first quaternions and second quaternions; Based on the basic weights, the first quaternion and the second quaternion are weighted and summed to obtain several optimal quaternions; based on the basic weights, the first translation vector and the second translation vector are weighted and summed to obtain several optimal translation vectors. By restoring the optimal quaternions, several optimal rotation matrices are obtained. Then, by concatenating the optimal translation vectors and the corresponding optimal rotation matrices, the optimal transformation matrix between the vehicle coordinate system and the coordinate systems of each acquisition device is obtained.

6. The method according to claim 1, characterized in that, The steps for obtaining the coordinates of defect points in each set of 2D images in the coordinate system of each acquisition device include: Traverse and determine whether there are defect points in each 2D image. If so, obtain several adjacent 2D images of the 2D image as neighborhood images. The coordinates of the defect points in each neighboring image are obtained so that the moving speed of the defect points can be determined based on the acquisition time interval of the acquisition device and the vehicle's moving direction. The difference between the moving speed of the defect point and the preset moving speed of the vehicle body is obtained, and it is determined whether it is greater than the speed threshold. If it is, the corresponding defect point is removed; otherwise, it is determined to be a defect point.

7. The method according to claim 6, characterized in that, After obtaining the coordinates of the defect points in each neighborhood image, the process also includes: Obtain the maximum and minimum coordinates of the defect point in the vertical direction of the vehicle's movement direction, and obtain the difference between the two. Determine whether the difference is greater than a threshold. If it is, remove the corresponding defect point; otherwise, determine that it is a defect point.

8. The method according to claim 1, characterized in that, After obtaining the three-dimensional coordinates of the defect point, the following is also included: Set the neighborhood size and obtain the coordinates of all points within the set neighborhood of each defect point in the car model to construct the covariance matrix; Eigenvalue decomposition is performed on the covariance matrix corresponding to each defect point in the car model to obtain several eigenvalues ​​and eigenvectors corresponding to each defect point. Obtain the minimum eigenvalue corresponding to each defect point in the car model, and use the eigenvector corresponding to the minimum eigenvalue as the normal vector of each defect point in the car model.

9. A computer storage medium, characterized in that, It stores executable program code; the executable program code is used to execute the three-dimensional coordinate positioning method for paint surface defects according to any one of claims 1 to 8.

10. A terminal device, characterized in that, It includes a memory and a processor; the memory stores program code that can be executed by the processor; the program code is used to execute the three-dimensional coordinate localization method for paint surface defects as described in any one of claims 1 to 8.