Rectangular fitting and measuring method of three-dimensional point cloud

Through the three-dimensional point cloud measurement method of rotation fitting and multiple rotation dimension reduction processing, the measurement inaccurate problem caused by principal component analysis is solved, and the precise dimension and coordinate measurement of the three-dimensional rectangle is achieved.

CN119444839APending Publication Date: 2025-02-14SUZHOU LEITU PHOTOELECTRIC TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411460991.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-18
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

In the existing three-dimensional measurement technology, the main component analysis is used to obtain the diagonal line of the rectangle that is easily biased towards the rectangle, resulting in inaccurate measurement.

Method used

A three-dimensional point cloud rectangle fitting and measurement method is proposed to obtain the precise dimensions and three-dimensional spatial coordinates of the rectangle through rotation fitting. Specific steps include determining the area of ​​the feature rectangle, plane fitting, projection processing, rotation matrix mapping and multiple rotation dimensionality reduction processing to obtain the area and coordinates of the smallest external rectangle.

Benefits of technology

Through dimensionality reduction and rotation processing, this method can accurately obtain the external rectangle of the three-dimensional point cloud, solving the problem of measurement inaccuracy caused by principal component analysis, and improving the accuracy and reliability of measurement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119444839A_ABST
    Figure CN119444839A_ABST
Patent Text Reader

Abstract

The invention relates to a rectangle fitting and measuring method for a three-dimensional point cloud, and the method enables the z-axis numerical value of the three-dimensional point cloud to be the same through a dimension reduction mode, i.e., through rotation, thereby eliminating the influence of one dimension, obtaining a bounding rectangle of the three-dimensional point cloud, obtaining a bounding rectangle closest to a target rectangle through the rotation of a fixed step number, and achieving the measurement of the bounding rectangle of the three-dimensional point cloud. And thus, the size and three-dimensional space coordinates of the target rectangle are obtained. Specifically, plane fitting is carried out on the three-dimensional point cloud, the three-dimensional point cloud is projected to a plane, a point cloud coordinate system is established on the basis of the projected three-dimensional point cloud, a rotation matrix from the point cloud coordinate system to a sensor coordinate system is calculated, the influence of one latitude of the three-dimensional point cloud is eliminated, and the three-dimensional point cloud is obtained. The projected three-dimensional point cloud is rotated according to a fixed step number, the external rectangle with the minimum area is obtained, the external rectangle closest to the target rectangle is obtained, and the three-dimensional space coordinates of the target rectangle are obtained through the two rotation matrixes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of three-dimensional measurement technology, and in particular to a method for rectangular fitting and measuring a three-dimensional point cloud. Background Art

[0002] As we gradually step into the world of automation and intelligence, all walks of life are eager for new technologies and new methods to improve the efficiency of production and service in the industry. This is especially true in the field of 3D measurement. New technologies can not only improve the production efficiency and profits of enterprises, but also bring new ideas to the entire industry.

[0003] Some technologies in various industries are not unique to the industry, but can be converted into universal ones. For example, the three-dimensional measurement of objects with planar structures. In the automated measurement of sheet metal parts industry, this measurement can obtain the precise size of the sheet metal parts. In the intelligent driving industry, this measurement can obtain the contour and three-dimensional coordinates of the target.

[0004] Among them, China's public invention patent CN202210272984.3-A three-dimensional measurement method and system for rectangular contours of sheet metal parts based on feature fitting, the invention obtains the main axis direction and the short axis direction by performing principal component analysis on the point cloud, thereby determining the long side and short side of the rectangle. However, in actual measurement, the main axis direction obtained by principal component analysis tends to be biased towards the diagonal of the rectangle, making the measurement inaccurate, so a more accurate measurement method needs to be designed. Summary of the invention

[0005] The purpose of the present invention is to propose a simple and efficient method for rectangle fitting and measuring of three-dimensional point cloud, which obtains the precise size of the rectangle and the coordinates of the rectangle in the three-dimensional space by means of rotation fitting.

[0006] The present invention provides a rectangular fitting and measurement method for a three-dimensional point cloud, the measurement method comprising the following steps:

[0007] a. Determine the characteristic rectangular area of ​​the target object to be measured, emit laser to the characteristic rectangular area, obtain the three-dimensional point cloud coordinates of the characteristic rectangular area under the sensor coordinates, and form a three-dimensional point cloud coordinate library.

[0008] b. Analyze and process the coordinates of each point in the formed three-dimensional point cloud coordinate library and remove outliers;

[0009] c. Establishing a three-dimensional point cloud coordinate system, performing plane fitting on the three-dimensional cloud point coordinate library after removing outliers in the three-dimensional point cloud coordinate system, and obtaining a plane formula ax+by+cz+1=0 for the plane position of the feature rectangular area after fitting;

[0010] d. Project each point coordinate in the three-dimensional cloud point coordinate library after the removal onto the plane with the fitted formula ax+by+cz+1=0 to form a three-dimensional point projection coordinate library;

[0011] e. Re-establish the point cloud coordinate system in the fitted plane, and establish the rotation matrix mapping relationship between each point coordinate from the point cloud coordinate library to the three-dimensional point cloud coordinate library;

[0012] f. Perform several rotation dimensionality reduction processes on the point coordinates in the point cloud coordinate library on the plane after rotation matrix fitting, calculate the area of ​​the minimum circumscribed rectangle of the point cloud coordinate library formed after each rotation dimensionality reduction process, select the rectangle with the smallest area from all the minimum circumscribed rectangle areas, obtain the length and width of the rectangle with the smallest area, and calculate the coordinate positions of the four vertices in the three-dimensional point cloud coordinate library.

[0013] As a further improvement of the present invention, the method for removing outliers in step b includes a RANSAC method or using a PCL library.

[0014] As a further improvement of the present invention, the three-dimensional point cloud coordinate system is a three-dimensional coordinate system established with the sensor as the center.

[0015] As a further improvement of the present invention, the fitting method in step c adopts the least squares method for fitting, and the point coordinates of n points in the three-dimensional cloud point coordinate library after removing the outliers are assumed to be (x1, y1, z1), (x2, y2, z2), ... (x n ,y n ,z n ), there are n points in total, the formula is, Ax = m, calculate A T Ax=A T m, we can get the parameters of a, b, and c in the fitting plane formula ax+by+cz+1=0, where A is is a matrix with n rows and 3 columns, x is m is is a vector with n rows and 1 column.

[0016] As a further improvement of the present invention, the process of establishing the rotation matrix mapping relationship in step e includes the following steps:

[0017] e1. Assume that the point coordinates of n points in the three-dimensional point projection coordinate library formed after projection are (x 1_ ,y 1_ ,z 1_ )、(x 2_ ,y 2_ ,z 2_ ),……(x n_ ,y n_ ,z n_ ),

[0018] e2. Re-establish the point cloud coordinate system in the fitted plane, where the x-axis of the point cloud coordinate system is the column vector n1, the y-axis is the column vector n2, and the z-axis is the column vector n3, wherein n1 is calculated from any two points in the three-dimensional point projection coordinate library after projection, n3 is calculated from the normal vector of the plane ax+by+cz+1=0, and n2 is calculated by cross-multiplying n3 by n1.

[0019] e3. Obtain a 3-row 3-column rotation matrix R(n1, n2, n3), and establish the rotation matrix mapping relationship between each point coordinate from the point cloud coordinate library to the 3D point cloud coordinate library.

[0020] As a further improvement of the present invention, the step f of performing several rotation dimensionality reduction processing on the point coordinates in the point cloud coordinate library on the plane after rotation matrix fitting includes:

[0021] f11, use the rotation matrix R to rotate the point coordinates (x 1_ ,y 1_ ,z 1_ )、(x 2_ ,y 2_ ,z 2_ ),……(x n_ ,y n_ ,z n_ ), thereby reducing the dimension of the 3D point cloud,

[0022] f12, then through the rotation matrix The point coordinates in the point cloud coordinate library after dimensionality reduction are rotated along the Z axis in the direction from before rotation to after rotation. The value of the angle θ starts from 0 degrees and increases to 180 degrees. Each increment is fixed at 1 degree or 0.5 degrees.

[0023] As a further improvement of the present invention, the step f of calculating the area of ​​the minimum circumscribed rectangle of the point cloud coordinate library formed after each rotation and dimensionality reduction process comprises the following steps:

[0024] f21, the coordinates of the point after rotation by the rotation matrix R_(x 1_ ,y 1_ ,z 1_ )、(x 2_ ,y 2_ ,z 2_ ),……(x n_ ,y n_ ,z n_ ) The maximum value x on the x-axis max and the minimum value x min , the maximum value of the y-axis max and the minimum value ymin , calculate (x max -x min )*(y max –y min ) to obtain the area of ​​the minimum circumscribed rectangle after rotation.

[0025] As a further improvement of the present invention, the step f of obtaining the length and width of the rectangle with the smallest area and calculating the coordinate positions of the four vertices in the three-dimensional point cloud coordinate library includes the following steps:

[0026] f31, get the rotation angle value θ_ corresponding to the rectangle with the smallest area, and the x-axis is the maximum value x max_ and the minimum value x min_ , the maximum value of the y-axis max_ and the minimum value y min_ , the maximum value of the z axis max_ and the minimum value z min_ , the length and width of the target rectangle are respectively (x max_ -x min_ ) and (y max_ -y min_ ), the coordinates of the four vertices of the smallest rectangle after rotation are (x min_ ,y min_ ,z min_ )、(x min_ ,y max_ ,z min_ )、(x max_ ,y max_ ,z min_ ) and (x max_ ,y min_ ,z min_ ),

[0027] f32, convert the rotated point coordinates of the four vertices of the smallest rectangle into column vectors and multiply them by R*R_ -1 That is to say, the coordinate positions of the four vertices in the three-dimensional point cloud coordinate library are obtained, where R_ -1 for

[0028]

[0029] Compared with the prior art, the present invention has the following beneficial effects:

[0030] This method uses a dimensionality reduction method, that is, by rotating the three-dimensional point cloud so that the values ​​of the z-axis are the same, thereby eliminating the influence of one dimension to obtain the bounding rectangle of the three-dimensional point cloud, and then obtains the bounding rectangle closest to the target rectangle by rotating with a fixed number of steps, thereby obtaining the size and three-dimensional spatial coordinates of the target rectangle. Specifically, the present invention performs plane fitting on the three-dimensional point cloud and projects the three-dimensional point cloud onto the plane. On the basis of the projected three-dimensional point cloud, a point cloud coordinate system is established, and a rotation matrix from the point cloud coordinate system to the sensor coordinate system is calculated to eliminate the influence of one latitude of the three-dimensional point cloud, so that the bounding rectangle of the three-dimensional point cloud can be obtained, and then the projected three-dimensional point cloud is rotated according to a fixed number of steps to obtain the bounding rectangle with the smallest area, and the bounding rectangle closest to the target rectangle is obtained, and the three-dimensional spatial coordinates of the target rectangle are obtained through two rotation matrices. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 A schematic diagram of a flow chart of a rectangular fitting and measurement method of a three-dimensional point cloud according to the present invention;

[0032] Figure 2 A schematic diagram of the coordinate distribution of points generated by the three-dimensional measurement of A4 paper by the laser radar of the present invention;

[0033] Figure 3 This is a schematic diagram of the distribution of the coordinates of the points generated by measuring A4 paper from a top-down perspective;

[0034] Figure 4 Schematic diagram of the rotation of the rotation matrix R in the present invention;

[0035] Figure 5 Schematic diagram of the rotation of the rotation matrix R_ in the present invention;

[0036] Figure 6 The figure is a schematic diagram of the point coordinate distribution change process generated by the rectangular fitting and measurement method of the three-dimensional point cloud of the present invention on A4 paper. DETAILED DESCRIPTION

[0037] In order to further illustrate the technical effects brought by the present invention, the technical solution is further described below through specific implementation methods.

[0038] This embodiment provides a method for rectangular fitting and measuring a three-dimensional point cloud, the measuring method comprising the following steps: Figure 1 As shown,

[0039] S11, determining a characteristic rectangular area of ​​the target object to be measured, emitting laser light to the characteristic rectangular area, obtaining the three-dimensional point cloud coordinates of the characteristic rectangular area under the sensor coordinates, and forming a three-dimensional point cloud coordinate library,

[0040] S12, analyzing and processing each point coordinate in the formed three-dimensional point cloud coordinate library, and removing outliers;

[0041] S13, establishing a three-dimensional point cloud coordinate system, performing plane fitting on the three-dimensional cloud point coordinate library after removing outliers in the three-dimensional point cloud coordinate system, and obtaining a plane formula ax+by+cz+1=0 for the plane position of the feature rectangular area after fitting;

[0042] S14, projecting each point coordinate in the three-dimensional cloud point coordinate library after the removal onto the plane with the fitted formula ax+by+cz+1=0 to form a three-dimensional point projection coordinate library;

[0043] S15, re-establishing the point cloud coordinate system in the fitted plane, and establishing a rotation matrix mapping relationship between each point coordinate from the point cloud coordinate library to the three-dimensional point cloud coordinate library;

[0044] S16. Perform several rotation dimensionality reduction processes on the point coordinates in the point cloud coordinate library on the plane after rotation matrix rotation fitting, calculate the area of ​​the minimum circumscribed rectangle of the point cloud coordinate library formed after each rotation dimensionality reduction process, select the rectangle with the smallest area from all the minimum circumscribed rectangle areas, obtain the length and width of the rectangle with the smallest area, and calculate the coordinate positions of the four vertices in the three-dimensional point cloud coordinate library.

[0045] The rectangle fitting and measurement method of the three-dimensional point cloud provided by the present embodiment can obtain the circumscribed rectangle of the three-dimensional point cloud by dimensionality reduction, that is, by rotating the three-dimensional point cloud to make the value of the z-axis the same, thereby eliminating the influence of one dimension, and then obtain the circumscribed rectangle closest to the target rectangle by rotating for a fixed number of steps, thereby obtaining the size and three-dimensional space coordinates of the target rectangle. Compared with the prior art method of obtaining the major axis direction and the minor axis direction by performing principal component analysis on the point cloud to determine the long and short sides of the rectangle, which has the problem of easy deviation from the diagonal of the rectangle and resulting in inaccurate measurement, the measurement method provided by the present embodiment is simple and efficient, and its accuracy is more reliable.

[0046] As another preferred embodiment of the present invention, this embodiment provides a method for rectangular fitting and measuring a three-dimensional point cloud. In this embodiment, the actual measurement of A4 paper is taken as an example. Figure 1-6 As shown, the measuring method comprises the following steps:

[0047] S21, determining a characteristic rectangular area of ​​the target object to be measured, emitting laser light to the characteristic rectangular area, obtaining the three-dimensional point cloud coordinates of the characteristic rectangular area in the sensor coordinates, and forming a three-dimensional point cloud coordinate library;

[0048] S22, RANSAC method or use PCL library to analyze and process the coordinates of each point in the formed three-dimensional point cloud coordinate library, and remove outliers, such as Figure 2-3As shown in the figure, the point coordinate distribution generated by the initial LiDAR sensor is discrete to a certain extent. It is necessary to first remove the outliers in the three-dimensional point cloud coordinate library. There are many mature technologies for this process, which will not be described in detail here.

[0049] S23, establishing a three-dimensional point cloud coordinate system with the sensor as the center, performing plane fitting on the three-dimensional cloud point coordinate library after removing outliers in the three-dimensional point cloud coordinate system, and obtaining a plane formula ax+by+cz+1=0 for the plane position of the feature rectangular area after fitting;

[0050] Since the plane does not pass through the origin (i.e. the sensor center), the plane formula ax+by+cz+1=0 is used for fitting. The fitting method uses the least squares method for fitting. The coordinates of n points in the three-dimensional cloud point coordinate library after removing outliers are assumed to be (x1, y1, z1), (x2, y2, z2), ... (x n ,y n ,z n ), there are n points in total, the formula is, Ax = m, calculate A T Ax=A T m, we can get the parameters of a, b, and c in the fitting plane formula ax+by+cz+1=0, where:

[0051] A is is a matrix with n rows and 3 columns, x is m is is a vector with n rows and 1 column.

[0052] S24, projecting each point coordinate in the three-dimensional cloud point coordinate library after the removal onto the plane with the fitted formula ax+by+cz+1=0 to form a three-dimensional point projection coordinate library;

[0053] S25, re-establishing the point cloud coordinate system in the fitted plane, and establishing a rotation matrix mapping relationship between each point coordinate from the point cloud coordinate library to the three-dimensional point cloud coordinate library;

[0054] The process of establishing the rotation matrix mapping relationship includes:

[0055] e1. Assume that the point coordinates of n points in the three-dimensional point projection coordinate library formed after projection are (x 1_ ,y 1_ ,z 1_ )、(x 2_ ,y 2_ ,z 2_ ),……(x n_ ,y n_ ,z n_ ),

[0056] e2. Re-establish the point cloud coordinate system in the fitted plane, where the x-axis of the point cloud coordinate system is the column vector n1, the y-axis is the column vector n2, and the z-axis is the column vector n3.

[0057] Where n1 is calculated from any two points in the three-dimensional point projection coordinate library after projection. Here, (x 1_ ,y 1_ ,z 1_ ) and (x 2_ ,y 2_ ,z 2_ ) as an example, let the column vector (x 1_ -x 2_ ,y 1_ -y 2_ ,z 1_ -z 2_ ) T Normalization gives n1, n3 which is obtained by calculating the normal vector of the plane ax+by+cz+1=0. T Normalization gives n3, and n2 is calculated by cross-multiplying n3 by n1.

[0058] e3. Obtain a 3-row 3-column rotation matrix R(n1, n2, n3), and establish the rotation matrix mapping relationship between each point coordinate from the point cloud coordinate library to the 3D point cloud coordinate library.

[0059] S26. Perform several rotation dimensionality reduction processes on the point coordinates in the point cloud coordinate library on the plane after rotation matrix fitting, calculate the area of ​​the minimum circumscribed rectangle of the point cloud coordinate library formed after each rotation dimensionality reduction process, select the rectangle with the smallest area from all the minimum circumscribed rectangle areas, obtain the length and width of the rectangle with the smallest area, and calculate the coordinate positions of the four vertices in the three-dimensional point cloud coordinate library.

[0060] The step S26 described in which the point coordinates in the point cloud coordinate library on the plane after the rotation matrix rotation fitting are subjected to several rotation dimensionality reduction processes includes:

[0061] f11, such as Figure 4 As shown, the point coordinates (x 1_ ,y 1_ ,z 1_ )、(x 2_ ,y 2_ ,z 2_ ),……(x n_ ,y n_ ,z n_ ), thereby reducing the dimension of the 3D point cloud. After rotation, the z values ​​of the point coordinates in the point cloud coordinate library are the same, but not necessarily 0).

[0062] f12, such as Figure 5 As shown, then through the rotation matrix The point coordinates in the point cloud coordinate library after dimensionality reduction are rotated along the Z axis in the direction from before rotation to after rotation. The value of the angle θ starts from 0 degrees and increases to 180 degrees. Each increment is fixed at 1 degree or 0.5 degrees.

[0063] The step S26 of calculating the area of ​​the minimum circumscribed rectangle of the point cloud coordinate library formed after each rotation and dimensionality reduction process comprises the following steps:

[0064] f21, the coordinates of the point after rotation by the rotation matrix R_(x 1_ ,y 1_ ,z 1_ )、(x 2_ ,y 2_ ,z 2_ ),……(x n_ ,y n_ ,z n_ ) The maximum value x on the x-axis max and the minimum value x min , the maximum value of the y-axis max and the minimum value y min , calculate (x max -x min )*(y max –y min ) to obtain the area of ​​the minimum circumscribed rectangle after rotation.

[0065] The step S26 of obtaining the length and width of the rectangle with the smallest area and calculating the coordinate positions of the four vertices in the three-dimensional point cloud coordinate library includes the following steps:

[0066] f31, get the rotation angle value θ_ corresponding to the rectangle with the smallest area, and the x-axis is the maximum value x max_ and the minimum value x min_ , the maximum value of the y-axis max_ and the minimum value y min_ , the maximum value of z axis max_ and the minimum value z min_ , the length and width of the target rectangle are respectively (x max_ -x min_ ) and (y max_ -y min_ ), the coordinates of the four vertices of the smallest rectangle after rotation are (x min_ ,y min_ ,z min_ )、(x min_ ,y max_ ,z min_ )、(x max_ ,y max_ ,zmin_ ) and (x max_ ,y min_ ,z min_ ),

[0067] f32, convert the rotated point coordinates of the four vertices of the smallest rectangle into column vectors and multiply them by R*R_ -1 That is to say, the coordinate positions of the four vertices in the three-dimensional point cloud coordinate library are obtained, where R_ -1 for For example, (x min_ ,y min_ ,z min_ ) This vertex is transformed into the sensor coordinate system as

[0068] This implementation performs plane fitting on the 3D point cloud and projects the 3D point cloud onto the plane. Based on the projected 3D point cloud, a point cloud coordinate system is established. By calculating a rotation matrix from the point cloud coordinate system to the sensor coordinate system, the influence of one latitude of the 3D point cloud is eliminated, so that the outer rectangle of the 3D point cloud can be obtained. Then, the projected 3D point cloud is rotated according to a fixed number of steps to obtain the outer rectangle with the smallest area, and the circumscribed rectangle closest to the target rectangle is obtained. The 3D spatial coordinates of the target rectangle are obtained through two rotation matrices.

[0069] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0070] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0071] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A rectangular fitting and measurement method for a three-dimensional point cloud, characterized in that: The measuring method comprises the following steps: a. Determine the characteristic rectangular area of ​​the target object to be measured, emit laser to the characteristic rectangular area, obtain the three-dimensional point cloud coordinates of the characteristic rectangular area under the sensor coordinates, and form a three-dimensional point cloud coordinate library. b. Analyze and process the coordinates of each point in the formed three-dimensional point cloud coordinate library and remove outliers; c. Establishing a three-dimensional point cloud coordinate system, performing plane fitting on the three-dimensional cloud point coordinate library after removing outliers in the three-dimensional point cloud coordinate system, and obtaining a plane formula ax+by+cz+1=0 for the plane position of the feature rectangular area after fitting; d. Project each point coordinate in the three-dimensional cloud point coordinate library after the removal onto the plane with the fitted formula ax+by+cz+1=0 to form a three-dimensional point projection coordinate library; e. Re-establish the point cloud coordinate system in the fitted plane, and establish the rotation matrix mapping relationship between each point coordinate from the point cloud coordinate library to the three-dimensional point cloud coordinate library; f. Perform several rotation dimensionality reduction processes on the point coordinates in the point cloud coordinate library on the plane after rotation matrix fitting, calculate the area of ​​the minimum circumscribed rectangle of the point cloud coordinate library formed after each rotation dimensionality reduction process, select the rectangle with the smallest area from all the minimum circumscribed rectangle areas, obtain the length and width of the rectangle with the smallest area, and calculate the coordinate positions of the four vertices in the three-dimensional point cloud coordinate library.

2. The rectangular fitting and measurement method of three-dimensional point cloud according to claim 1, characterized in that: The method of removing outliers in step b includes the RANSAC method or using the PCL library.

3. The rectangular fitting and measurement method of three-dimensional point cloud according to claim 1, characterized in that: The three-dimensional point cloud coordinate system is a three-dimensional coordinate system established with the sensor as the center.

4. The rectangular fitting and measurement method of three-dimensional point cloud according to claim 3, characterized in that: The fitting method in step c adopts the least square method for fitting, assuming that the coordinates of n points in the three-dimensional cloud point coordinate library after removing the outliers are (x1, y1, z1), (x2, y2, z2), ... (x n ,y n ,z n ), there are n points in total, the formula is, Ax = m, calculate A T Ax=A T m, we can get the parameters of a, b, and c in the fitting plane formula ax+by+cz+1=0, where: A is is a matrix with n rows and 3 columns, x is m is is a vector with n rows and 1 column.

5. The rectangular fitting and measurement method of three-dimensional point cloud according to claim 4, characterized in that: The process of establishing the rotation matrix mapping relationship in step e includes the following steps: e1. Assume that the point coordinates of n points in the three-dimensional point projection coordinate library formed after projection are (x 1_ ,y 1_ ,z 1_ )、(x 2_ ,y 2_ ,z 2_ ),……(x n_ ,y n_ ,z n_ ), e2. Re-establish the point cloud coordinate system in the fitted plane, where the x-axis of the point cloud coordinate system is the column vector n1, the y-axis is the column vector n2, and the z-axis is the column vector n3, wherein n1 is calculated from any two points in the three-dimensional point projection coordinate library after projection, n3 is calculated from the normal vector of the plane ax+by+cz+1=0, and n2 is calculated by cross-multiplying n3 by n1. e3. Obtain a 3-row 3-column rotation matrix R(n1, n2, n3), and establish the rotation matrix mapping relationship between each point coordinate from the point cloud coordinate library to the 3D point cloud coordinate library.

6. The rectangular fitting and measurement method of three-dimensional point cloud according to claim 5, characterized in that: The step f of performing several rotation dimensionality reduction processing on the point coordinates in the point cloud coordinate library on the plane after rotation matrix fitting includes: f11, use the rotation matrix R to rotate the point coordinates (x 1_ ,y 1_ ,z 1_ )、(x 2_ ,y 2_ ,z 2_ ),……(x n_ ,y n_ ,z n_ ), thereby reducing the dimension of the 3D point cloud, f12, then through the rotation matrix The point coordinates in the point cloud coordinate library after dimensionality reduction are rotated along the Z axis in the direction from before rotation to after rotation. The value of the angle θ starts from 0 degrees and increases to 180 degrees. Each increment is fixed at 1 degree or 0.5 degrees.

7. The rectangular fitting and measurement method of three-dimensional point cloud according to claim 6, characterized in that: The calculation of the area of ​​the minimum circumscribed rectangle of the point cloud coordinate library formed after each rotation and dimensionality reduction process in step f includes the following steps: f21, the coordinates of the point after rotation by the rotation matrix R_(x 1_ ,y 1_ ,z 1_ )、(x 2_ ,y 2_ ,z 2_ ),……(x n_ ,y n_ ,z n_ ) The maximum value x on the x-axis max and the minimum value x min , the maximum value of the y-axis max and the minimum value y min , calculate (x max -x min )*(y max –y min ) to obtain the area of ​​the minimum circumscribed rectangle after rotation.

8. The rectangular fitting and measurement method of three-dimensional point cloud according to claim 7, characterized in that: The step f of obtaining the length and width of the rectangle with the smallest area and calculating the coordinate positions of the four vertices in the three-dimensional point cloud coordinate library includes the following steps: f31, get the rotation angle value θ_ corresponding to the rectangle with the smallest area, and the x-axis is the maximum value x max_ and the minimum value x min_ , the maximum value of the y-axis max_ and the minimum value y min_ , the maximum value of z axis max_ and the minimum value z min_ , the length and width of the target rectangle are respectively (x max_ -x min_ ) and (y max_ -y min_ ), the coordinates of the four vertices of the smallest rectangle after rotation are (x min_ ,y min_ ,z min_ )、(x min_ ,y max_ ,z min_ )、(x max_ ,y max_ ,z min_ ) and (x max_ ,y min_ ,z min_ ), f32, convert the rotated point coordinates of the four vertices of the smallest rectangle into column vectors and multiply them by R*R_ -1 That is to say, the coordinate positions of the four vertices in the three-dimensional point cloud coordinate library are obtained, where R_ -1 for

Citation Information

Patent Citations

  • A three-dimensional measurement method and system for rectangular contour of sheet metal parts based on feature fitting

    CN114742853B