Error compensation calibration method, anti-reflective noise method and measurement method based on unit quaternion
By employing an error compensation calibration method based on unit quaternions and an anti-reflective noise algorithm, the assembly error and reflective effects of the galvanometer line laser 3D scanning measurement system are resolved, achieving efficient and high-precision 3D measurement, suitable for reflective materials and industrial welding scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUILIN UNIV OF ELECTRONIC TECH
- Filing Date
- 2026-01-13
- Publication Date
- 2026-05-29
AI Technical Summary
Existing galvanometer-based line laser 3D scanning measurement systems suffer from problems such as complex coordinate system transformation, large assembly errors between the target plane and the worktable, and significant reflection effects, resulting in low measurement efficiency and low accuracy.
An error compensation calibration method based on unit quaternions is adopted. The galvanometer motor shaft is used as the reference to simplify coordinate system transformation. Combined with image processing and Kalman filtering algorithm, the calibration process is optimized and the center point extraction accuracy is improved, reducing assembly errors and reflection noise interference.
It simplifies the calibration process, improves measurement accuracy and efficiency, and is suitable for reflective materials and industrial welding scenarios, while maintaining the high speed and small size advantages of galvanometer scanning technology.
Smart Images

Figure CN122107985A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent manufacturing technology, and in particular to an error compensation calibration method, an anti-reflective noise method, and a measurement method based on unit quaternions. Background Technology
[0002] Traditional line structured light measurement systems typically use mechanical scanning platforms to perform 3D scanning measurements of the object under test. However, the scanning device has significant inertia, resulting in slow measurement speeds, and the entire system is bulky and costly. Combining galvanometer scanning technology with line structured light measurement technology can effectively solve this problem. The line laser is reflected by a galvanometer and projected onto the surface of the object under test. Simultaneous control of galvanometer rotation and image acquisition completes the 3D scanning measurement. Galvanometer scanning technology offers numerous advantages, including high speed, high precision, and small size, thus enabling high-speed self-scanning measurements and enhancing the system's integration and portability. Yu et al. published a paper titled "Modeling and calibration of a novel one-mirror galvanometric laser scanner" in the journal *Sensors*, establishing a mathematical model of galvanometer scanning based on spinor theory. This model contains 11 unknown parameters, making the modeling and solution process relatively complex. Yang Lin et al. published a paper titled "Calibration of a Galvanometer-Based Line Structured Light 3D Measurement System Based on Neural Networks" in the *Acta Optica Sinica*. This method calibrates the system by using a neural network to nonlinearly fit the mapping relationship between the system's image coordinates, optical plane rotation angle, and 3D world coordinates. However, to obtain high-precision 3D data points for neural network training, a high-precision linear stage and calibration target are required. Furthermore, the target plane must be perpendicular to the stage's movement direction, making the adjustment process complex and ensuring the system's assembly accuracy difficult.
[0003] As mentioned above, existing galvanometer-based line laser 3D scanning measurement systems suffer from complex coordinate system transformations, significant assembly errors between the galvanometer and line laser, and between the target plane and the worktable. Furthermore, they do not consider the anti-reflective effects of the center point extraction algorithm during the measurement process. These issues stem from the complex coordinate system transformations, low efficiency, large assembly errors between the target plane and the worktable, and the presence of reflections during measurement. Summary of the Invention
[0004] This invention provides an error compensation calibration method, an anti-reflective noise method, and a measurement method based on element quaternions. It directly uses the motor shaft of the galvanometer as a reference, calibrating the origin of the galvanometer line laser 3D measurement system on the motor shaft. This eliminates the need for an additional coordinate system, reducing coordinate system transformation errors and eliminating the need for an additional work platform. It also eliminates the need to consider assembly errors between the target plane and the worktable. Furthermore, the calibration based on element quaternions effectively reduces the complexity of the mathematical model and improves calibration efficiency. For the assembly error between the galvanometer and the line laser during calibration, a calibration compensation method based on the motor rotation shaft is proposed, resulting in more accurate calibration. Accurate extraction of the laser center point is crucial for achieving high-precision measurement in the galvanometer line laser 3D scanning measurement system. In this process, this invention proposes a novel algorithm that combines the advantages of image processing and Kalman filtering, improving the robustness and accuracy of center point extraction.
[0005] To achieve the above objectives, the present invention adopts the following technical solution: Error compensation calibration methods based on unit quaternions include: S11. Set up the required measurement system for calibration, including galvanometer, galvanometer motor, line laser, calibration board and CCD camera; S12. Calibrate the CCD camera to obtain camera intrinsic parameters and distortion coefficients; S13. Project the line laser onto the energized but not rotating galvanometer to form an initial light plane. Change the height of the calibration plate and take an image through a CCD camera. Combine the camera intrinsic parameters and distortion coefficients to calibrate the equation of the initial light plane and the normal vector. S14. Establish the relationship between the voltage change of the galvanometer motor and the rotation angle of the galvanometer and the rotation angle of the optical plane; S15. Based on the aforementioned correlation, control the galvanometer to drive the optical plane to rotate multiple times. After each rotation, capture an image through a CCD camera. Combine the camera's intrinsic parameters and distortion coefficients to calibrate the corresponding optical plane equation. Based on the common line characteristics of the initial optical plane equation and the optical plane equations after each rotation, determine the initial rotation axis straight line equation. S16. Based on all the optical plane equations, the assembly error between the line laser and the galvanometer is corrected by minimizing the sum of squares of the straight distances, and the initial linear equation of the rotation axis is optimized to obtain the optimized linear equation of the rotation axis. S17. Construct a dynamic light plane model based on unit quaternions, combine the initial light plane normal vector and the optimized rotation axis line equation, derive the dynamic light plane equation corresponding to different light plane rotation angles, and complete the error compensation calibration.
[0006] In this instruction manual, the height of the calibration plate is changed no less than twice in step S13. The calibration accuracy of the initial light plane equation and normal vector is ensured through multiple height adjustments.
[0007] In this specification, the optical plane rotates 4 times in step S15, with each rotation angle being 2 degrees. The rotation angle of the galvanometer and the rotation angle of the optical plane satisfy the reflection theorem, and the rotation angle of the optical plane is twice the rotation angle of the galvanometer.
[0008] In this specification, the specific implementation process of the method for minimizing the sum of squared distances in step S16 is as follows: solve for the intersection lines of adjacent light planes in all light planes, calculate the distance from the preset point to each intersection line and construct the objective function for minimizing the sum of squared distances, solve the objective function to obtain the optimal intersection point on the rotation axis, and optimize the initial rotation axis line equation based on the optimal intersection point.
[0009] Anti-reflective noise methods include: S21. Take a laser stripe image of the surface of the object being measured using a CCD camera, wherein the CCD camera has been pre-calibrated and its intrinsic parameters and distortion coefficients have been acquired; S22. Preprocess the laser stripe image by combining camera intrinsic parameters and distortion coefficients; S23. Filter the preprocessed image to remove noise interference; S24. The gray-scale centroid method is used to coarsely extract the laser center point of the filtered image to obtain coarsely extracted center point data. S25. Perform outlier detection and correction on the coarsely extracted center point data using Kalman filtering, remove outliers caused by reflection interference, and obtain the corrected center point coordinates. S26. Using the corrected center point as a reference, select multiple rows of coarsely extracted center point data above and below it for straight line fitting to determine the slope of the center point and complete the center point extraction for anti-reflective noise.
[0010] In this specification, the filtering process in step S23 is median filtering. During the filtering process, the median value of all gray values in the filtering window is taken as the filtered pixel value, which preserves image details while removing noise.
[0011] In this specification, step S24 uses a gray-scale weighted centrifugal extraction method to perform coarse extraction. By increasing the gray-scale weight of the central region of the laser stripe and reducing the weight of the edge region, the influence of edge interference on the coarse extraction result is reduced.
[0012] In this specification, the coarsely extracted center point data selected in step S26 is the dataset of the five rows above and below the corrected center point. The slope parameter of the center point is obtained by fitting a straight line through the method of minimizing the weighted sum of squares.
[0013] Error compensation calibration and anti-reflective noise measurement methods based on unit quaternions include: S31. Using the error compensation calibration method described in claim 1, the dynamic light plane calibration of the measurement system is completed, and the dynamic light plane equations corresponding to different light plane rotation angles are obtained. S32. Using the anti-reflective noise center point extraction method described in claim 2, obtain the precise center point coordinates and slope of the laser light stripe on the surface of the measured object; S33. Combining the dynamic light plane equation with the precise center point coordinates and slope, calculate the three-dimensional coordinates of the object being measured to complete the three-dimensional measurement.
[0014] In this specification, the galvanometer in the measurement system is an AT40MD scanning galvanometer, and the proportionality coefficient between the galvanometer motor voltage change and the galvanometer rotation angle is 0.5V / °. This measurement method is suitable for three-dimensional contour measurement of reflective materials and industrial welding scenarios.
[0015] In summary, the present invention has at least the following beneficial effects: Simplified calibration process: No need to build an additional coordinate system or rely on a high-precision worktable, reducing coordinate system transformation steps, reducing dependence on special equipment, and improving system usability.
[0016] Improve calibration performance: By optimizing the calibration model and error compensation method, the impact of assembly errors on measurement results is effectively reduced, while simplifying the complexity of the mathematical model and improving calibration efficiency.
[0017] Enhanced anti-interference capability: For measurement scenarios involving reflective materials, multi-step image processing and filtering algorithms are used to improve the robustness and accuracy of laser center point extraction, avoiding measurement deviations caused by reflective interference.
[0018] Optimize system adaptability: Maintain the advantages of high speed and small size of galvanometer scanning technology, while improving measurement accuracy to adapt to various intelligent manufacturing scenarios such as industrial welding and 3D contour detection. Attached Figure Description
[0019] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a schematic diagram of the measurement system involved in the present invention.
[0021] Figure 2 This is a schematic diagram of the initial optical plane calibration involved in this invention.
[0022] Figure 3 This is a schematic diagram of the rotation axis calibration involved in this invention. Detailed Implementation
[0023] In the following description, only certain exemplary embodiments are briefly described. As those skilled in the art will recognize, the described embodiments can be modified in various ways without departing from the spirit or scope of the embodiments of the invention. Therefore, the drawings and description are considered to be exemplary in nature and not restrictive.
[0024] The following disclosure provides many different implementations or examples for carrying out different structures of the embodiments of the present invention. To simplify the disclosure of the embodiments of the present invention, specific examples of components and arrangements are described below. Of course, these are merely examples and are not intended to limit the embodiments of the present invention. Furthermore, reference numerals and / or reference letters may be repeated in different examples of the embodiments of the present invention; such repetition is for simplification and clarity and does not in itself indicate a relationship between the various implementations and / or arrangements discussed.
[0025] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0026] This embodiment provides an error compensation calibration method based on unit quaternions, including: S11. Set up the required measurement system for calibration, including galvanometer, galvanometer motor, line laser, calibration board and CCD camera; S12. Calibrate the CCD camera to obtain camera intrinsic parameters and distortion coefficients; S13. Project the line laser onto the energized but not rotating galvanometer to form an initial light plane. Change the height of the calibration plate and take an image through a CCD camera. Combine the camera intrinsic parameters and distortion coefficients to calibrate the equation of the initial light plane and the normal vector. S14. Establish the relationship between the voltage change of the galvanometer motor and the rotation angle of the galvanometer and the rotation angle of the optical plane; S15. Based on the aforementioned correlation, control the galvanometer to drive the optical plane to rotate multiple times. After each rotation, capture an image through a CCD camera. Combine the camera's intrinsic parameters and distortion coefficients to calibrate the corresponding optical plane equation. Based on the common line characteristics of the initial optical plane equation and the optical plane equations after each rotation, determine the initial rotation axis straight line equation. S16. Based on all the optical plane equations, the assembly error between the line laser and the galvanometer is corrected by minimizing the sum of squares of the straight distances, and the initial linear equation of the rotation axis is optimized to obtain the optimized linear equation of the rotation axis. S17. Construct a dynamic light plane model based on unit quaternions, combine the initial light plane normal vector and the optimized rotation axis line equation, derive the dynamic light plane equation corresponding to different light plane rotation angles, and complete the error compensation calibration.
[0027] In some embodiments, the height of the calibration plate is changed at least twice in step S13, and the calibration accuracy of the initial light plane equation and normal vector is ensured through multiple height adjustments.
[0028] In some embodiments, the optical plane rotates 4 times in step S15, with each rotation angle being 2 degrees. The rotation angle of the galvanometer and the rotation angle of the optical plane satisfy the reflection theorem, and the rotation angle of the optical plane is twice the rotation angle of the galvanometer.
[0029] In some embodiments, the specific implementation process of the method for minimizing the sum of squared distances in step S16 is as follows: solve for the intersection lines of adjacent light planes in all light planes, calculate the distance from the preset point to each intersection line and construct the objective function for minimizing the sum of squared distances, solve the objective function to obtain the optimal intersection point on the rotation axis, and optimize the initial linear equation of the rotation axis based on the optimal intersection point.
[0030] This embodiment provides a method for resisting reflective noise, including: S21. Take a laser stripe image of the surface of the object being measured using a CCD camera, wherein the CCD camera has been pre-calibrated and its intrinsic parameters and distortion coefficients have been acquired; S22. Preprocess the laser stripe image by combining camera intrinsic parameters and distortion coefficients; S23. Filter the preprocessed image to remove noise interference; S24. The gray-scale centroid method is used to coarsely extract the laser center point of the filtered image to obtain coarsely extracted center point data. S25. Perform outlier detection and correction on the coarsely extracted center point data using Kalman filtering, remove outliers caused by reflection interference, and obtain the corrected center point coordinates. S26. Using the corrected center point as a reference, select multiple rows of coarsely extracted center point data above and below it for straight line fitting to determine the slope of the center point and complete the center point extraction for anti-reflective noise.
[0031] In some embodiments, the filtering process in step S23 is median filtering, in which the median value of all gray values in the filtering window is taken as the filtered pixel value, preserving image details while removing noise.
[0032] In some embodiments, step S24 employs a gray-scale weighted centrifugal extraction method to reduce the gray-scale weight of the central region of the laser stripe and decrease the weight of the edge region, thereby reducing the impact of edge interference on the coarse extraction result.
[0033] In some embodiments, the coarsely extracted center point data selected in step S26 is the dataset of the five rows above and below the corrected center point. The slope parameter of the center point is obtained by performing line fitting through weighted sum of squares minimization.
[0034] This embodiment provides a method for error compensation calibration and anti-reflective noise measurement based on unit quaternions, including: S31. Using the error compensation calibration method described in claim 1, the dynamic light plane calibration of the measurement system is completed, and the dynamic light plane equations corresponding to different light plane rotation angles are obtained. S32. Using the anti-reflective noise center point extraction method described in claim 2, obtain the precise center point coordinates and slope of the laser light stripe on the surface of the measured object; S33. Combining the dynamic light plane equation with the precise center point coordinates and slope, calculate the three-dimensional coordinates of the object being measured to complete the three-dimensional measurement.
[0035] In some embodiments, the galvanometer in the measurement system is an AT40MD scanning galvanometer, and the proportionality coefficient between the galvanometer motor voltage change and the galvanometer rotation angle is 0.5V / °. This measurement method is suitable for three-dimensional contour measurement of reflective materials and industrial welding scenarios.
[0036] The complete steps of the three methods in the above embodiments, namely the error compensation calibration and anti-reflective noise measurement method based on quaternions, are as follows: S1. Set up the measurement system, including galvanometer, galvanometer motor, line laser, calibration plate and CCD camera; S2. Calibrate the CCD camera and obtain the camera's intrinsic parameters and distortion coefficients; S3. Project the line laser onto an energized and stationary galvanometer. The initial light plane is formed by reflection from the galvanometer. The height of the calibration plate is changed multiple times. The image of the calibration plate after each height change is captured by a CCD camera. Combined with the camera intrinsic parameters and distortion coefficients, the equation of the initial light plane and the normal vector of the plane are obtained by using a fixed light plane calibration method. S4. Based on the characteristics of the galvanometer motor, establish the proportional relationship between its voltage change and the rotation angle of the galvanometer, and then establish the correlation between the voltage change and the rotation angle of the optical plane based on the reflection theorem. S5. Based on the correlation between voltage change and optical plane rotation angle, the rotation of the galvanometer is controlled by changing the voltage of the galvanometer motor, which drives the optical plane to rotate on a fixed axis multiple times. After each rotation, the calibration plate image is captured by a CCD camera. Combined with the camera intrinsic parameters and distortion coefficients, the corresponding optical plane equation is calibrated using a fixed optical plane calibration method. Based on the common line characteristics of the initial optical plane equation and the optical plane equation after each rotation, the initial rotation axis straight line equation is determined. S6. Based on all the optical plane equations obtained in step S5, the assembly error between the line laser and the galvanometer is corrected by minimizing the sum of squared linear distances. The initial linear equation of the rotation axis is then optimized to obtain the optimized linear equation of the rotation axis. S7. Based on the unit quaternion, construct a dynamic light plane model, convert the initial light plane normal vector into a pure quaternion, and combine it with the optimized rotation axis line equation to derive the dynamic light plane equation corresponding to different light plane rotation angles. S8. Use a CCD camera to capture the laser stripe image on the surface of the object being measured. Combine the camera intrinsic parameters and distortion coefficients to perform image preprocessing. Filter the preprocessed image and use the gray-scale centroid method to coarsely extract the center point. Then, use Kalman filtering to correct outlier points of the coarsely extracted center point and obtain the corrected center point coordinates. S9. Using the corrected center point as a reference, select the coarsely extracted center point data from multiple rows above and below it for straight line fitting, and combine it with the dynamic light plane equation to complete the three-dimensional measurement of the object.
[0037] The technical concept of this invention is as follows: The core of this solution is an integrated technology of "calibration optimization + error compensation + anti-reflective extraction": First, using the galvanometer motor shaft as a reference, a calibration model is constructed using unit quaternions to simplify the dynamic optical plane calibration process; second, the assembly error between the galvanometer and the line laser is compensated by minimizing the sum of squared linear distances; third, in the 3D measurement stage, median filtering for noise reduction, grayscale weighted centroid coarse extraction, Kalman filtering for outlier correction, and linear fitting optimization are combined to achieve accurate extraction of the laser center point under reflective conditions. The system hardware consists of a galvanometer, galvanometer motor, line laser, calibration board, and CCD camera. Calibration and measurement are completed through a nine-step standardized process, forming a complete high-precision 3D measurement solution.
[0038] The innovations are as follows: (1) Based on the unit quaternion calibration model, the calibration algorithm with the motor shaft of the galvanometer as the reference can effectively reduce the complexity of the mathematical model and improve the calibration efficiency; (2) There are installation errors in the galvanometer and line laser during the calibration process (installation diagram as shown in the figure). Figure 1 A compensation method that minimizes the sum of squared distances along a straight line is proposed to correct installation errors and improve system calibration accuracy; (Formula 7-13) (3) After completing the system calibration, three-dimensional measurement is performed. By combining image filtering, coarse extraction of center point and Kalman filtering for anomaly detection and correction, feature point extraction is performed to improve the robustness and accuracy of laser center point extraction.
[0039] The technical steps are as follows: Step 1: Calibrate the distortion coefficients of the camera. Strike the galvanometer with a line laser after it has been powered on. At this time, the galvanometer is not rotating. Change the height h of the calibration plate. Use the fixed optical plane calibration method to obtain the initial optical plane equation P0 and a normal vector n0 on the optical plane. The initial optical plane rotation angle is assumed to be zero. Step 2: Establish the voltage change of the galvanometer motor Angle of rotation of the galvanometer a The equation (Formula 1) further establishes that the angle of rotation of the optical plane is twice the angle of rotation of the galvanometer, thus establishing the voltage change of the galvanometer motor. Equation with respect to the rotation angle β of the light plane (as shown in Formula 2); Step 3: Determine the equation of the straight line of the axis of rotation. (Formula 4), where the equation of the straight line is... It is a point on a straight line. It is a straight line The direction vector. By controlling the change of the galvanometer motor, the optical plane is rotated 4 times, 2 degrees each time. The equation of the optical plane for each rotation is determined using the fixed optical plane calibration method. P i The calibration (Formula 3) yields the unit normal vector of the corresponding light plane. Offset of the plane from the origin The coordinates of any point on the light plane ; Step 4: Due to the straight line Theoretically, it is a plane. P i The common line, then the normal vector of the light plane. with the direction vector of the line The dot product of perpendicular points is 0 (Formula 5), and points on the line... It is also a plane of light. P i Formula (6) can be obtained from a single point. Step 5: Based on the method of minimizing the sum of squared distances along a straight line, adjust and compensate for installation errors to improve the system calibration accuracy; (Formula 7-13) Step 6: Calibration of the dynamic light plane. A dynamic light plane model is constructed based on element quaternions, and the rotation angle of the light plane is calibrated as follows: The equation of the light plane at time The function expression; (Formula 14-19) Step 7: After system calibration, perform 3D measurement. For reflective materials, first perform median filtering with kernel w and grayscale centroid method to coarsely extract the center point; Step 8: After coarsely extracting the center point using the gray-scale centroid method, Kalman filtering is used for outlier detection and correction to obtain the corrected center point coordinates. ; Step 9: Corrected center point coordinates Using this point as the center, extract N sets of data from the center points in the five rows above and below it. , A straight line is fitted to the center point of the point set, and the center point is finally determined based on the fitted line. The slope.
[0040] The specific implementation process is as follows: 1. Set up a measurement system.
[0041] like Figure 1 As shown, the galvanometer-based line laser 3D scanning measurement system mainly consists of a galvanometer, a galvanometer motor, a line laser, a calibration plate, and a CCD camera. This system drives the laser to perform efficient scanning by galvanometer oscillation, thereby completing the measurement task. Before performing the optical plane calibration task, camera calibration is required to obtain its in-camera distortion coefficients.
[0042] 2. Quaternion-based measurement system calibration.
[0043] 2.1 Calibrate the initial light plane.
[0044] like Figure 2 As shown, a line laser is applied to a galvanometer after it is powered on. At this point, the galvanometer is not rotating, and the light plane reflected by the galvanometer is the initial light plane P0. By changing the height (h) of the calibration plate multiple times (at least twice) and taking images of the calibration plate after each height change using a CCD camera, the equation of the light plane P0 can be determined using a traditional fixed light plane calibration method. Thus, a normal vector n0 on the plane equation P0 can be obtained, and the initial plane light plane rotation angle is assumed to be zero.
[0045] 2.2 Determine the linear equation of the rotation axis.
[0046] The driving galvanometer causes the optical plane to rotate along a fixed axis. Based on the motor characteristics of the galvanometer (this invention uses an AT40MD scanning galvanometer with m = 0.5V / °), the voltage change supplied to the galvanometer motor... Angle of rotation of the galvanometer a They are directly proportional, that is: (1) in m This is the proportionality coefficient.
[0047] Meanwhile, based on the reflection theorem, the angle of rotation of the light plane is twice the angle of rotation of the galvanometer, from which the voltage change of the galvanometer motor can be obtained. Rotation angle with respect to the light plane for: (2) The rotation angle of the optical plane can be obtained by changing the voltage of the galvanometer motor. To determine the equation of the straight line of the axis of rotation, like Figure 3As shown, by controlling the galvanometer motor, the optical plane rotates by 2 degrees each time. The equation of the optical plane for each rotation is calibrated using the calibration method in step 2.1. A total of four rotations are performed. The equations of the optical plane under different rotation angles can then be obtained. : (3) in, It is the unit normal vector of the plane. It is the offset of the plane from the origin. r For light plane The coordinates of any point on the surface.
[0048] The equation of the straight line that forms the axis of rotation is: (4) in, It is a point on a straight line. It is a straight line The direction vector.
[0049] Because of the straight line Theoretically, it is a plane. The common line of the two lines satisfies the following equation: (5) (6) Due to installation errors during the installation process, this paper proposes a rotary shaft calibration compensation method: First, the optical plane Pb can be calibrated using the traditional fixed optical plane calibration method: (7) in, It is the unit normal vector of the plane. It is the offset of the plane from the origin. rb For light plane The coordinates of any point on the surface.
[0050] Find the plane With plane intersection That is: (8) in, It is a straight line A little bit above, It is a straight line The direction vector.
[0051] Let all lines The intersection point is ; Point Substituting into further formula (8), we get Point to line The distance is: (9) Based on the idea of least squares, we construct a method to minimize the sum of squared distances between all lines: (10) Expanding the cross product of formula (10) yields: (11) For each Taking the partial derivative and setting it to zero yields a corresponding linear equation. Solving this linear equation provides the optimal intersection point. By fine-tuning the laser's position, another optimal intersection point can be obtained using the same method. And based on the rotation principle of the galvanometer... and The two points are located on the axis of rotation. Substituting them into formula (4) will give the axis of rotation. .
[0052] The plane can be calibrated using existing optical plane calibration methods. and plane Therefore, the line of intersection of the two planes can be determined. That is: (12) The plane is continuously optimized through an iterative method. and plane , so that: (13) The installation positions of the laser and galvanometer can then be determined.
[0053] 2.3 Calibration of the dynamic light plane.
[0054] To calibrate the rotation angle of the optical plane The equation of the light plane at time : (14) in, Corresponding dynamic light plane The normal vector, For dynamic light plane Any coordinate point on, It is a dynamic light plane The offset from the origin.
[0055] Dynamic light plane Rotation angle The subsequent single quaternion express: (15) normal vector Convert to pure quaternions Then the rotation angle of the light plane can be obtained. The equation of the light plane after Normal vector: (16) The calculation yielded the following result: (17) Then the points in formula (4) r 0. The normal vector in formula (17) Substituting into formula (14) yields the result. : (18) Finally, the dynamic light plane can be calibrated using equations (17) and (18). : (19) 3. Center point extraction to combat reflective noise.
[0056] After the calibration described above, the measurement system can perform three-dimensional measurements. However, in reflective materials, the accuracy of center point extraction is reduced, affecting subsequent measurement tasks. This technical solution achieves accurate extraction of fillet weld feature points from weld images with laser light stripes through steps such as image filtering, coarse center point extraction, outlier detection and correction using Kalman filtering, and fillet weld extraction. This method combines the advantages of image processing and Kalman filtering, improving the robustness and accuracy of center point extraction, and is suitable for weld inspection in industrial welding scenarios.
[0057] 3.1. Image filtering.
[0058] Using an industrial grayscale CCD camera, the camera is aimed at the laser beam and the weld area is photographed to obtain an image of the weld with the beam. The image is then processed by the computer's image processing system using median filtering. ; After filtering Pixel value at that location, This indicates retrieving the median gray value among all gray levels within the window. Represents the center pixel of the window grayscale value, The median represents the filter kernel, where all elements are 1. Median filtering is a type of nonlinear filtering, which is very effective at filtering noise. Unlike linear filtering, it does not blur image details. Furthermore, median filtering is simple to calculate and ensures fast algorithm execution. Therefore, median filtering is chosen for noise reduction.
[0059] 3.2. Coarse extraction of center points.
[0060] Based on the gray-level distribution characteristics of laser streaks in images, the gray-level centroid method determines the center point by calculating the gray-level values on the cross-section of the streak. Although it is simple to calculate and has good real-time performance, it is only applicable to laser streaks in low-noise environments. To improve the robustness and accuracy of the gray-level centroid method, a weighted approach is proposed, increasing the weight of the central region and reducing interference from the edge region.
[0061] The grayscale weighting method is used to determine the center point coordinates of each row of pixels in a vertical laser light stripe image. The calculation is as follows: ; in, These are the column coordinates of the pixels. It is the first Line number The grayscale value at the column, , These represent the start and end positions of the light stripe. In the image coordinate system, the row increment direction is the y-axis, and the column increment direction is the x-axis.
[0062] 3.3. Abnormal center point detection and correction.
[0063] Suppose the extracted center point sequence is: ,in These are the image row numbers.
[0064] 3.3.1 Definition of state variables for Kalman filtering.
[0065] For the first in the image The center point of the row is defined as having a Kalman filter state vector as follows: ; in, For the first The column coordinates of the row center point The local slope is the rate of change of the path in the column direction in the vertical scanning direction (row direction). Unlike the traditional mathematical definition of slope, this invention defines the local slope for image scanning logic.
[0066] 3.3.2 State transition model.
[0067] Since the step size in the row direction is 1, the path is approximately smooth and continuous in the vertical direction, and the state transition equation that can be modeled is: ;in, , ; It is the previous line Given the current slope, the slope remains constant in the short term. For process noise, This is the process noise covariance matrix, used to reflect the intensity of slope fluctuations.
[0068] 3.3.3 Observation model.
[0069] The x-coordinate of the path center point extracted from each row of images is the observation value, and the observation model is established as follows: ;in, , ; Only observe the x-axis The slope cannot be directly observed. , The observation noise covariance matrix is used to reflect the accuracy of image center point extraction.
[0070] 3.3.4 Perform anti-reflective extraction on the center point of the line laser.
[0071] Given initial state estimate Covariance The Kalman filter recursive algorithm is as follows: State prediction in one step: ; One-step prediction mean square error: ; Filter gain: ; State estimation: ; Estimate mean square error: ; In the above formula: It is the identity matrix. Given an initial state estimate Covariance According to the Line measurement value Then it can be calculated recursively. Row state estimation Local path slope and the filtered x-coordinate position This recursive calculation is repeated.
[0072] To address the issue of significant deviation in extracting the center point of reflective areas, a residual method is introduced to determine if the center point of that row is an anomaly. ; when When a threshold is set, if it is determined that a point may be affected by reflective interference, then the center point of that row is removed. Therefore, the energy function is used... ,in, This represents the Euclidean distance between the center point of the previous row and the predicted center point of the current row, calculated as follows: , These are the coordinates of the center point of the previous row. This predicts the coordinates of the center point of the row. The greater the distance, the better. The larger the value, the better. This represents the grayscale value of the second point (assuming the image is a single-channel grayscale image). A higher grayscale value indicates that the point is brighter in the image. By calculating the energy function, the shortest path with the lowest energy, i.e., the path with the highest grayscale, can be found. In this way, even with reflective interference, the corrected center point coordinates can be obtained. This improves the accuracy and robustness of center point extraction.
[0073] Corrected center point coordinates Using this point as the center, extract N sets of data from the center points in the five rows above and below it. , A straight line is fitted to the center point of the point set, and the center point is finally determined based on the fitted line. The slope.
[0074] In the equation of the fitted line and The functional relationship between them is: ; The formula contains two undetermined parameters. Represents the intercept. This represents the slope. For the N sets of data obtained... , Fit a straight line, requiring the observed values Weighted sum of squares of deviations To minimize it, the formula is as follows: ; Taking the partial derivatives of the above equation with respect to a and b respectively, we get: ; ; After simplification, we obtain the following system of equations: ; ; Solving the above system of equations yields the best estimates of the linear parameters a and b, as follows: ; ; in For the required center point The slope.
[0075] The embodiments described above are for illustrative purposes only and are not intended to limit the invention. Therefore, any changes in numerical values or substitutions of equivalent elements should still fall within the scope of this invention.
[0076] The above detailed description will enable those skilled in the art to understand that the present invention can indeed achieve the aforementioned objectives and has complied with the provisions of the Patent Law.
[0077] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the invention. The above descriptions are merely preferred embodiments of the invention and are not intended to limit the invention. It should be noted that any modifications, equivalent substitutions, and improvements made within the spirit and principles of the invention should be included within the scope of protection of the invention.
[0078] It should be noted that the above description of the process is for illustrative purposes only and does not limit the scope of this specification. Those skilled in the art can make various modifications and changes to the process under the guidance of this specification. However, these modifications and changes remain within the scope of this specification.
[0079] The basic concepts have been described above. Obviously, for those skilled in the art who have read this application, the above disclosure is merely illustrative and does not constitute a limitation of this application. Although not explicitly stated herein, those skilled in the art may make various modifications, improvements, and corrections to this application. Such modifications, improvements, and corrections are suggested in this application, and therefore, such modifications, improvements, and corrections still fall within the spirit and scope of the exemplary embodiments of this application.
[0080] Furthermore, this application uses specific terms to describe its embodiments. For example, "an embodiment," "one embodiment," and / or "some embodiments" refer to a particular feature, structure, or characteristic related to at least one embodiment of this application. Therefore, it should be emphasized and noted that "an embodiment," "one embodiment," or "an alternative embodiment" mentioned twice or more in different positions in this specification do not necessarily refer to the same embodiment. In addition, certain features, structures, or characteristics in one or more embodiments of this application can be appropriately combined.
[0081] Furthermore, those skilled in the art will understand that aspects of this application can be described and illustrated through several patentable types or situations, including any new and useful combination of processes, machines, products, or substances, or any new and useful improvements thereof. Therefore, aspects of this application can be implemented entirely in hardware, entirely in software (including firmware, resident software, microcode, etc.), or a combination of hardware and software. All of the above hardware or software can be referred to as a “unit,” “module,” or “system.” Furthermore, aspects of this application can take the form of a computer program product embodied in one or more computer-readable media, wherein computer-readable program code is contained therein.
[0082] The computer program code required for the operation of each part of this application can be written in any one or more programming languages, including object-oriented programming languages such as Java, Scala, Smalltalk, Eiffel, JADE, Emerald, C++, C#, VB.NET, and Python; general programming languages such as C; Visual Basic, Fortran2103, Perl, COBOL2102, PHP, and ABAP; dynamic programming languages such as Python, Ruby, and Groovy; or other programming languages. This program code can run entirely on the user's computer, or as a standalone software package on the user's computer, or partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the latter case, the remote computer can be connected to the user's computer via any network, such as a local area network (LAN) or wide area network (WAN), or connected to an external computer (e.g., via the Internet), or in a cloud computing environment, or used as a service such as Software as a Service (SaaS).
[0083] Furthermore, unless expressly stated in the claims, the order of processing elements and sequences, the use of numbers and letters, or other names described in this application are not intended to limit the order of the processes and methods of this application. Although some currently considered useful embodiments of the invention have been discussed in the foregoing disclosure by way of various examples, it should be understood that such details are for illustrative purposes only, and the appended claims are not limited to the disclosed embodiments; rather, the claims are intended to cover all modifications and equivalent combinations that conform to the substance and scope of the embodiments of this application. For example, although the implementation of the various components described above can be embodied in a hardware device, it can also be implemented as a purely software solution, such as an installation on an existing server or mobile device.
[0084] Similarly, it should be noted that, in order to simplify the description of the present application and thus aid in the understanding of one or more embodiments of the invention, the foregoing description of the embodiments of the present application sometimes combines multiple features into a single embodiment, drawing, or description thereof. However, this approach of the present application should not be construed as reflecting an intention that the claimed subject matter requires more features than expressly recited in each claim. Rather, the subject of the invention should possess fewer features than in any single embodiment described above.
Claims
1. An error compensation calibration method based on unit quaternions, characterized in that, include: S11. Set up the required measurement system for calibration, including galvanometer, galvanometer motor, line laser, calibration board and CCD camera; S12. Calibrate the CCD camera to obtain camera intrinsic parameters and distortion coefficients; S13. Project the line laser onto the energized but not rotating galvanometer to form an initial light plane. Change the height of the calibration plate and take an image through a CCD camera. Combine the camera intrinsic parameters and distortion coefficients to calibrate the equation of the initial light plane and the normal vector. S14. Establish the relationship between the voltage change of the galvanometer motor and the rotation angle of the galvanometer and the rotation angle of the optical plane; S15. Based on the aforementioned correlation, control the galvanometer to drive the optical plane to rotate multiple times. After each rotation, capture an image through a CCD camera. Combine the camera's intrinsic parameters and distortion coefficients to calibrate the corresponding optical plane equation. Based on the common line characteristics of the initial optical plane equation and the optical plane equations after each rotation, determine the initial rotation axis straight line equation. S16. Based on all the optical plane equations, the assembly error between the line laser and the galvanometer is corrected by minimizing the sum of squares of the straight distances, and the initial linear equation of the rotation axis is optimized to obtain the optimized linear equation of the rotation axis. S17. Construct a dynamic light plane model based on unit quaternions, combine the initial light plane normal vector and the optimized rotation axis line equation, derive the dynamic light plane equation corresponding to different light plane rotation angles, and complete the error compensation calibration.
2. The error compensation calibration method based on unit quaternions according to claim 1, characterized in that, In step S13, the height of the calibration plate is changed no less than twice. Through multiple height adjustments, the calibration accuracy of the initial light plane equation and normal vector is ensured.
3. The error compensation calibration method based on unit quaternions according to claim 1, characterized in that, In step S15, the light plane rotates 4 times, with each rotation angle being 2 degrees. The rotation angle of the galvanometer and the rotation angle of the light plane satisfy the reflection theorem, and the rotation angle of the light plane is twice the rotation angle of the galvanometer.
4. The error compensation calibration method based on unit quaternions according to claim 1, characterized in that, The specific implementation process of the method for minimizing the sum of squared distances in step S16 is as follows: solve for the intersection lines of adjacent light planes in all light planes, calculate the distance from the preset point to each intersection line and construct the objective function for minimizing the sum of squared distances, solve the objective function to obtain the optimal intersection point on the rotation axis, and optimize the initial linear equation of the rotation axis based on the optimal intersection point.
5. A method for resisting reflective noise, characterized in that, include: S21. Take a laser stripe image of the surface of the object being measured using a CCD camera, wherein the CCD camera has been pre-calibrated and its intrinsic parameters and distortion coefficients have been acquired; S22. Preprocess the laser stripe image by combining camera intrinsic parameters and distortion coefficients; S23. Filter the preprocessed image to remove noise interference; S24. The gray-scale centroid method is used to coarsely extract the laser center point of the filtered image to obtain coarsely extracted center point data. S25. Perform outlier detection and correction on the coarsely extracted center point data using Kalman filtering, remove outliers caused by reflection interference, and obtain the corrected center point coordinates. S26. Using the corrected center point as a reference, select multiple rows of coarsely extracted center point data above and below it for straight line fitting to determine the slope of the center point and complete the center point extraction for anti-reflective noise.
6. The method for resisting reflective noise according to claim 5, characterized in that, The filtering process in step S23 is median filtering. During the filtering process, the median value of all gray values in the filtering window is taken as the filtered pixel value, which preserves image details while removing noise.
7. The method for resisting reflective noise according to claim 5, characterized in that, In step S24, a gray-scale weighted centrifugal method is used for coarse extraction. By increasing the gray-scale weight of the central region of the laser stripe and reducing the weight of the edge region, the influence of edge interference on the coarse extraction result is reduced.
8. The method for resisting reflective noise according to claim 5, characterized in that, In step S26, the coarsely extracted center point data is the dataset of the five rows above and below the corrected center point. The slope parameter of the center point is obtained by fitting a straight line through the method of minimizing the weighted sum of squares.
9. A method for error compensation calibration and anti-reflective noise measurement based on unit quaternions, characterized in that, include: S31. Using the error compensation calibration method described in claim 1, the dynamic light plane calibration of the measurement system is completed, and the dynamic light plane equations corresponding to different light plane rotation angles are obtained. S32. Using the anti-reflective noise center point extraction method described in claim 2, obtain the precise center point coordinates and slope of the laser light stripe on the surface of the measured object; S33. Combining the dynamic light plane equation with the precise center point coordinates and slope, calculate the three-dimensional coordinates of the object being measured to complete the three-dimensional measurement.
10. The method for error compensation calibration and anti-reflective noise measurement based on unit quaternions according to claim 9, characterized in that, The galvanometer in the measurement system is an AT40MD scanning galvanometer. The proportionality coefficient between the galvanometer motor voltage change and the galvanometer rotation angle is 0.5V / °. This measurement method is suitable for three-dimensional contour measurement of reflective materials and industrial welding scenarios.