A method and related equipment for point cloud distortion correction based on 3D line scanning camera

By using right-angle standard parts in 3D line scanning cameras to fit the plane equation and obtain the transformation matrix, the problem of distortion between the imaging point cloud and the actual object structure of the 3D line scanning camera is solved, and the correction of the point cloud image is achieved and the improvement of the point cloud image is improved. Measurement accuracy.

CN114022636BActive Publication Date: 2024-12-20HANGZHOU HUICUI INTELLIGENT TECH CO LTD +3
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111097994.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-18
Publication Date
2024-12-20
Estimated Expiration
2041-09-18

AI Technical Summary

Technical Problem

In actual applications, 3D line scanning cameras have distortions between the imaging point cloud and the three-dimensional structure of the actual object due to installation errors and scene limitations, and there is a lack of effective correction methods.

Method used

Using the point cloud distortion correction method based on the 3D line scanning camera, the point cloud image is captured on the uniform motion platform, and the vertical plane equation is fitted to obtain the transformation matrix from the distorted coordinate system to the actual coordinate system. And the point cloud image of the object to be measured is converted through this matrix to eliminate distortion.

Benefits of technology

The distortion between the point cloud formed by 3D line scanning camera imaging and the three-dimensional structure of the actual object is effectively corrected, and the measurement accuracy and accuracy are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114022636B_ABST
    Figure CN114022636B_ABST
Patent Text Reader

Abstract

The present invention discloses a point cloud distortion correction method based on a 3D line scanning camera and related equipment, wherein the method includes: after setting a right-angle standard part on a uniform motion platform, starting the uniform motion platform and shooting with a 3D line scanning camera to obtain a point cloud image of the right-angle standard part; performing plane fitting on two vertical planes in the point cloud image respectively to obtain a pair of plane equations in a distorted coordinate system; calculating a conversion matrix from the distorted coordinate system to the actual coordinate system according to the plane equations; converting the point cloud image of the object to be measured by the conversion matrix to obtain a corrected point cloud image. This method finds the conversion relationship between the distorted coordinate system and the actual coordinate system by using the feature that the dot product of the normal vector of the two vertical planes in the right-angle standard part is 0, thereby solving the problem of distortion between the point cloud formed by the final imaging of the 3D line scanning camera and the three-dimensional structure of the actual object.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of 3D line scanning, and more specifically, to a point cloud distortion correction method based on a 3D line scanning camera and related equipment. Background Art

[0002] 3D line scan cameras are widely used in industry and have the following advantages: Line scan cameras can have multiple K unit pixels, so the resolution is very high, which is very suitable for high-precision detection and measurement applications. At the same time, they can also be used for applications that require continuous high-resolution imaging and continuous imaging of moving objects, and their measurements can be accurate to microns; Line scan cameras have a very large dynamic range and high sensitivity, which is very suitable for industrial inspection projects that require a large field of view.

[0003] The imaging principle of a 3D line scan camera is: a laser beam is emitted at a certain frequency, and the laser hits the surface of the object to be measured and reflects to the camera sensor, obtaining the profile height information of a section of the object to be measured. In general, a 3D line scan camera is fixedly installed, and the object to be measured moves at a constant speed, and the movement speed is consistent with the frequency of the laser emitted by the camera. The final point cloud imaging of the camera is the surface of the object to be measured in a three-dimensional orthogonal coordinate system, which can be considered as a curved surface composed of contour lines on the XOZ plane along the Y direction.

[0004] According to the imaging principle of 3D line scan cameras, the default task light plane XOZ is perpendicular to the motion direction Y. However, in actual applications, due to errors in manual installation or location limitations in industrial scenes, the camera's X'OZ' light plane is not perpendicular to the Y direction of the actual object's motion (see Figure 1 ). This results in distortion between the point cloud formed by the final imaging and the actual three-dimensional structure of the object (see Figure 2 ).

[0005] Therefore, how to propose a point cloud distortion correction method based on a 3D line scan camera to eliminate the distortion between the point cloud finally imaged by the 3D line scan camera and the three-dimensional structure of the actual object is an urgent problem to be solved by technical personnel in this field. Summary of the invention

[0006] In view of the above problems, the purpose of the present invention is to provide a point cloud distortion correction method and related equipment based on a 3D line scanning camera to solve the problem of distortion between the point cloud finally imaged by the 3D line scanning camera and the three-dimensional structure of the actual object.

[0007] A first aspect of the present invention provides a method for correcting point cloud distortion based on a 3D line scanning camera, comprising the following steps:

[0008] S1, after placing the right-angle standard part on a uniform motion platform, starting the uniform motion platform and photographing with a 3D line scanning camera to obtain a point cloud image of the right-angle standard part;

[0009] S2, performing plane fitting on two vertical planes in the point cloud image respectively to obtain a pair of plane equations in a distorted coordinate system;

[0010] S3, calculating a transformation matrix from the distorted coordinate system to the actual coordinate system according to the plane equation;

[0011] S4, transforming the point cloud image of the object to be measured by using the transformation matrix to obtain a corrected point cloud image.

[0012] In this solution, step S3 specifically includes:

[0013] S31, converting the plane equation pair into a two-variable quadratic equation;

[0014] S32, solving the quadratic equation to obtain a transformation matrix from the distorted coordinate system to the actual coordinate system.

[0015] In this solution, before step S31, it also includes:

[0016] S30, changing the posture of the right-angle standard part, and repeating steps S1 and S2 until a preset number of pairs of plane equations are obtained;

[0017] The step S31 specifically includes: converting each pair of the plane equations into a two-variable quadratic equation;

[0018] The step S32 specifically includes: solving the quadratic equation using the gradient descent method to obtain a transformation matrix from the distorted coordinate system to the actual coordinate system.

[0019] In this solution, the plane equation pair in the distorted coordinate system is specifically:

[0020] A1X+B1Y+C1Z+D1=0 and A2X+B2Y+C2Z+D2=0;

[0021] Among them, A1, B1, C1, and D1 are the coefficients of the first plane equation, and A2, B2, C2, and D2 are the coefficients of the second plane equation;

[0022] The conversion of the plane equation pair into the corresponding quadratic equation is specifically:

[0023] use Represents the Y axis of the distortion coordinate system, and the value range of x and y is [-1, 1]. Then the transformation matrix T is:

[0024]

[0025] According to the transformation matrix, the coefficients of the plane equation in the actual coordinate system satisfy:

[0026]

[0027] Where [A′ B′ C′ D′] represents the coefficients of the plane equation in the actual coordinate system, [ABCD] represents the coefficients of the plane equation in the distorted coordinate system, and t x ,t y ,t z is the translation of the coordinate system and is simplified to 0;

[0028] According to the coefficient relationship of the vertical plane in the actual coordinate system, we get:

[0029]

[0030] make

[0031] We get the quadratic equation: f(x, y) = ax 2 +by 2 +cxy+dx+ey+f=0.

[0032] In this solution, the gradient descent method is used to solve the quadratic equation to obtain a transformation matrix from the distorted coordinate system to the actual coordinate system:

[0033] Take a preset number of random initial (x, y);

[0034] Iterative calculation F = ∑f 2 (x, y) and the gradient in the x and y directions: Update the x and y values ​​according to the preset change rate according to the gradient direction until the preset number of iterations is reached or the x and y gradients converge.

[0035] In this solution, the right-angle standard part is specifically a standard cast iron or marble right-angle ruler.

[0036] The second aspect of the present invention further provides a point cloud distortion correction system based on a 3D line scanning camera, comprising a uniform motion platform, a right-angle standard part, a 3D line scanning camera, a memory and a processor, wherein the memory comprises a point cloud distortion correction method program based on a 3D line scanning camera, and when the point cloud distortion correction method program based on a 3D line scanning camera is executed by the processor, the following steps are implemented:

[0037] S1, after placing the right-angle standard part on a uniform motion platform, starting the uniform motion platform and photographing with a 3D line scanning camera to obtain a point cloud image of the right-angle standard part;

[0038] S2, performing plane fitting on two vertical planes in the point cloud image respectively to obtain a pair of plane equations in a distorted coordinate system;

[0039] S3, calculating a transformation matrix from the distorted coordinate system to the actual coordinate system according to the plane equation;

[0040] S4, transforming the point cloud image of the object to be measured by using the transformation matrix to obtain a corrected point cloud image.

[0041] In this solution, step S3 specifically includes:

[0042] S31, converting the plane equation pair into a two-variable quadratic equation;

[0043] S32, solving the quadratic equation to obtain a transformation matrix from the distorted coordinate system to the actual coordinate system.

[0044] In this solution, the right-angle standard part is specifically a standard cast iron or marble right-angle ruler.

[0045] A third aspect of the present invention provides a computer-readable storage medium, which includes a machine-based 3D line scanning camera point cloud distortion correction method program. When the 3D line scanning camera point cloud distortion correction method program is executed by a processor, the steps of the 3D line scanning camera point cloud distortion correction method as described in any one of the above items are implemented.

[0046] The present invention discloses a method for correcting point cloud distortion based on a 3D line scanning camera, comprising: after a right-angle standard part is set on a uniform motion platform, the uniform motion platform is started, and a 3D line scanning camera is used to shoot to obtain a point cloud image of the right-angle standard part; two vertical planes in the point cloud image are respectively fitted to obtain a pair of plane equations in a distorted coordinate system; a transformation matrix from the distorted coordinate system to the actual coordinate system is obtained according to the plane equations; the point cloud image of the object to be measured is transformed by the transformation matrix to obtain a corrected point cloud image. This method uses the feature that the dot product of the normal vectors of the two vertical planes in the right-angle standard part is 0 to find the transformation relationship between the distorted coordinate system and the actual coordinate system, obtain the transformation matrix, and then transform the point cloud image of the object to be measured according to the transformation matrix, thereby solving the problem of distortion between the point cloud formed by the final imaging of the 3D line scanning camera and the three-dimensional structure of the actual object, and achieving the effect of correcting the point cloud image. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 A schematic diagram showing that the light plane of the 3D line scan camera is not perpendicular to the direction of motion of the object being measured;

[0048] Figure 2A schematic diagram showing the distortion between the three-dimensional structures of actual objects in point cloud imaging;

[0049] Figure 3 A flowchart of a method for correcting point cloud distortion based on a 3D line scanning camera in an embodiment of the present invention is shown;

[0050] Figure 4 A flowchart of a point cloud distortion correction method based on a 3D line scanning camera in another embodiment of the present invention is shown;

[0051] Figure 5 A block diagram of a point cloud distortion correction system based on a 3D line scanning camera according to the present invention is shown. DETAILED DESCRIPTION

[0052] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0053] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.

[0054] Figure 3 A flow chart of a method for point cloud distortion correction based on a 3D line scanning camera in an embodiment of the present invention is shown.

[0055] like Figure 3 As shown, the present invention discloses a method for point cloud distortion correction based on a 3D line scanning camera, comprising the following steps:

[0056] S302, after placing the right-angle standard component on a uniform motion platform, starting the uniform motion platform and photographing with a 3D line scanning camera to obtain a point cloud image of the right-angle standard component;

[0057] S304, performing plane fitting on two vertical planes in the point cloud image respectively to obtain a pair of plane equations in a distorted coordinate system;

[0058] S306, obtaining a transformation matrix from the distorted coordinate system to the actual coordinate system according to the plane equation;

[0059] S308, transforming the point cloud image of the object to be measured by using the transformation matrix to obtain a corrected point cloud image.

[0060] It should be noted that the present invention utilizes the feature that the dot product of the normal vector of mutually perpendicular planes in the real coordinate system is 0. First, the right-angle position of the right-angle standard part is oriented toward the 3D line scanning camera (so that the camera can take a picture), and is placed on a motion platform with uniform linear motion. Various postures are randomly placed, and the motion platform is started. The right-angle standard part is scanned and photographed with the 3D line scanning camera to obtain a point cloud image of the right-angle standard part; then, the plane equations of two planes that are perpendicular to each other in the real coordinate system in the point cloud image (i.e., the two mutually perpendicular planes in the right-angle standard part) are fitted, and these two plane equations are called a plane equation pair; a matrix with the coefficients of the plane equation pair as elements is established. Since the two planes are distorted planes obtained based on the scanning of the 3D line scanning camera, The plane equation pair is a plane equation pair in a distorted coordinate system; a transformation matrix is ​​proposed so that the coefficient matrix of the plane equation in the distorted coordinate system is multiplied by the transformation matrix to obtain the coefficient matrix of the plane equation in the actual coordinate system; since the plane equation pair in the distorted coordinate system is vertical in the actual coordinate system, the specific elements of the transformation matrix can be solved according to the feature that the dot product of the normal vector of the vertical plane is 0; after solving the transformation matrix, the two planes of the fitted right-angle standard part can be vertical, and then the object to be measured that actually needs to be measured is set on a uniform speed platform and scanned and photographed using a 3D line scanning camera to obtain a point cloud image of the object to be measured, and the point cloud image of the object to be measured is transformed by the transformation matrix to obtain a corrected point cloud image.

[0061] It should be noted that in the method for calibrating the distortion correction matrix of the present invention, the right-angle standard parts used are used in many scenarios in reality, do not need to be specially made, and have low cost.

[0062] An embodiment of the present invention provides a point cloud distortion correction method based on a 3D line scanning camera. By using the feature that the dot product of the normal vectors of two perpendicular planes in a rectangular standard part is 0, the transformation relationship between the distorted coordinate system and the actual coordinate system is found, and the transformation matrix is ​​obtained. Then, the point cloud image of the object to be measured is transformed according to the transformation matrix, thereby solving the problem of distortion between the point cloud finally imaged by the 3D line scanning camera and the three-dimensional structure of the actual object, and achieving the effect of correcting the point cloud image.

[0063] Based on the above embodiment, another embodiment of the present application further improves the above specific steps. Figure 4 , Figure 4 A flowchart of a method for correcting point cloud distortion based on a 3D line scanning camera in another embodiment of the present invention is shown, comprising:

[0064] S402, after placing the right-angle standard component on a uniform motion platform, starting the uniform motion platform and photographing with a 3D line scanning camera to obtain a point cloud image of the right-angle standard component;

[0065] S404, performing plane fitting on two vertical planes in the point cloud image respectively to obtain a pair of plane equations in a distorted coordinate system;

[0066] S406, converting the plane equation pair into a two-variable quadratic equation;

[0067] S408, solving the quadratic equation to obtain a transformation matrix from the distorted coordinate system to the actual coordinate system;

[0068] S410, transforming the point cloud image of the object to be measured by using the transformation matrix to obtain a corrected point cloud image.

[0069] It can be understood that the distorted coordinate system can be considered as the XOZ plane of the actual coordinate system remains unchanged, while the Y axis direction changes. Without considering the scaling, it is considered that the X, Y, and Z axes are all unit vectors, which can be expressed as Represents the Y axis of the distorted coordinate system, and the value range of x and y is [-1, 1]. By simultaneously solving the pair of plane equations and combining the perpendicular relationship between the pair of plane equations, the pair of plane equations can be converted into a quadratic equation about x and y.

[0070] It can be understood that, since the two-variable quadratic equation has countless solutions, it is also possible to fit another pair of plane equations of perpendicular planes on the right-angle standard part to obtain two two-variable quadratic equations to achieve the solution.

[0071] According to an embodiment of the present invention, before step S406, the method further includes:

[0072] S405, changing the posture of the right-angle standard part, and repeating steps S402 to S406 until a preset number of pairs of plane equations are obtained;

[0073] Step S406 specifically includes: converting each pair of the plane equations into a quadratic equation of two variables;

[0074] Step S408 specifically includes: solving the quadratic equation using the gradient descent method to obtain a transformation matrix from the distorted coordinate system to the actual coordinate system.

[0075] It is understandable that in order to ensure the accuracy of the conversion matrix, the present invention uses the gradient descent method to solve the binary quadratic equation. First, it is necessary to obtain multiple pairs of binary quadratic equations, which can be achieved by changing the posture of the right-angle standard parts and repeating the scanning and plane fitting steps. This embodiment uses mathematical methods such as fitting planes, multiple images, and gradient descent to make the calculation results statistically significant and eliminate specific errors.

[0076] It should be noted that the plane equation pair in the distorted coordinate system is specifically:

[0077] A1X+B1Y+C1Z+D1=0 and A2X+B2Y+C2Z+D2=0;

[0078] Among them, A1, B1, C1, and D1 are the coefficients of the first plane equation, and A2, B2, C2, and D2 are the coefficients of the second plane equation;

[0079] The conversion of the plane equation pair into the corresponding quadratic equation is specifically:

[0080] use Represents the Y axis of the distortion coordinate system, and the value range of x and y is [-1, 1]. Then the transformation matrix T is:

[0081]

[0082] According to the transformation matrix, the coefficients of the plane equation in the actual coordinate system satisfy:

[0083]

[0084] Where [A′ B′ C′ D′] represents the coefficients of the plane equation in the actual coordinate system, [ABCD] represents the coefficients of the plane equation in the distorted coordinate system, and t x ,t y ,t z is the translation of the coordinate system and is simplified to 0;

[0085] According to the coefficient relationship of the vertical plane in the actual coordinate system, we get:

[0086]

[0087] make

[0088] We get the quadratic equation: f(x, y) = ax 2 +by 2 +cxy+dx+ey+f=0.

[0089] It can be understood that by performing least squares plane fitting on the two “vertical” planes in each point cloud image, the plane equations in the distorted imaging coordinate system are obtained: A1X+B1Y+C1Z+D1=0, A2X+B2Y+C2Z+D2=0.

[0090] The distorted coordinate system can be considered as the XOZ plane of the actual coordinate system remains unchanged, while the Y axis direction changes. Scaling is not considered here, that is, the X, Y, and Z axes are all unit vectors. Assume that Represents the Y axis of the distorted coordinate system, and the value range of x and y is [-1, 1]. Then the transformation matrix T from the distorted coordinate system to the actual coordinate system is:

[0091]

[0092] Solve the transformation matrix T - let the point in the actual coordinate system be [X' Y' Z'], and the point in the distorted image coordinate system be [XYZ]. The plane equations of the two planes in an image in the actual coordinate system satisfy:

[0093]

[0094] According to the transformation matrix, we can get the coefficients of the plane equation in the actual coordinate system:

[0095]

[0096] where t x ,t y ,t z is the translation of the two coordinate systems, which can be simplified to 0 in relative position without affecting the shape distortion. After sorting, we can get A', B', C' represented by A, B, C: In the actual coordinate system, the two planes are known to be perpendicular, that is, they satisfy: 0 = A'1A'2 + B'1B'2 + C'1C'2. The combined equation can be obtained:

[0097]

[0098] make: The problem then becomes a quadratic equation involving x and y: f(x, y) = ax 2 +by 2 +cxy+dx+ey+f=0.

[0099] According to an embodiment of the present invention, the gradient descent method is used to solve the quadratic equation to obtain a transformation matrix from the distorted coordinate system to the actual coordinate system:

[0100] Take N random initial (x, y), where N is an integer greater than 1;

[0101] Iterative Calculation And the gradient in the x and y directions: Update the x and y values ​​according to the preset change rate according to the gradient direction until the preset number of iterations is reached or the x and y gradients converge.

[0102] It can be understood that by using the planes fitted by the multiple point cloud images in step 406, multiple quadratic equations can be obtained, and the optimal solutions of x and y can be approximated by the stochastic gradient descent method.

[0103] (1) Take N random initial (x, y), where N is an integer greater than 1. For ease of understanding, N is specifically 10 here;

[0104] (2) Calculation for each iteration: And the gradient in the x and y directions: Update the x and y values ​​at a rate of 0.001 according to the gradient direction.

[0105] (3) Step (2) is iterated 100,000 times, or the gradients in the x and y directions converge (each change is less than 10 -10 ).

[0106] Apply the transformation matrix T to correct the point cloud image captured by the 3D line scan camera in the same scene. Apply the transformation matrix T obtained in the previous step to each point [XYZ] in the captured point cloud to obtain the corrected point cloud [X' Y' z']:

[0107]

[0108] It can be understood that the preset value, preset value, preset change rate, etc. in this embodiment can be changed according to actual conditions. This is only an example and is not specifically limited.

[0109] According to an embodiment of the present invention, the right-angle standard part is specifically a standard cast iron or marble right-angle ruler.

[0110] After testing, it was found that the plane of the point cloud fitting in reality was not vertical due to distortion in camera imaging. After the point cloud was corrected with the calibration correction matrix, the fitting plane could be vertical. The measurement results of the standard-sized gauge block were inaccurate under distortion. After the distorted point cloud was corrected, the measured value was consistent with the actual value.

[0111] Figure 5 A block diagram of a point cloud distortion correction system based on a 3D line scanning camera according to the present invention is shown.

[0112] like Figure 5 As shown, the present invention discloses a point cloud distortion correction system 5 based on a 3D line scanning camera, comprising a uniform motion platform, a right-angle standard part, a 3D line scanning camera, a memory 51 and a processor 52, wherein the memory 51 comprises a point cloud distortion correction method program based on a 3D line scanning camera, and when the point cloud distortion correction method program based on a 3D line scanning camera is executed by the processor 52, the following steps are implemented:

[0113] S1, after placing the right-angle standard part on a uniform motion platform, starting the uniform motion platform and photographing with a 3D line scanning camera to obtain a point cloud image of the right-angle standard part;

[0114] S2, performing plane fitting on two vertical planes in the point cloud image respectively to obtain a pair of plane equations in a distorted coordinate system;

[0115] S3, calculating a transformation matrix from the distorted coordinate system to the actual coordinate system according to the plane equation;

[0116] S4, transforming the point cloud image of the object to be measured by using the transformation matrix to obtain a corrected point cloud image.

[0117] It should be noted that the present invention utilizes the feature that the dot product of the normal vector of mutually perpendicular planes in the real coordinate system is 0. First, the right-angle position of the right-angle standard part is oriented toward the 3D line scanning camera (so that the camera can take a picture), and is placed on a motion platform with uniform linear motion. Various postures are randomly placed, and the motion platform is started. The right-angle standard part is scanned and photographed with the 3D line scanning camera to obtain a point cloud image of the right-angle standard part; then, the plane equations of two planes that are perpendicular to each other in the real coordinate system in the point cloud image (i.e., the two mutually perpendicular planes in the right-angle standard part) are fitted, and these two plane equations are called a plane equation pair; a matrix with the coefficients of the plane equation pair as elements is established. Since the two planes are distorted planes obtained based on the scanning of the 3D line scanning camera, The plane equation pair is a plane equation pair in a distorted coordinate system; a transformation matrix is ​​proposed so that the coefficient matrix of the plane equation in the distorted coordinate system is multiplied by the transformation matrix to obtain the coefficient matrix of the plane equation in the actual coordinate system; since the plane equation pair in the distorted coordinate system is vertical in the actual coordinate system, the specific elements of the transformation matrix can be solved according to the feature that the dot product of the normal vector of the vertical plane is 0; after solving the transformation matrix, the two planes of the fitted right-angle standard part can be vertical, and then the object to be measured that actually needs to be measured is set on a uniform speed platform and scanned and photographed using a 3D line scanning camera to obtain a point cloud image of the object to be measured, and the point cloud image of the object to be measured is transformed by the transformation matrix to obtain a corrected point cloud image.

[0118] It should be noted that in the method for calibrating the distortion correction matrix of the present invention, the right-angle standard parts used are used in many scenarios in reality, do not need to be specially made, and have low cost.

[0119] According to an embodiment of the present invention, step S3 specifically includes:

[0120] S31, converting the plane equation pair into a two-variable quadratic equation;

[0121] S32, solving the quadratic equation to obtain a transformation matrix from the distorted coordinate system to the actual coordinate system.

[0122] It can be understood that the distorted coordinate system can be considered as the XOZ plane of the actual coordinate system remains unchanged, while the Y axis direction changes. Without considering the scaling, it is considered that the X, Y, and Z axes are all unit vectors, which can be expressed as Represents the Y axis of the distorted coordinate system, and the value range of x and y is [-1, 1]. By simultaneously solving the pair of plane equations and combining the perpendicular relationship between the pair of plane equations, the pair of plane equations can be converted into a quadratic equation about x and y.

[0123] It can be understood that, since the two-variable quadratic equation has countless solutions, it is also possible to fit another pair of plane equations of perpendicular planes on the right-angle standard part to obtain two two-variable quadratic equations to achieve the solution.

[0124] According to an embodiment of the present invention, the right-angle standard part is specifically a standard cast iron or marble right-angle ruler.

[0125] A third aspect of the present invention provides a computer-readable storage medium, which includes a machine-based 3D line scanning camera point cloud distortion correction method program. When the 3D line scanning camera point cloud distortion correction method program is executed by a processor, a step of 3D line scanning camera point cloud distortion correction as described in any one of the above items is implemented.

[0126] The present invention discloses a point cloud distortion correction method and system based on a 3D line scanning camera and a readable storage medium. By adopting the feature that the dot product of the normal vector of two perpendicular planes in a right-angle standard part is 0, the conversion relationship between the distorted coordinate system and the actual coordinate system is found, and the conversion matrix is ​​obtained. Then, the point cloud image of the object to be measured is converted according to the conversion matrix, thereby solving the problem of distortion between the point cloud finally imaged by the 3D line scanning camera and the three-dimensional structure of the actual object, and achieving the effect of correcting the point cloud image.

[0127] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0128] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0129] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0130] Those skilled in the art can understand that: all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiments; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), disks or optical disks, and other media that can store program codes.

[0131] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.

Claims

1. A method for point cloud distortion correction based on 3D line scanning camera, It is characterized in that The following steps are involved: S1, after placing the right-angle standard part on a uniform motion platform, starting the uniform motion platform and photographing with a 3D line scanning camera to obtain a point cloud image of the right-angle standard part; S2, performing plane fitting on two vertical planes in the point cloud image respectively to obtain a pair of plane equations in a distorted coordinate system; S3, calculating a transformation matrix from the distorted coordinate system to the actual coordinate system according to the plane equation; S4, transforming the point cloud image of the object to be measured by using the transformation matrix to obtain a corrected point cloud image; The step S3 specifically includes: S31, converting the plane equation pair into a two-variable quadratic equation; S32, solving the quadratic equation to obtain a transformation matrix from the distorted coordinate system to the actual coordinate system; Before step S31, the method further includes: S30, changing the posture of the right-angle standard part, and repeating steps S1 and S2 until a preset number of pairs of plane equations are obtained; The step S31 specifically includes: converting each pair of the plane equations into a two-variable quadratic equation; The step S32 specifically includes: solving the binary quadratic equation using the gradient descent method to obtain a transformation matrix from the distorted coordinate system to the actual coordinate system.

2. The method for correcting point cloud distortion based on a 3D line scanning camera according to claim 1, It is characterized in that The plane equation pair in the distorted coordinate system is specifically: A 1 X + B 1 Y + C 1 Z + D 1 = 0 and A 2 X + B 2 Y + C 2 Z + D 2 = 0; Among them A 1 , B 1 , C 1 , D 1 is the coefficient of the first plane equation, A 2 , B 2 , C 2 , D is the coefficient of the second plane equation; The conversion of the plane equation pair into the corresponding quadratic equation of two variables is specifically: use Represents the Y axis of the distortion coordinate system, and the value range of x and y is [-1, 1]. Then the transformation matrix T is: According to the transformation matrix, the coefficients of the plane equation in the actual coordinate system satisfy: Where [A′ B′ C′ D′] represents the coefficients of the plane equation in the actual coordinate system, [ABCD] represents the coefficients of the plane equation in the distorted coordinate system, and t x ,t y ,t z is the translation of the coordinate system and is simplified to 0; According to the coefficient relationship of the vertical plane in the actual coordinate system, we get: make We get the quadratic equation: f(x, y) = ax 2 +by 2 +cxy+dx+ey+f=0.

3. The method for correcting point cloud distortion based on a 3D line scanning camera according to claim 2, It is characterized in that The gradient descent method is used to solve the quadratic equation to obtain the transformation matrix from the distorted coordinate system to the actual coordinate system: Take N random initial (x, y), where N is an integer greater than 1; Iterative Calculation And the gradient in the x and y directions: Update the x and y values ​​according to the preset change rate according to the gradient direction until the preset number of iterations is reached or the x and y gradients converge.

4. The method for correcting point cloud distortion based on a 3D line scanning camera according to any one of claims 1 to 3, It is characterized in that The right-angle standard part is specifically a standard cast iron or marble right-angle ruler.

5. A point cloud distortion correction system based on 3D line scanning camera, It is characterized in that The invention comprises a uniform motion platform, a right-angle standard part, a 3D line scanning camera, a memory and a processor. The memory comprises a point cloud distortion correction method program based on a 3D line scanning camera. When the point cloud distortion correction method program based on a 3D line scanning camera is executed by the processor, the following steps are implemented: S1, after placing the right-angle standard part on a uniform motion platform, starting the uniform motion platform and photographing with a 3D line scanning camera to obtain a point cloud image of the right-angle standard part; S2, performing plane fitting on two vertical planes in the point cloud image respectively to obtain a pair of plane equations in a distorted coordinate system; S3, calculating a transformation matrix from the distorted coordinate system to the actual coordinate system according to the plane equation; S4, transforming the point cloud image of the object to be measured by using the transformation matrix to obtain a corrected point cloud image; The step S3 specifically includes: S31, converting the plane equation pair into a two-variable quadratic equation; S32, solving the quadratic equation to obtain a transformation matrix from the distorted coordinate system to the actual coordinate system; Before step S31, the method further includes: S30, changing the posture of the right-angle standard part, and repeating steps S1 and S2 until a preset number of pairs of plane equations are obtained; The step S31 specifically includes: converting each pair of the plane equations into a two-variable quadratic equation; The step S32 specifically includes: solving the binary quadratic equation using the gradient descent method to obtain a transformation matrix from the distorted coordinate system to the actual coordinate system.

6. The point cloud distortion correction system based on a 3D line scanning camera according to claim 5, It is characterized in that The right-angle standard part is specifically a standard cast iron or marble right-angle ruler.

7. A computer-readable storage medium, It is characterized in that The computer-readable storage medium includes a program for a point cloud distortion correction method based on a 3D line scanning camera. When the program for the point cloud distortion correction method based on a 3D line scanning camera is executed by a processor, the steps of a point cloud distortion correction method based on a 3D line scanning camera as described in any one of claims 1 to 4 are implemented.