Method and system for detecting gradient of large workpiece
The camera is driven by the robotic arm to obtain point cloud data of large workpieces and fit the required measurement plane, which solves the problems of low inclination detection efficiency and incomplete data of large workpieces, and achieves efficient and accurate inclination detection.
Patent Information
- Application Number
- CN202411812369.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-03-14
AI Technical Summary
The inclination detection of large workpieces has problems such as inefficiency and incomplete data. Especially when dealing with large workpieces with complex structures, traditional methods are difficult to cover the entire surface, resulting in missing or incomplete data, affecting the accuracy of inclination detection.
The camera is used to drive the robotic arm to obtain the point cloud data of a large workpiece, and fit the required measurement plane through the point cloud data, and calculate the angle between the plane normal vector and the Z axis to obtain the inclination of the workpiece.
It improves the speed and efficiency of inclination detection of large workpieces, reduces manual intervention, and can complete the inclination calculation of a single plane under incomplete or missing point cloud data, enhancing the accuracy of detection.
Smart Images

Figure CN119618111A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of object inclination measurement, and in particular to a large workpiece inclination detection method and system. Background Art
[0002] With the rapid development of science and technology, workpieces of various shapes have gradually appeared. The existing workpieces are huge in volume. During the entire life cycle of the workpiece, it is often due to various reasons that cause major damage to the workpiece, such as tilting, bending, and cracking. The tilt of the workpiece after installation may affect the connection strength of buildings and equipment. Therefore, the tilt monitoring of the workpiece is worthy of attention.
[0003] At present, there are usually two solutions for detecting the inclination of a certain surface of a large workpiece:
[0004] 1. By manually holding a professional testing instrument and adjusting its height by means of a lift, the testing instrument can scan the surface of a large workpiece, thereby realizing the surface inclination detection of a large workpiece. However, this method is inefficient and very labor-intensive.
[0005] 2. Scan the point cloud of the workpiece through LiDAR, and use the model to determine whether the inclination of the workpiece meets the requirements. In the process of using point cloud technology to detect the inclination of objects, especially when dealing with large workpieces, there are the following problems: Due to the large size of the workpiece, traditional scanning equipment may not be able to cover the entire surface at one time, resulting in missing or incomplete data. In addition, large workpieces often have complex structures, containing multiple curved surfaces and difficult-to-reach areas, which further increases the difficulty of collecting complete point cloud data. Incomplete or missing point cloud data will directly affect the accuracy of inclination detection, because the calculation of inclination depends on the geometric information of the entire object surface. Summary of the invention
[0006] In view of the above-mentioned defects, the purpose of the present invention is to provide a large workpiece inclination detection method and system to reduce the difficulty of obtaining the inclination of a certain plane in the large workpiece and improve the accuracy of the inclination.
[0007] To achieve this object, the present invention adopts the following technical scheme: a large workpiece inclination detection method, comprising the following steps:
[0008] Step S1: Use a robotic arm to grab a camera, and use the camera to shoot key points of the plane required for inspection of the workpiece to generate local data;
[0009] Step S2: converting the local data into local coordinates;
[0010] Step S3: Transfer all local coordinates from the local coordinate system to the world coordinate system to obtain a point cloud data set;
[0011] In the world coordinate system, plane fitting is performed based on the cloud points in the point cloud data set to obtain the first plane to be measured;
[0012] Step S4: obtaining a normal vector of the first plane, calculating an angle between the normal vector and the Z axis, and using the angle as the inclination of the inspection plane required for the workpiece.
[0013] Preferably, the specific steps of step S2 are as follows:
[0014] The deformation pattern captured by the camera is analyzed by the fringe decoding method to decode the depth information of the object surface;
[0015] Use the camera intrinsic parameters to convert the pixel coordinates in the depth information into local coordinates;
[0016] The formula for converting to local coordinates is as follows:
[0017]
[0018] Z = D;
[0019] Where (u,v) is the pixel coordinate of the cloud point in the camera, (c x ,c y ) is the coordinate of the camera in the camera coordinate system, D is the depth information, and f is the focal length of the camera.
[0020] Preferably, the world coordinate system in step S3 is a coordinate system constructed with the base of the robot arm as the origin, wherein the base of the robot arm is installed on the ground or the base is parallel to the ground.
[0021] Preferably, the steps of performing plane fitting in step S3 are as follows:
[0022] Step S31: randomly obtain three cloud points in the point cloud data set, and construct a pending plane through the three cloud points;
[0023] Step S32: obtaining a first distance from other cloud points in the point cloud data set to the plane to be determined;
[0024] Step S33: obtaining the number of cloud points whose first distance is less than the distance threshold, and marking it as the first number;
[0025] Step S34: Repeat steps S31 to S33 until the number of loops reaches the maximum number of iterations, and obtain the first largest number of undetermined planes as the first plane.
[0026] Preferably, the specific steps of obtaining the inclination in step S4 are as follows:
[0027] Obtaining a normal vector of the first plane, and normalizing the normal vector to obtain a first normal vector;
[0028] Get the unit vector of the Z axis in the world coordinate system;
[0029] Obtain the angle between the first normal vector and the unit vector by using the dot product and the arc cosine function, and use the angle as the inclination;
[0030] The calculation formula of the inclination is as follows:
[0031]
[0032] in is the first normal vector, is the unit vector of the Z axis.
[0033] A large workpiece inclination detection system, using the large workpiece inclination detection method, comprises:
[0034] A robot arm control module, used to control the movement of the robot arm according to a preset line;
[0035] A shooting module, used for shooting key points of the inspection plane of the workpiece through a camera to generate local data;
[0036] A conversion module, used for converting the local data into local coordinates;
[0037] A processing module, used for transferring all local coordinates from the local coordinate system to the world coordinate system to obtain a point cloud data set;
[0038] In the world coordinate system, plane fitting is performed based on the cloud points in the point cloud data set to obtain the first plane to be measured;
[0039] The inclination acquisition module is used to acquire the normal vector of the first plane, calculate the angle between the normal vector and the Z axis, and use the angle as the inclination of the workpiece.
[0040] Preferably, the conversion module includes a decoding submodule and a conversion submodule;
[0041] The decoding submodule is used to analyze the deformation pattern captured by the camera through a fringe decoding method to decode the depth information of the object surface;
[0042] The conversion submodule is used to convert pixel coordinates in the depth information into local coordinates using camera intrinsic parameters.
[0043] Preferably, the processing module includes a plane construction submodule, a statistics submodule, a circulation submodule and a determination submodule;
[0044] The plane construction submodule is used to randomly obtain three cloud points in the point cloud data set and construct a pending plane through the three cloud points;
[0045] The statistical submodule is used to obtain the number of cloud points whose first distance is less than the distance threshold, and mark it as the first number;
[0046] The loop submodule is used to continue calling the plane construction submodule and the statistics submodule until the number of loops reaches the maximum number of iterations;
[0047] The determination submodule is used to use the undetermined plane with the largest first number as the first plane.
[0048] Preferably, the inclination acquisition module includes a normalization submodule, a unit vector acquisition submodule and an angle acquisition submodule;
[0049] The normalization submodule is used to obtain a normal vector of the first plane, and normalize the normal vector to obtain a first normal vector;
[0050] The unit vector acquisition submodule is used to obtain the unit vector of the Z axis in the world coordinate system;
[0051] The angle acquisition submodule is used to obtain the angle between the first normal vector and the unit vector through the dot product and the arc cosine function, and use the angle as the inclination.
[0052] One of the above technical solutions has the following advantages or beneficial effects: the present invention uses a robot arm to drive a camera to obtain point cloud data of a large workpiece, and then fits the plane to be measured through the point cloud data, without the need to manually obtain data through an elevator, which greatly improves the speed of detection. At the same time, the plane to be detected is fitted through the calculation of plane fitting, and then the first plane fitted is fitted based on the world coordinate system. The normal vector of the first plane can be directly used to directly transport the angle with the Z axis of the world coordinate system to obtain the corresponding inclination. The inclination calculation of a single plane can be completed without collecting all the point cloud data of the workpiece, further improving the detection efficiency of the inclination. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 is a flow chart of an embodiment of the method of the present invention.
[0054] Figure 2 It is a schematic diagram of the structure of an embodiment of the system of the present invention. DETAILED DESCRIPTION
[0055] The embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions from beginning to end. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0056] In the description of the embodiments of the present invention, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0057] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, unless otherwise specified, the meaning of "plurality" is two or more. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0058] like Figures 1-2 As shown, a large workpiece inclination detection method comprises the following steps:
[0059] Step S1: Use a robotic arm to grab a camera, and use the camera to shoot key points of the plane required for inspection of the workpiece to generate local data;
[0060] Step S2: converting the local data into local coordinates;
[0061] Step S3: Transfer all local coordinates from the local coordinate system to the world coordinate system to obtain a point cloud data set;
[0062] In the world coordinate system, plane fitting is performed based on the cloud points in the point cloud data set to obtain the first plane to be measured;
[0063] Step S4: obtaining a normal vector of the first plane, calculating an angle between the normal vector and the Z axis, and using the angle as the inclination of the inspection plane required for the workpiece.
[0064] Since it is difficult to collect data for large workpieces, it is impossible to completely collect all point cloud data of large workpieces. Therefore, it is difficult to accurately obtain the inclination of a certain surface of a large workpiece through existing technologies.
[0065] To this end, in the present invention, a robotic arm is used to collect data instead of manual work, and when the workpiece is manufactured, a corresponding three-dimensional model drawing is usually left. The staff can first find the key points of the required detection plane in the three-dimensional model drawing, and then construct the motion trajectory of the robotic arm, so that the robotic arm can obtain local data of all key points as much as possible in the process of moving the camera. The key points can be corner points, edge points or other important structural points. The plane can be quickly determined through the above key points, thereby improving the accuracy of plane detection.
[0066] The local data at this time is the structured light data obtained by the camera, and in order to facilitate the calculation of subsequent steps, the local data needs to be converted into the form of coordinates, so the local data needs to be converted into local coordinates. The local coordinate system is a coordinate system built based on the center of the object or a specific point in the point cloud data as the origin. There is no specific direction standard, so the local coordinates need to be transferred from the local coordinate system to the world coordinate system to unify the coordinate rules. Then, the plane is fitted through the point cloud data set to obtain the first plane that is in the same plane as the required detection plane; in the world coordinate system, when the normal vector of the plane is known, it can be coordinated with the Z axis to obtain the angle of the surface based on the Z axis. The angle of the angle is used as the inclination of the required detection plane of the workpiece.
[0067] The present invention uses a robot arm to drive a camera to obtain point cloud data of a large workpiece, and then fits the plane to be measured through the point cloud data, without the need for manual data acquisition through an elevator, which greatly improves the speed of detection. At the same time, the plane to be detected is fitted through the calculation of plane fitting, and then the first plane fitted is fitted based on the world coordinate system, and the normal vector of the first plane can be directly used to directly perform angle transportation with the Z axis of the world coordinate system to obtain the corresponding inclination. The inclination calculation of a single plane can be completed without collecting all the point cloud data of the workpiece, further improving the detection efficiency of the inclination.
[0068] Preferably, the specific steps of step S2 are as follows:
[0069] The deformation pattern captured by the camera is analyzed by the fringe decoding method to decode the depth information of the object surface;
[0070] Use the camera intrinsic parameters to convert the pixel coordinates in the depth information into local coordinates;
[0071] The formula for converting to local coordinates is as follows:
[0072]
[0073] Z = D;
[0074] Where (u,v) is the pixel coordinate of the cloud point in the camera, (c x ,c y ) is the coordinate of the camera in the camera coordinate system, D is the depth information, and f is the focal length of the camera.
[0075] In the process of acquiring local data, the structured light pattern is projected onto the surface of the workpiece by a projector. When these patterns are projected onto the surface of the object, they will be deformed due to the geometric shape of the surface of the object. The camera is responsible for capturing the deformed structured light pattern on the surface of the object. The local coordinate system is a three-dimensional coordinate system, and the cloud point can only present two-dimensional coordinate information in the pixel image of the camera. Therefore, the present invention can clearly identify the depth information of the point by capturing the deformed structured light pattern on the surface of the object, thereby determining the coordinate of the Z axis and realizing the transformation of the local coordinates.
[0076] Preferably, the world coordinate system in step S3 is a coordinate system constructed with the base of the robot arm as the origin, wherein the base of the robot arm is installed on the ground or the base is parallel to the ground.
[0077] At this time, in order to ensure that the Z axis in the world coordinate system is perpendicular to the ground, thereby ensuring the accuracy of the inclination calculation. In the present invention, a coordinate system is constructed with the base of the robot as the origin, and the base of the robot is installed on the ground, so the base is parallel to the ground, so the Z axis of the world coordinate system constructed with the base as the origin is also perpendicular to the ground. When performing local data acquisition, the robot arm needs to be called, and the workpiece is large in size, so the robot arm may need to be installed on a crane, so the base can be installed on the ground or parallel to the ground.
[0078] Preferably, the steps of performing plane fitting in step S3 are as follows:
[0079] Step S31: randomly obtain three cloud points in the point cloud data set, and construct a pending plane through the three cloud points;
[0080] Step S32: obtaining a first distance from other cloud points in the point cloud data set to the plane to be determined;
[0081] Step S33: obtaining the number of cloud points whose first distance is less than the distance threshold, and marking it as the first number;
[0082] Step S34: Repeat steps S31 to S33 until the number of loops reaches the maximum number of iterations, and obtain the first largest number of undetermined planes as the first plane.
[0083] Of course, the local data obtained by the camera shooting includes not only the data of key points, but also other cloud point data on the plane of the workpiece. Therefore, in the plane fitting process, the fitted plane may not be on the same plane as the plane required to be detected by the workpiece. If there is an angle between the first fitted plane and the plane actually detected, the calculated inclination will also have deviations. For this reason, in the present invention, multiple undetermined planes are obtained through multiple fittings. Because when scanning and obtaining the local data of the plane, the scanning and acquisition is based on the plane, so most of the local data are in the plane required to be detected. Therefore, most of the point clouds in the point cloud data set will fall into the plane, and the distance between the point cloud and the plane is very small. For this reason, after constructing the undetermined plane, the present invention will obtain the distance from other raindrops to the undetermined plane, and by detecting the undetermined plane with the largest first number, the required detection plane (first plane) of the plane can be determined. Thereby improving the detection accuracy of the inclination.
[0084] Preferably, the specific steps of obtaining the inclination in step S4 are as follows:
[0085] Obtaining a normal vector of the first plane, and normalizing the normal vector to obtain a first normal vector;
[0086] Get the unit vector of the Z axis in the world coordinate system;
[0087] Obtain the angle between the first normal vector and the unit vector by using the dot product and the arc cosine function, and use the angle as the inclination;
[0088] The calculation formula of the inclination is as follows:
[0089]
[0090] in is the first normal vector, is the unit vector of the Z axis.
[0091] In the present invention, in order to simplify the complexity of calculation and speed up the calculation, the normal vector of the first plane is normalized, wherein the normalization is as follows:
[0092] in The normal vector of the first plane. After normalization, the first normal vector only indicates the direction and is not affected by the length of the original vector. Like the subsequent Z-axis unit vector, it is also not affected by the length of the original vector. Avoid numerical problems caused by vector lengths that are too large or too small.
[0093] A large workpiece inclination detection system, using the large workpiece inclination detection method, comprises:
[0094] A robot arm control module, used to control the movement of the robot arm according to a preset line;
[0095] A shooting module, used for shooting key points of the inspection plane of the workpiece through a camera to generate local data;
[0096] A conversion module, used for converting the local data into local coordinates;
[0097] A processing module, used for transferring all local coordinates from the local coordinate system to the world coordinate system to obtain a point cloud data set;
[0098] In the world coordinate system, plane fitting is performed based on the cloud points in the point cloud data set to obtain the first plane to be measured;
[0099] The inclination acquisition module is used to acquire the normal vector of the first plane, calculate the angle between the normal vector and the Z axis, and use the angle as the inclination of the workpiece.
[0100] Preferably, the conversion module includes a decoding submodule and a conversion submodule;
[0101] The decoding submodule is used to analyze the deformation pattern captured by the camera through a fringe decoding method to decode the depth information of the object surface;
[0102] The conversion submodule is used to convert pixel coordinates in the depth information into local coordinates using camera intrinsic parameters.
[0103] Preferably, the processing module includes a plane construction submodule, a statistics submodule, a circulation submodule and a determination submodule;
[0104] The plane construction submodule is used to randomly obtain three cloud points in the point cloud data set and construct a pending plane through the three cloud points;
[0105] The statistical submodule is used to obtain the number of cloud points whose first distance is less than the distance threshold, and mark it as the first number;
[0106] The loop submodule is used to continue calling the plane construction submodule and the statistics submodule until the number of loops reaches the maximum number of iterations;
[0107] The determination submodule is used to use the undetermined plane with the largest first number as the first plane.
[0108] Preferably, the inclination acquisition module includes a normalization submodule, a unit vector acquisition submodule and an angle acquisition submodule;
[0109] The normalization submodule is used to obtain a normal vector of the first plane, and normalize the normal vector to obtain a first normal vector;
[0110] The unit vector acquisition submodule is used to obtain the unit vector of the Z axis in the world coordinate system;
[0111] The angle acquisition submodule is used to obtain the angle between the first normal vector and the unit vector through the dot product and the arc cosine function, and use the angle as the inclination.
[0112] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0113] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
Claims
1. A method for detecting the inclination of a large workpiece, characterized in that: The steps include: Step S1: Use a robotic arm to grab a camera, and use the camera to shoot key points of the plane required for inspection of the workpiece to generate local data; Step S2: converting the local data into local coordinates; Step S3: Transfer all local coordinates from the local coordinate system to the world coordinate system to obtain a point cloud data set; In the world coordinate system, plane fitting is performed based on the cloud points in the point cloud data set to obtain the first plane to be measured; Step S4: obtaining a normal vector of the first plane, calculating an angle between the normal vector and the Z axis, and using the angle as the inclination of the inspection plane required for the workpiece.
2. A large workpiece inclination detection method according to claim 1, characterized in that: The specific steps of step S2 are as follows: The deformation pattern captured by the camera is analyzed by the fringe decoding method to decode the depth information of the object surface; Use the camera intrinsic parameters to convert the pixel coordinates in the depth information into local coordinates; The formula for converting to local coordinates is as follows: Z = D; Where (u,v) is the pixel coordinate of the cloud point in the camera, (c x ,c y ) is the coordinate of the camera in the camera coordinate system, D is the depth information, and f is the focal length of the camera.
3. A large workpiece inclination detection method according to claim 1, characterized in that: The world coordinate system in step S3 is a coordinate system constructed with the base of the robot arm as the origin, wherein the base of the robot arm is installed on the ground or the base is parallel to the ground.
4. A large workpiece inclination detection method according to claim 1, characterized in that: The steps of plane fitting in step S3 are as follows: Step S31: randomly obtain three cloud points in the point cloud data set, and construct a pending plane through the three cloud points; Step S32: obtaining a first distance from other cloud points in the point cloud data set to the plane to be determined; Step S33: obtaining the number of cloud points whose first distance is less than the distance threshold, and marking it as the first number; Step S34: Repeat steps S31 to S33 until the number of loops reaches the maximum number of iterations, and obtain the first largest number of undetermined planes as the first plane.
5. A large workpiece inclination detection method according to claim 1, characterized in that: The specific steps of obtaining the inclination in step S4 are as follows: Obtaining a normal vector of the first plane, and normalizing the normal vector to obtain a first normal vector; Get the unit vector of the Z axis in the world coordinate system; Obtain the angle between the first normal vector and the unit vector by using the dot product and the arc cosine function, and use the angle as the inclination; The calculation formula of the inclination is as follows: in is the first normal vector, is the unit vector of the Z axis.
6. A large workpiece inclination detection system, using a large workpiece inclination detection method according to any one of claims 1 to 5, characterized in that: include: A robot arm control module, used to control the movement of the robot arm according to a preset line; A shooting module, used for shooting key points of the inspection plane of the workpiece through a camera to generate local data; A conversion module, used for converting the local data into local coordinates; A processing module, used for transferring all local coordinates from the local coordinate system to the world coordinate system to obtain a point cloud data set; In the world coordinate system, plane fitting is performed based on the cloud points in the point cloud data set to obtain the first plane to be measured; The inclination acquisition module is used to acquire the normal vector of the first plane, calculate the angle between the normal vector and the Z axis, and use the angle as the inclination of the workpiece.
7. A large workpiece inclination detection system according to claim 6, characterized in that: The conversion module includes a decoding submodule and a conversion submodule; The decoding submodule is used to analyze the deformation pattern captured by the camera through a fringe decoding method to decode the depth information of the object surface; The conversion submodule is used to convert pixel coordinates in the depth information into local coordinates using camera intrinsic parameters.
8. A large workpiece inclination detection system according to claim 6, characterized in that: The processing module includes a plane construction submodule, a statistics submodule, a circulation submodule and a determination submodule; The plane construction submodule is used to randomly obtain three cloud points in the point cloud data set and construct a pending plane through the three cloud points; The statistical submodule is used to obtain the number of cloud points whose first distance is less than the distance threshold, and mark it as the first number; The loop submodule is used to continue calling the plane construction submodule and the statistics submodule until the number of loops reaches the maximum number of iterations; The determination submodule is used to use the undetermined plane with the largest first number as the first plane.
9. A large workpiece inclination detection system according to claim 6, characterized in that: The inclination acquisition module includes a normalization submodule, a unit vector acquisition submodule and an angle acquisition submodule; The normalization submodule is used to obtain a normal vector of the first plane, and normalize the normal vector to obtain a first normal vector; The unit vector acquisition submodule is used to obtain the unit vector of the Z axis in the world coordinate system; The angle acquisition submodule is used to obtain the angle between the first normal vector and the unit vector through the dot product and the arc cosine function, and use the angle as the inclination.