3D structured light measurement calibration method and system
Through 3D structured light measurement technology, battery point cloud data is collected and analyzed, which solves the problems of low efficiency and insufficient accuracy of traditional detection methods, achieves fast and accurate measurement of battery appearance size and flatness, and adapts to the needs of industrial automation.
Patent Information
- Application Number
- CN202410639793.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-22
- Publication Date
- 2024-08-27
AI Technical Summary
Traditional battery appearance inspection methods are inefficient and cannot accurately detect the convex or concave features of square aluminum shell batteries, making them unable to meet the needs of industrial automation.
Using 3D structured light measurement technology, through a 3D structured light camera and a motion control device, the point cloud data of the annular calibration piece is collected, the axis center and plane position of the rotary table are calculated, and the coordinate system conversion of the point cloud data and the comparison between the point spacing and the actual distance are realized. Ratio calculation, automatic calibration of battery size.
It achieves fast and accurate detection of battery appearance size and flatness, improves measurement efficiency and automation level, reduces manual intervention, and is suitable for complex and changeable measurement tasks.
Smart Images

Figure CN118548799A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of industrial detection technology, and in particular to a 3D structured light measurement calibration method and system. Background Art
[0002] With the rapid development of the new energy vehicle market, square aluminum shell batteries, as a commonly used type of automotive power battery, are widely used because of their good heat dissipation performance, higher safety performance, larger capacity and easy manufacturing. However, some defects are inevitable in the production process, and it is necessary to ensure that the geometric dimensions of the battery meet the specifications and requirements. If the size of a battery exceeds the specified range, it may cause problems such as improper assembly, short circuit, leakage, etc., which will affect the service life and safety performance of the battery. Therefore, how to quickly and accurately detect the appearance defects of power batteries and measure the size has become a problem that battery manufacturers need to solve urgently.
[0003] Traditional battery appearance inspection methods mainly use manual visual inspection and two-dimensional visual inspection. Manual visual inspection has the disadvantages of low inspection efficiency and interference of inspection results by human factors, which is not suitable for the rapid development of current industrial automation needs. Traditional two-dimensional visual technology cannot obtain depth information and is greatly affected by light, so it is difficult to accurately detect and locate the raised or sunken features on the appearance of the square aluminum shell.
[0004] 3D structured light measurement technology is an automated technology that can obtain and analyze three-dimensional information of objects. With the acceleration of industrialization at home and abroad, the demand for automated measurement technology in the manufacturing industry continues to rise, and three-dimensional visual measurement technology will play an increasingly important role. By using 3D structured light sensors, more abundant surface structure and texture data of objects can be obtained to adapt to more complex and changeable measurement tasks.
[0005] Patent document CN110440692A discloses a combined measurement and calibration method of a laser tracker and a structured light 3D scanner based on a matte standard target sphere; the method uses a structured light 3D scanner, a laser tracker, a laser target sphere and a common target for combined measurement and calibration; the coordinate system of the laser tracker is set as a global coordinate system, a structured light scanner base coordinate system, and a structured light 3D scanner measurement coordinate system; the structured light 3D scanner and the laser tracker are respectively operated to measure the common target, and the SVD-based Protsky analysis algorithm is used to calculate the conversion matrix from the measurement coordinate system to the global coordinate system; finally, the conversion matrix from the measurement coordinate system of the structured light 3D scanner to its base coordinate system is calculated by matrix division to complete the calibration. However, the patent cannot completely solve the existing technical problems, nor can it meet the requirements of the present invention. Summary of the invention
[0006] In view of the defects in the prior art, an object of the present invention is to provide a 3D structured light measurement calibration method and system.
[0007] The 3D structured light measurement calibration method provided by the present invention includes:
[0008] Step 1: Power on the system;
[0009] Step 2: System initialization and detection platform configuration, including: selecting the square power battery model, checking whether the battery detection indicators are correct, changing them if incorrect, manually entering relevant detection indicators for the first selected model; configuring the 3D structured light camera and motion control device related parameters;
[0010] Step 3: Calibrate the detection platform, including: collecting point cloud data of the calibration part, collecting point cloud data of the circular calibration part; analyzing and processing the point cloud data to obtain the axis and plane position of the rotating table; calculating the coordinate system conversion matrix; analyzing and processing the point cloud data to obtain the ratio of the distance between the points in the point cloud data to the actual distance; saving the calibration parameters;
[0011] Step 4: Create a new measurement task, start measurement, and output a measurement report.
[0012] Preferably, the calibration part point cloud data collection process is:
[0013] Parameter configuration, set the turntable rotation times and the angle and speed parameters of each rotation, and set the camera exposure value;
[0014] Place the calibration ring in the center of the rotating table;
[0015] Start the 3D camera and observe the position of the point cloud image in the point cloud space coordinate system;
[0016] Initial position setting, control the horizontal motion module, vertical motion module and servo motor, so that the structured light of the 3D camera is projected to the center of the rotating table, the position meets the working distance of the 3D camera, the point cloud image is presented in the center of the GUI interface, and the point cloud data volume meets the measurement requirements;
[0017] Collect the point cloud data of the calibration part at the current viewing angle, save it in sequence and transmit it to the point cloud data processing module for processing;
[0018] Control the rotating table to rotate once, and use the movement of the rotating table to change the visible posture of the calibration part on the rotating table until the point cloud data of the calibration part of all viewing angles are collected. This part of the point cloud data is a group of point cloud data, recorded as Q1, Q2, Q3, ..., Qend, which is used for the calibration of the axis and plane position of the rotating table;
[0019] Control the vertical motion module to move the camera upward by a distance h0, so that the position of the point cloud image of the calibration object in the spatial coordinate system changes;
[0020] Collect point cloud data, denoted as H;
[0021] Control the vertical motion module to return the camera to its initial position.
[0022] Preferably, the process of calibrating the axis and plane position of the rotating table is as follows:
[0023] Sequentially read the collected calibration point cloud data Q1, Q2, Q3, ..., Qend;
[0024] Use the random sampling consistency algorithm to perform plane fitting extraction and obtain the calibration plane equation: z = Ax + By + C, the plane normal vector: N = (A, B, 1); where x, y, z represent the coordinates of the point on the plane on the x, y, and z axes; A and B are the slopes of the calibration plane in the x-axis and y-axis directions, respectively, and C is the z-axis intercept;
[0025] Calculate the angle α between the normal vector of the fitted plane and the YOZ plane and XOZ plane x ,α y ;
[0026] Calculate the rotation angles θ and φ around the X-axis and Y-axis required for point cloud alignment; use the right-hand coordinate system, take the counterclockwise direction as the positive direction of rotation, and determine the values of θ and φ according to the quadrant in which they are located; let Then the values of θ and φ are as follows:
[0027] If the normal vector N is in quadrants I and VII, θ = α1, φ = -α2;
[0028] If the normal vector N is in quadrants II and VIII, θ = α1, φ = α2;
[0029] If the normal vector N is in quadrants III and V, θ = -α1, φ = α2;
[0030] If the normal vector N is in quadrants IV and VI, θ = -α1, φ = -α2;
[0031] Calculate the rotation matrices R1 and R2 around the X-axis and Y-axis to straighten the point cloud, and perform rotation transformation so that the fitting plane is parallel to the plane XOY in the point cloud space coordinate system;
[0032]
[0033]
[0034] Use the radius filtering algorithm to filter the plane point cloud data and remove outliers;
[0035] Discard the z value in the three-dimensional plane point cloud data and convert it into a point set on a two-dimensional plane;
[0036] Create a two-dimensional plane convex hull, and use the indices of the vertices that make up the convex hull to find the edge contour of the three-dimensional point cloud image;
[0037] Fit a circle to the extracted calibration part plane contour point cloud data, and save the center position of the circle;
[0038] Read the next viewpoint point cloud data until all viewpoint point cloud data are processed;
[0039] Fit a space circle with the center position of the point cloud data of each viewing angle;
[0040] Calculate the axis coordinates and the plane equation of the turntable. The axis is O' and the coordinates are (x0, y0, z0). The plane equation of the turntable is z=A0x+B0y+C0. Let the height of the calibration piece be h. The plane where the circle is located is h below the plane where the turntable is located, and the axis of the turntable is h below the center of the circle.
[0041] Preferably, the coordinate system transformation matrix calculation process is:
[0042] Calculate the angle α between the normal vector of the turntable plane and the OZ axis z , given the turntable plane equation z = A0x + B0y + C0, the bottom surface normal vector is N' = (A0, B0, 1), and the OZ axis unit vector is Z = (0, 0, 1), then:
[0043]
[0044] Among them, A0 and B0 are the slopes of the rotation stage plane in the x-axis and y-axis directions respectively, and C0 is the z-axis intercept;
[0045] The point cloud is rotated and transformed so that the bottom surface of the three-dimensional point cloud is parallel to the plane XOY in the point cloud space coordinate system;
[0046] With n as the rotation axis, n = N × Z, n is: n = (n x ,n y ,n z ), the rotation matrix is:
[0047]
[0048] Point cloud translation, the translation matrix of the point cloud is T;
[0049]
[0050] If the coordinates of the turntable center O' are known to be (x0, y0, z0), then (ΔX, ΔY, ΔZ) = (-x0, -y0, -z0);
[0051] Among them, ΔX, ΔY, and ΔZ represent the translation of the point cloud along the x, y, and z axes;
[0052] Save the relevant parameters of the rotation matrix and translation matrix.
[0053] Preferably, the process of calculating the ratio of point spacing to actual distance is:
[0054] Read point cloud data Qend and H respectively;
[0055] Coordinate system transformation: convert the initial point cloud space coordinate system into a world coordinate system with the axis of the turntable as the origin and the plane of the turntable as the plane where the coordinate system XOY is located;
[0056] Plane fitting extraction: use the random sampling consistency algorithm to perform plane fitting extraction on the point cloud data Qend and H, and obtain the plane point cloud data P1, P2, and the distance h1 between the two planes;
[0057] The ratio of the point spacing in the Z direction to the actual distance is calculated. According to the point cloud data acquisition scheme of the calibration part, the actual distance between the two planes is h0, so the ratio of the point spacing in the Z direction to the actual distance is h1 / h0;
[0058] Point cloud filtering, using radius filtering to remove outliers in P1;
[0059] Data dimensionality reduction, discarding the z value in the three-dimensional plane point cloud data, and converting P1 into a point set on a two-dimensional plane;
[0060] Create a two-dimensional plane convex hull, and use the indices of the vertices that make up the convex hull to find the edge contour of the three-dimensional point cloud image;
[0061] The space circle Y1 is fitted with the edge contour of P1, and its diameter is d1;
[0062] The ratio of the point spacing in the X and Y directions to the actual distance is calculated. The longest point spacing in the X and Y directions is the diameter d1, and the actual diameter of the calibration piece is d0. Therefore, the point spacing in the X and Y directions to the actual distance is d1 / d0.
[0063] The 3D structured light measurement and calibration system provided by the present invention includes:
[0064] Module M1: System power-on startup;
[0065] Module M2: System initialization and detection platform configuration, including: selecting the square power battery model, checking whether the battery detection indicators are correct, changing them if incorrect, manually entering relevant detection indicators for the first selected model; configuring the 3D structured light camera and motion control device related parameters;
[0066] Module M3: Calibrate the detection platform, including: collecting point cloud data of the calibration part, collecting point cloud data of the circular calibration part; analyzing and processing point cloud data to obtain the axis and plane position of the rotating table; calculating the coordinate system conversion matrix; analyzing and processing point cloud data to obtain the ratio of the distance between points in the point cloud data to the actual distance; saving calibration parameters;
[0067] Module M4: Create a new measurement task, start measurement, and output a measurement report.
[0068] Preferably, the calibration part point cloud data collection process is:
[0069] Parameter configuration, set the turntable rotation times and the angle and speed parameters of each rotation, and set the camera exposure value;
[0070] Place the calibration ring in the center of the rotating table;
[0071] Start the 3D camera and observe the position of the point cloud image in the point cloud space coordinate system;
[0072] Initial position setting, control the horizontal motion module, vertical motion module and servo motor, so that the structured light of the 3D camera is projected to the center of the rotating table, the position meets the working distance of the 3D camera, the point cloud image is presented in the center of the GUI interface, and the point cloud data volume meets the measurement requirements;
[0073] Collect the point cloud data of the calibration part at the current viewing angle, save it in sequence and transmit it to the point cloud data processing module for processing;
[0074] Control the rotating table to rotate once, and use the movement of the rotating table to change the visible posture of the calibration part on the rotating table until the point cloud data of the calibration part of all viewing angles are collected. This part of the point cloud data is a group of point cloud data, recorded as Q1, Q2, Q3, ..., Qend, which is used for the calibration of the axis and plane position of the rotating table;
[0075] Control the vertical motion module to move the camera upward by a distance h0, so that the position of the point cloud image of the calibration object in the spatial coordinate system changes;
[0076] Collect point cloud data, denoted as H;
[0077] Control the vertical motion module to return the camera to its initial position.
[0078] Preferably, the process of calibrating the axis and plane position of the rotating table is as follows:
[0079] Sequentially read the collected calibration point cloud data Q1, Q2, Q3, ..., Qend;
[0080] Use the random sampling consistency algorithm to perform plane fitting extraction and obtain the calibration plane equation: z = Ax + By + C, the plane normal vector: N = (A, B, 1); where x, y, z represent the coordinates of the point on the plane on the x, y, and z axes; A and B are the slopes of the calibration plane in the x-axis and y-axis directions, respectively, and C is the z-axis intercept;
[0081] Calculate the angle α between the normal vector of the fitted plane and the YOZ plane and XOZ plane x ,α y ;
[0082] Calculate the rotation angles θ and φ around the X-axis and Y-axis required for point cloud alignment; use the right-hand coordinate system, take the counterclockwise direction as the positive direction of rotation, and determine the values of θ and φ according to the quadrant in which they are located; let Then the values of θ and φ are as follows:
[0083] If the normal vector N is in quadrants I and VII, θ = α1, φ = -α2;
[0084] If the normal vector N is in quadrants II and VIII, θ = α1, φ = α2;
[0085] If the normal vector N is in quadrants III and V, θ = -α1, φ = α2;
[0086] If the normal vector N is in quadrants IV and VI, θ = -α1, φ = -α2;
[0087] Calculate the rotation matrices R1 and R2 around the X-axis and Y-axis to straighten the point cloud, and perform rotation transformation so that the fitting plane is parallel to the plane XOY in the point cloud space coordinate system;
[0088]
[0089]
[0090] Use the radius filtering algorithm to filter the plane point cloud data and remove outliers;
[0091] Discard the z value in the three-dimensional plane point cloud data and convert it into a point set on a two-dimensional plane;
[0092] Create a two-dimensional plane convex hull, and use the indices of the vertices that make up the convex hull to find the edge contour of the three-dimensional point cloud image;
[0093] Fit a circle to the extracted calibration part plane contour point cloud data, and save the center position of the circle;
[0094] Read the next viewpoint point cloud data until all viewpoint point cloud data are processed;
[0095] Fit a space circle with the center position of the point cloud data of each viewing angle;
[0096] Calculate the axis coordinates and the plane equation of the turntable. The axis is O' and the coordinates are (x0, y0, z0). The plane equation of the turntable is z=A0x+B0y+C0. Let the height of the calibration piece be h. The plane where the circle is located is h below the plane where the turntable is located, and the axis of the turntable is h below the center of the circle.
[0097] Preferably, the coordinate system transformation matrix calculation process is:
[0098] Calculate the angle α between the normal vector of the turntable plane and the OZ axis z , given the turntable plane equation z = A0x + B0y + C0, the bottom surface normal vector is N' = (A0, B0, 1), and the OZ axis unit vector is Z = (0, 0, 1), then:
[0099]
[0100] Among them, A0 and B0 are the slopes of the rotation stage plane in the x-axis and y-axis directions respectively, and C0 is the z-axis intercept;
[0101] The point cloud is rotated and transformed so that the bottom surface of the three-dimensional point cloud is parallel to the plane XOY in the point cloud space coordinate system;
[0102] With n as the rotation axis, n = N × Z, n is: n = (n x ,n y ,n z ), the rotation matrix is:
[0103]
[0104] Point cloud translation, the translation matrix of the point cloud is T;
[0105]
[0106] If the coordinates of the turntable center O' are known to be (x0, y0, z0), then (ΔX, ΔY, ΔZ) = (-x0, -y0, -z0);
[0107] Among them, ΔX, ΔY, and ΔZ represent the translation of the point cloud along the x, y, and z axes;
[0108] Save the relevant parameters of the rotation matrix and translation matrix.
[0109] Preferably, the process of calculating the ratio of point spacing to actual distance is:
[0110] Read point cloud data Qend and H respectively;
[0111] Coordinate system transformation: convert the initial point cloud space coordinate system into a world coordinate system with the axis of the turntable as the origin and the plane of the turntable as the plane where the coordinate system XOY is located;
[0112] Plane fitting extraction: use the random sampling consistency algorithm to perform plane fitting extraction on the point cloud data Qend and H, and obtain the plane point cloud data P1, P2, and the distance h1 between the two planes;
[0113] The ratio of the point spacing in the Z direction to the actual distance is calculated. According to the point cloud data acquisition scheme of the calibration part, the actual distance between the two planes is h0, so the ratio of the point spacing in the Z direction to the actual distance is h1 / h0;
[0114] Point cloud filtering, using radius filtering to remove outliers in P1;
[0115] Data dimensionality reduction, discarding the z value in the three-dimensional plane point cloud data, and converting P1 into a point set on a two-dimensional plane;
[0116] Create a two-dimensional plane convex hull, and use the indices of the vertices that make up the convex hull to find the edge contour of the three-dimensional point cloud image;
[0117] The space circle Y1 is fitted with the edge contour of P1, and its diameter is d1;
[0118] The ratio of the point spacing in the X and Y directions to the actual distance is calculated. The longest point spacing in the X and Y directions is the diameter d1, and the actual diameter of the calibration piece is d0. Therefore, the point spacing in the X and Y directions to the actual distance is d1 / d0.
[0119] Compared with the prior art, the present invention has the following beneficial effects:
[0120] The present invention collects and analyzes two groups of point cloud data with height difference through a vertical motion module, and realizes the relevant ratio calculation of the point spacing in the point cloud data and the actual distance, including the ratio in the horizontal direction and the ratio in the Z direction (vertical direction); the calibration part is placed on a rotating table for automatic calibration without manual intervention, which is convenient and fast. BRIEF DESCRIPTION OF THE DRAWINGS
[0121] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
[0122] Figure 1 It is the overall workflow diagram;
[0123] Figure 2 Configure a flow chart for the detection platform;
[0124] Figure 3 This is the calibration flow chart of the detection platform;
[0125] Figure 4 This is the flow chart of point cloud data collection for calibration parts;
[0126] Figure 5 This is the flow chart for calibrating the axis and plane position of the rotary table;
[0127] Figure 6 Calculate the coordinate system transformation matrix flow chart;
[0128] Figure 7 Flow chart for calculating the ratio of point spacing to actual distance;
[0129] Figure 8 This is the flow chart of power battery appearance measurement;
[0130] Fig. 9 This is the flow chart of multi-view cloud data collection for power batteries;
[0131] Fig.10 It is a flow chart for stitching a set of point cloud data;
[0132] Fig.11 Flowchart for stitching multiple sets of point cloud data;
[0133] Fig.12 It is the flow chart of battery appearance dimensions and pole measurement;
[0134] Fig.13 This is the flow chart for length and width measurement;
[0135] Fig.14 Sort the flow chart for the plane;
[0136] Fig.15 This is the flow chart for measuring the overall flatness of the aluminum shell surface;
[0137] Fig.16 It is the flow chart of battery height measurement;
[0138] Fig.17 It is the flow chart of pole position, height and parallelism detection;
[0139] Fig.18 Output flow chart for measurement report;
[0140] Fig.19 This is the hardware structure diagram of 3D vision detection;
[0141] Fig. 20 Schematic diagram of a square power battery. DETAILED DESCRIPTION
[0142] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several changes and improvements can also be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.
[0143] Example
[0144] The present invention mainly measures square power batteries, uses 3D structured light measurement technology to quickly obtain point cloud data of the battery surface, and splices it to obtain an overall point cloud model. By analyzing and processing the point cloud data, the battery appearance size and poles are measured to detect whether the size, flatness, pole parallelism, pole position, etc. of the battery surface meet the requirements. The present invention has high measurement efficiency and good automation level, and a set of overall scans can quickly obtain corresponding measurement data.
[0145] The platform calibration design process designed by the present invention adopts a circular ring calibration part, collects multi-view point cloud data of the circular ring calibration part, analyzes the point cloud data of each view formed by the rotation of the rotating table, and obtains the position of the rotating table plane and the axis in the point cloud space coordinate system; the obtained plane position can be used to transform the coordinate system, so that the point cloud is straightened, and the bottom surface of the three-dimensional point cloud is parallel to the plane XOY in the point cloud space coordinate system; the axis position is used for subsequent rotation and splicing. Two groups of point cloud data with height difference are collected and analyzed through the vertical motion module, and the relevant ratio calculation of the point spacing and the actual distance in the point cloud data is realized, including the ratio in the horizontal direction and the ratio in the Z direction (vertical direction). The calibration part is placed on the rotating table for automatic calibration without manual intervention, which is convenient and quick.
[0146] The multi-view point cloud data collection process for square power batteries designed in the present invention utilizes the combination of the control of the rotating table and the vertical motion module to realize the collection of complete power battery point cloud data. The collection of point cloud data for one week of the power battery can be realized when the rotating table rotates one circle. Taking into account that the power battery is large in size, high in height, and the visible distance of the structured light is limited, the vertical motion module is used to control the camera to move upward for a certain distance and then perform a round of point cloud data collection that depends on the movement of the rotating table. If the point cloud data is still not fully collected, the above process can be repeated until the point cloud data is fully collected. The multi-view point cloud data collection method for power batteries of the present invention relies on the control of mechanical devices, has a high degree of automation, and takes into account the problem of different battery sizes, and has better scalability and applicability.
[0147] The point cloud stitching scheme designed by the present invention is divided into two parts. One part is a group of point cloud data collected by relying on the movement of the turntable. The position of the axis and the turntable in the point cloud space coordinate system obtained by the calibration process is known. The rotation angle of the turntable is known, and a rotation matrix can be obtained. The point cloud data of adjacent perspectives are rotated and stitched, and then the ICP registration algorithm is used to further improve the registration accuracy. The other part is each group of spliced point cloud data collected by relying on the vertical movement of the camera. It is known that the camera moves vertically for a certain distance, and a translation matrix is obtained. The point cloud data of adjacent groups are translated and stitched, and then the ICP registration algorithm is used to further improve the registration accuracy. The splicing process designed by the present invention is fast, accurate, and complete, and is the basis for ensuring the accuracy of subsequent measurements.
[0148] The length and width measurement process of the square power battery designed by the present invention analyzes and processes the spliced point cloud data, obtains the point cloud data near the four vertical edges by using the nearest neighbor search method based on KD-Tree, and then performs plane fitting segmentation to obtain the distance between the corresponding planes, and then determines its length and width. The present invention uses edge data for size measurement, ignoring the influence of possible depressions and protrusions in the central area of the side, and improves the accuracy of measurement.
[0149] The overall flatness measurement process of the aluminum shell surface designed by the present invention obtains point cloud data near four vertical edges by using the nearest neighbor search method based on KD-Tree, removes these point cloud data, and then uses a fast clustering algorithm based on Euclidean distance for segmentation, calculates the distance and square difference from the points on each surface to the reference plane, and thus calculates the parallelism.
[0150] The height measurement process designed by the present invention uses the nearest neighbor search method based on KD-Tree to search the point cloud data near the four vertices, and then obtains the highest height of each group of point cloud data, thereby overcoming the influence of the top pole, explosion-proof valve, etc. on the height measurement.
[0151] The pole position, height and parallelism detection process designed by the present invention uses a method combining the RANSAC algorithm with the height threshold segmentation to obtain the pole part point cloud data. Then a fast clustering algorithm based on Euclidean distance is used to segment the specific pole point cloud data. The calculation points of the pole part data are collected by using the method of finding multiple convex hull contours, so as to calculate the position, height and parallelism of the two poles.
[0152] like Figure 1 As shown, the overall workflow is designed as follows:
[0153] Step 1: Power on the system;
[0154] Step 2: System initialization and detection platform configuration;
[0155] Step 3: The first measurement requires calibration of the test platform;
[0156] Step 4: Create a new measurement task;
[0157] Step 5: Start measuring;
[0158] Step 6: Output the measurement report.
[0159] like Figure 2 As shown, the detection platform configuration process is designed as follows:
[0160] Step 1: Select the square power battery model and check whether the battery test indicators are correct. If they are incorrect, you can change them. The first selected model must manually enter the relevant test indicators;
[0161] Step 2: Configure the parameters of the 3D structured light camera and motion control device;
[0162] Step 3: Save the current detection device configuration;
[0163] Step 4: Calibrate the detection platform.
[0164] like Figure 3 As shown in the figure, the calibration process of the detection platform is designed as follows:
[0165] Step 1: Collecting point cloud data of the calibration part, collecting point cloud data of the circular calibration part;
[0166] Step 2: Analyze and process the point cloud data to obtain the axis and plane position of the rotating table;
[0167] Step 3: Calculate the coordinate system transformation matrix;
[0168] Step 4: Analyze and process the point cloud data to obtain the ratio of the distance between points in the point cloud data to the actual distance;
[0169] Step 5: Save the calibration parameters for subsequent measurements.
[0170] like Figure 4 As shown in the figure, the calibration part point cloud data collection process is designed as follows:
[0171] Step 1: Parameter configuration, set the turntable rotation times and the angle and speed of each rotation, and set the appropriate camera exposure value and other camera parameters;
[0172] Step 2: Place the ring calibration piece in the center area of the rotating table;
[0173] Step 3: Start the 3D camera and observe the position of the point cloud image in the point cloud space coordinate system;
[0174] Step 4: Initial position setting, control the horizontal motion module, vertical motion module and servo motor so that the structured light of the 3D camera is projected to the center of the rotating table. The position meets the working distance of the 3D camera, the point cloud image is presented in the center of the GUI interface, and the point cloud data volume meets the measurement requirements;
[0175] Step 5: Collect the point cloud data of the calibration part at the current viewing angle, save it in sequence and transmit it to the point cloud data processing module for processing;
[0176] Step 6: Control the rotating table to rotate once, and use the movement of the rotating table to change the visible posture of the calibration part on the rotating table;
[0177] Step 7: Repeat steps 5 and 6 until the point cloud data of the calibration piece of all viewing angles are collected. This part of the point cloud data is a group of point cloud data, recorded as Q1, Q2, Q3, ..., Qend, which is used to calibrate the axis and plane position of the rotating table;
[0178] Step 8: Control the vertical motion module to move the camera upward by a certain distance h0, so that the position of the point cloud image of the calibration object in the spatial coordinate system changes;
[0179] Step 9: Collect point cloud data, denoted as H;
[0180] Step 10: Control the vertical motion module to return the camera to its initial position.
[0181] like Figure 5 As shown, the calibration algorithm of the axis and plane position of the rotating table is designed as follows:
[0182] Step 1: Sequentially read the collected calibration point cloud data Q1, Q2, Q3, ..., Qend;
[0183] Step 2: Use the random sampling consistency algorithm to perform plane fitting extraction and obtain the calibration plane equation: z = Ax + By + C, plane normal vector: N = (A, B, 1); where x, y, z represent the coordinates of the point on the plane on the x, y, and z axes; A and B are the slopes of the calibration plane in the x-axis and y-axis directions, respectively, and C is the z-axis intercept.
[0184] Step 3: Calculate the angle α between the normal vector of the fitted plane and the YOZ plane and XOZ plane x ,α y ;
[0185] Step 4: Calculate the rotation angles θ and φ around the X-axis and Y-axis required for the point cloud to be straightened; use a right-handed coordinate system with the counterclockwise direction as the positive direction of rotation. Since the rotation directions in different quadrants are different and the calculated plane normal vector is ambiguous, it is necessary to determine the values of θ and φ according to the quadrant in which it is located; let Then the values of θ and φ are as follows:
[0186] If the normal vector N is in quadrants I and VII, θ = α1, φ = -α2;
[0187] If the normal vector N is in quadrants II and VIII, θ = α1, φ = α2;
[0188] If the normal vector N is in quadrants III and V, θ = -α1, φ = α2;
[0189] If the normal vector N is in quadrants IV and VI, θ = -α1, φ = -α2;
[0190] Step 5: Calculate the rotation matrices R1 and R2 around the X-axis and Y-axis required for point cloud alignment, and perform rotation transformation so that the fitting plane is parallel to the plane XOY in the point cloud space coordinate system;
[0191]
[0192]
[0193] Step 6: Use the radius filtering algorithm to filter the plane point cloud data and remove outliers;
[0194] Step 7: Discard the z value in the three-dimensional plane point cloud data and convert it into a point set on a two-dimensional plane;
[0195] Step 8: Create a two-dimensional plane convex hull, and use the indices of the vertices that make up the convex hull to find the edge contour of the three-dimensional point cloud image;
[0196] Step 9: Fit a circle to the extracted calibration part plane contour point cloud data, and save the center position of the circle;
[0197] Step 10: Read the next viewpoint point cloud data, and repeat steps 2 to 10 until all viewpoint point cloud data are processed;
[0198] Step 11: Fit a space circle based on the center position of the point cloud data at each viewing angle;
[0199] Step 12: Calculate the axis coordinates and the equation of the plane where the turntable is located. The axis is O' and the coordinates are (x0, y0, z0). The equation of the turntable plane is z = A0x + B0y + C0. Let the height of the calibration piece be h. The plane where the circle is located is h below the plane where the turntable is located, and the axis of the turntable is h below the center of the circle.
[0200] like Figure 6 As shown, the coordinate system transformation matrix calculation process is designed as follows:
[0201] Step 1: Calculate the angle α between the normal vector of the turntable plane and the OZ axis z, given the turntable plane equation z=A0x+B0y+C0, we can get the bottom surface normal vector N'=(A0,B0,1), and the OZ axis unit vector Z=(0,0,1), then:
[0202]
[0203] Among them, A0 and B0 are the slopes of the rotation stage plane in the x-axis and y-axis directions, respectively, and C0 is the z-axis intercept.
[0204] Step 2: Rotate the point cloud so that the bottom surface of the three-dimensional point cloud is parallel to the plane XOY in the point cloud space coordinate system;
[0205] With n as the rotation axis, n = N × Z, n is: n = (n x ,n y ,n z ).
[0206]
[0207] Step 3: Point cloud translation, the translation matrix of the point cloud is T;
[0208]
[0209] If the coordinates of the turntable center O' are known to be (x0, y0, z0), then (ΔX, ΔY, ΔZ) = (-x0, -y0, -z0);
[0210] ΔX, ΔY, and ΔZ represent the translation of the point cloud along the x, y, and z axes;
[0211] Step 4: Save the relevant parameters of the rotation matrix and translation matrix.
[0212] like Figure 7 As shown, the calculation method of the ratio of point spacing to actual distance is designed as follows:
[0213] Step 1: Read point cloud data Qend and H respectively;
[0214] Step 2: Coordinate system transformation: convert the initial point cloud space coordinate system into a world coordinate system with the axis of the turntable as the origin and the plane of the turntable as the plane where the coordinate system XOY is located;
[0215] Step 3: plane fitting extraction, use the random sampling consistency algorithm to perform plane fitting extraction on the point cloud data Qend and H, and obtain the plane point cloud data P1, P2, and the distance h1 between the two planes;
[0216] Step 4: Calculate the ratio of the point spacing in the Z direction to the actual distance. The actual distance between the two planes is obtained from the calibration point cloud data acquisition scheme as h0, so the ratio of the point spacing in the Z direction to the actual distance is h1 / h0;
[0217] Step 5: Point cloud filtering, using radius filtering to remove outliers in P1;
[0218] Step 6: Data dimensionality reduction, discard the z value in the three-dimensional plane point cloud data, and convert P1 into a point set on a two-dimensional plane;
[0219] Step 7: Create a two-dimensional plane convex hull, and use the indices of each vertex that makes up the convex hull to find the edge contour of the three-dimensional point cloud image;
[0220] Step 8: Fit the space circle Y1 with the edge contour of P1, and obtain their diameters d1 respectively;
[0221] Step 9: Calculate the ratio of the point spacing in the X and Y directions to the actual distance. The longest point spacing in the X and Y directions is the diameter d1, and the actual diameter of the calibration piece is d0. Therefore, the point spacing in the X and Y directions to the actual distance is d1 / d0.
[0222] like Figure 8 As shown in the figure, the process of measuring the appearance of power batteries is as follows:
[0223] Step 1: Set the turntable parameters, set the turntable rotation speed, rotation angle and number of rotations;
[0224] Step 2: Place the battery cover on the rotating table with the top cover facing up;
[0225] Step 3: Initialize the camera settings, automatically input and save the relevant parameters of the coordinate system transformation, and adjust the exposure value and resolution of the 3D camera to a suitable level;
[0226] Step 4: Start the detection system;
[0227] Step 5: Collect multi-view point cloud data of the battery;
[0228] Step 6: Point cloud stitching: stitching the point cloud data collected from different perspectives into a complete point cloud model;
[0229] Step 7: Start the battery appearance size and pole measurement program;
[0230] Step 8: Save and export the measurement data.
[0231] like Fig. 9 As shown in the figure, the design of the power battery multi-view cloud data collection process is as follows:
[0232] Step 1: The camera is started, the 3D camera starts scanning, and collects point cloud data;
[0233] Step 2: The turntable rotates once to collect point cloud data;
[0234] Step 3: Repeat until the rotating table rotates one circle, and a set of point cloud data S0, S1, S2, etc. are collected;
[0235] Step 4: stitch the point cloud data obtained in step 3 and save it;
[0236] Step 5: Analyze this group of point cloud data to determine whether the top cover data is complete. If not, proceed to step 6.
[0237] Step 6: The camera moves upward by a distance l;
[0238] Step 7: Repeat steps 1 to 5 until the top cover data is complete;
[0239] Step 8: stitch the point cloud data of each group together to obtain the overall point cloud data;
[0240] Step 9: Save the point cloud data.
[0241] like Fig.10 As shown in the figure, the stitching process of a set of point cloud data is designed as follows:
[0242] Step 1: Read the point cloud data and the point cloud data of the adjacent viewpoints in the acquisition order, and use them as the source point cloud P and the target point cloud Q in turn;
[0243] Step 2: Given the axis coordinates of the turntable, rotate and stitch the source point cloud and the target point cloud. At this time, the rotation transformation around the Z axis needs to be completed to achieve the stitching of point cloud data. Assuming that n viewpoint point cloud data are collected (n is generally between 4 and 8), the transformation matrix for each stitching is Among them, ψ is the angle value of the target point cloud that needs to be rotated around the Z axis for each stitching. If the rotation angle of the rotating table is the same each time, when the i-th stitching is performed,
[0244] Step 3: Use ICP registration algorithm for fine stitching, given the source point cloud and target point cloud Where m and n are the number of points in the source point cloud and the target point cloud respectively; transform the target point cloud, and let the nearest point in Q corresponding to the point pi in P be The optimal transformation matrix is Where T0 is the initial transformation matrix, satisfying T0 = R z ;
[0245] Step 4: Repeat steps 1 to 4 until all point cloud data of the group are stitched together;
[0246] Step 5: Merge all point cloud data and remove duplicate points;
[0247] Step 6: Save the merged point cloud data.
[0248] like Fig.11 As shown in the figure, the process of stitching multiple sets of point cloud data is designed as follows:
[0249] Step 1: Sequentially read each set of stitched point cloud data and use them as the source point cloud P and target point cloud Q respectively;
[0250] Step 2: Translate and stitch the source point cloud and the target point cloud. Translate the target point cloud along the Z axis. The transformation matrix is T z ;
[0251] Among them, when performing the i-th splicing, Δl = -il;
[0252] Step 3: Use ICP registration algorithm to further improve stitching accuracy;
[0253] Step 4: Repeat steps 1 to 4 until all point cloud data of the group are stitched together;
[0254] Step 5: Merge all point cloud data and remove duplicate points;
[0255] Step 6: Save the merged point cloud data.
[0256] like Fig.12 As shown, the battery appearance dimensions and pole measurement process are designed as follows:
[0257] Step 1: Input point cloud data;
[0258] Step 2: Point cloud filtering, using radius filtering to remove outliers and downsample;
[0259] Step 3: Normal vector calculation;
[0260] Step 4: Segment the point cloud data according to the normal vector direction, and extract the aluminum shell data and the top cover data respectively;
[0261] Step 5: Length and width measurement;
[0262] Step 6: Flatness measurement;
[0263] Step 7: Segmentation of top cover point cloud data;
[0264] Step 8: Height measurement;
[0265] Step 9: Measure the pole position, height and parallelism.
[0266] like Fig.13 As shown, the length and width measurement process is designed as follows:
[0267] Step 1: Input the point cloud data of the square aluminum shell surface;
[0268] Step 2: Create an OBB (oriented bounding box) bounding box. Use the principal component analysis method to create a minimum oriented cuboid that can enclose the point cloud data. The center point of the bounding box is denoted as c.
[0269] Step 3: Take the four sides of the OBB bounding box perpendicular to the XOY plane and establish the equation of the line;
[0270] Step 4: Use the nearest neighbor search method based on KD-Tree to obtain the point cloud data near the four vertical edges, obtain four groups of point cloud data, and extract and save them separately;
[0271] Step 5: Perform plane segmentation on each set of point cloud data according to the direction of the normal vector, and obtain eight planes in total;
[0272] Step 6: Sort and label the eight planes to obtain planes Ⅰ, Ⅱ, Ⅲ, Ⅳ, Ⅴ, Ⅵ, Ⅶ, and Ⅷ;
[0273] Step 7: Calculate the length and width, and obtain the distance D1 between plane I and plane III, the distance D2 between plane II and plane IV, the distance D3 between plane V and plane VII, and the distance D4 between plane V and plane VII; for the values of D1, D2, D3, and D4, the smaller set of values is the measured width, and the larger set of values is the measured length;
[0274] Step 8: Save the measurement data.
[0275] like Fig.14 As shown, the plane sorting process is designed as follows:
[0276] Step 1: Input each plane point cloud data;
[0277] Step 2: Find the centroid position of each plane and get eight points: c1, c2, c3, c4, c5, c6, c7, c8;
[0278] Step 3: Calculate the vectors from the center point c of the bounding box to points c1, c2, c3, c4, c5, c6, c7, and c8 respectively;
[0279] Step 4: Calculate the angle between each vector and the X-axis, and label them in the order of angle as Ⅰ, Ⅱ, Ⅲ, Ⅳ, Ⅴ, Ⅵ, Ⅶ, Ⅷ;
[0280] Step 5: Calculate the angle between the normal vectors of plane I and plane II. If the angle is close to zero or 180°, they are considered to be on the same plane. Otherwise, they are considered to be not on the same plane.
[0281] Step 6: If plane I and plane II are not on the same plane, re-number them; mark the original plane I as plane VIII, and mark the original planes II, III, IV, V, VI, VII, VIII as planes I, II, III, IV, V, VI, VII in sequence;
[0282] Step 7: Save the measurement data.
[0283] like Fig.15 As shown in the figure, the overall flatness measurement process of the aluminum shell surface is designed as follows:
[0284] Step 1: Input the point cloud data of the aluminum shell surface;
[0285] Step 2: Use KD-Tree to search for point cloud data near the four vertical edges, extract and save these point cloud data;
[0286] Step 3: Segment and remove the point cloud data near the four edges obtained in step 2, and retain the remaining data;
[0287] Step 4: Reference plane setting, plane I is used as reference plane I, and plane II is used as reference plane II;
[0288] Step 5: Use the fast clustering algorithm based on Euclidean distance to segment the point cloud data and divide the point cloud data of the four sides into four groups for storage;
[0289] Step 6: Use the RANSAC algorithm to fit the plane with the point cloud data of the four sides respectively;
[0290] Step 7: Divide the point cloud data of the four sides into two groups, calculate the normal vectors of the four fitting planes, and the angles with the reference plane I and the reference plane II, obtain the two fitting planes with the smallest angle with the reference plane I, and use the corresponding side point cloud data as the first group of data; obtain the two fitting planes with the smallest angle with the reference plane II, and use the corresponding side point cloud data as the second group of data;
[0291] Step 8: Calculate the flatness, calculate the distance and square difference between the point cloud data of the two sides of the first set of data and the reference plane I respectively; calculate the distance and square difference between the point cloud data of the two sides of the second set of data and the reference plane II respectively; use the size of the square difference as the parallelism index between the judgment surface and the reference plane;
[0292] Step 9: Save the flatness measurement data.
[0293] like Fig.16 As shown, the battery height measurement process is designed as follows:
[0294] Step 1: Input the top cover point cloud data;
[0295] Step 2: Point cloud filtering, combining the voxel downsampling algorithm with the radius filtering algorithm to remove outliers and abnormal points, and save the original top cover point cloud data;
[0296] Step 3: Create an OBB (oriented bounding box);
[0297] Step 4: Take the four vertices at the bottom of the OBB bounding box, use the nearest neighbor search method based on KD-Tree to search for point cloud data near the four vertices, obtain four sets of point cloud data, and extract and save them separately;
[0298] Step 5: Calculate the highest height h1, h2, h3, h4, and the average height hm1, hm2, hm3, hm4 of each set of point cloud data respectively;
[0299] Step 6: Save the measurement data.
[0300] like Fig.17 As shown, the pole position, height and parallelism detection process is designed as follows:
[0301] Step 1: Input the top cover point cloud data;
[0302] Step 2: Use the RANSAC algorithm combined with the height threshold segmentation method to remove the end face point cloud data and only retain the pole part point cloud data;
[0303] Step 3: Use the fast clustering algorithm based on Euclidean distance to divide the point cloud data into two parts and save them separately;
[0304] Step 4: Use the method of finding multiple convex hull contours to collect the calculation points of the polar column data. The convex hull algorithm can be used to calculate the maximum circumscribed polygon of the polar column, but the calculation points are generally located inward from the edge. Therefore, a method of finding multiple convex hull contours is used to collect the calculation points of the polar column data. The convex hull is repeatedly established from the outside to the inside to collect appropriate calculation points.
[0305] Step 5: Calculate the maximum height h of the two sets of pole point cloud data pmax1 、h pmax2 , minimum height h pmin1 、h pmin2 and the average height h pm1 、h pm2 ;
[0306] Step 6: Calculate the parallelism between the two poles and the reference plane, and take the difference between the highest height and the lowest height as the parallelism between the two poles and the reference plane; let the parallelism between pole 1 and pole 2 and the reference plane be d bp1 ,d bp2 , satisfying d bp1 =h pmax1 -h pmin1 , d bp2 =h pmax2 -h pmin2 ;
[0307] Step 7: Take the point cloud data of pole 1 to fit the plane;
[0308] Step 8: Calculate the distance from each point of pole 2 to the fitting plane of pole 1, where the maximum value minus the minimum value is the parallelism of the two poles;
[0309] Step 9: Create OBB bounding boxes B1, B2, and B3 for the point cloud data of the top cover, pole 1, and pole 2 respectively;
[0310] Step 10: Obtain the plane equations of each face of the bounding box B1;
[0311] Step 11: Obtain the distances from the center points of the bounding boxes B2 and B3 to the sides of B1 to determine the position of the pole;
[0312] Step 12: Save the measurement data.
[0313] like Fig.18 As shown, the measurement report output process is designed as follows:
[0314] Step 1: Read the measured data;
[0315] Step 2: Data conversion: convert the data corresponding to the dimension measurement into the data of the actual physical dimension according to the proportional relationship obtained by the calibration process;
[0316] Step 3: Read the standard indicators corresponding to the battery model;
[0317] Step 4: Compare with standard indicators, record and mark unqualified data;
[0318] Step 5: Output a report containing all measurement results and any unqualified indicators.
[0319] Product solution:
[0320] like Fig.19 As shown, the device includes a structured light 3D scanning device 1, a ring calibration piece 2, a rotating table 3, a first servo motor 4, a second servo motor 8, a horizontal motion module 12, a vertical motion module 13, a stepper motor controller 15, a monitor 16, a computer 17, a power supply 21, a servo motor controller 22 and a scanning platform 14;
[0321] The monitor 16 and the computer 17 are connected to the computer via an HDMI cable; the monitor 16, the computer 17, the stepper motor controller 15, the servo motor controller 22, the structured light 3D scanning device 1, the lead screw stepper motor 6, the lead screw stepper motor 10, the first servo motor 4 and the second servo motor 8 are connected to the power supply via a cable.
[0322] The ring calibration piece 2 is used for platform calibration and is placed in the central area of the rotating table when in use.
[0323] The rotating table 3 is directly driven by the first servo motor 4, and the angle adjustment of the camera bracket is directly driven by the second servo motor 8. The first servo motor 4 and the second servo motor 8 are controlled by the servo motor controller 22. The first servo motor 4 and the second servo motor 8 are connected to the servo motor controller 22 via an RS232 cable, and the servo motor controller 22 is connected to the computer 17 via an RS232 to USB cable.
[0324] The structured light 3D scanning device 1 includes a left camera 18 , a right camera 20 and a structured light projector 19 ; the structured light 3D scanning device 1 is connected to a computer 17 via a USB cable.
[0325] The horizontal motion module 12 includes a screw stepping motor 10 , a third guide rail 9 and a fourth guide rail 11 ; the movement of the sliders on the third guide rail 9 and the fourth guide rail 11 is driven by the rotation of the screw on the screw stepping motor 10 .
[0326] The vertical motion module 13 includes a screw stepping motor 6 , a first guide rail 5 and a second guide rail 7 ; the movement of the sliders on the first guide rail 5 and the second guide rail 7 is driven by the rotation of the screw on the screw stepping motor 6 .
[0327] The screw stepper motor 6 and the screw stepper motor 10 are controlled by a stepper motor controller 15 ; the screw stepper motor 6 and the screw stepper motor 10 are connected to the stepper motor controller via a cable, and the stepper motor controller is connected to a computer 17 via a USB cable.
[0328] The hardware structure diagram is as follows Fig.19 As shown, the scanning platform 14 is the main structure, equipped with a structured light 3D scanning device 1, a rotating table 3, a power supply 4, a first servo motor 4, a second servo motor 8, a horizontal motion module 12, a vertical motion module 13, a stepper motor controller 15, a servo motor controller 22 and a power supply 21; the power supply 21 is used to power various devices carried by the scanning platform 14; the structured light 3D scanning device 1 is used to collect point cloud data; the stepper motor controller 15 controls the horizontal motion module 12 by receiving instructions sent by the computer 17; the vertical motion module 13 is used to change the position of the structured light 3D scanning device 1; the servo motor controller 22 controls the second servo motor 8 to adjust the angle of the camera bracket by receiving instructions sent by the computer 17, thereby changing the camera shooting angle of the structured light 3D scanning device 1; the first servo motor 4 is controlled by receiving instructions sent by the computer 17 to accurately control the rotation angle and rotation speed of the rotating table; the computer 17 is used to receive the point cloud data information collected by the structured light 3D scanning device 1 and perform corresponding processing.
[0329] The square power battery tested is as follows Fig. 20 As shown, the main measuring area includes a top end surface 26 and an aluminum shell surface 25 , wherein a left pole 23 and a right pole 24 are provided on the top measuring end surface 26 .
[0330] Those skilled in the art know that, in addition to implementing the system, device and its various modules provided by the present invention in a purely computer-readable program code, it is entirely possible to implement the same program in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers and embedded microcontrollers by logically programming the method steps. Therefore, the system, device and its various modules provided by the present invention can be considered as a hardware component, and the modules included therein for implementing various programs can also be considered as structures within the hardware component; the modules for implementing various functions can also be considered as both software programs for implementing the method and structures within the hardware component.
[0331] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essence of the present invention. In the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other arbitrarily.
Claims
1. A 3D structured light measurement calibration method, characterized in that: include: Step 1: Power on the system; Step 2: System initialization and test platform configuration, including: selecting the prismatic power battery model, checking whether the battery test indicators are correct, changing them if incorrect, manually entering the relevant test indicators for the initially selected model; and configuring the 3D structured light camera and motion control device parameters. Step 3: Calibrate the detection platform, including: collecting point cloud data of the calibration part and the circular calibration part; analyzing and processing the point cloud data to determine the axis and plane positions of the rotation table; calculating the coordinate system transformation matrix; analyzing and processing the point cloud data to determine the ratio of the distance between points in the point cloud data to the actual distance; and saving the calibration parameters. Step 4: Create a new measurement task, start measurement, and output a measurement report.
2. The 3D structured light measurement calibration method according to claim 1, characterized in that: The process of collecting point cloud data of calibration parts is as follows: Parameter configuration, set the number of turntable rotations and the angle and speed parameters of each rotation, and set the camera exposure value; Place the ring calibration piece in the center area of the turntable; Start the 3D camera and observe the position of the point cloud image in the point cloud space coordinate system; Initial position setting, control the horizontal motion module, vertical motion module and servo motor so that the structured light of the 3D camera is projected to the center of the rotating stage. The position meets the working distance of the 3D camera, the point cloud image is displayed in the center of the GUI interface, and the point cloud data volume meets the measurement requirements. Collect the point cloud data of the calibration part at the current viewing angle, save it sequentially and transmit it to the point cloud data processing module for processing; Control the turntable to rotate once, and use the turntable movement to change the visual posture of the calibration object on the turntable until the point cloud data of the calibration object from all viewing angles is collected. This part of the point cloud data is formed into a group of point cloud data, recorded as Q1, Q2, Q3, ..., Qend, and used for the calibration of the axis and plane position of the turntable; Control the vertical motion module to move the camera upward by a distance h0, so that the position of the point cloud image of the calibration object in the spatial coordinate system changes; Collect point cloud data, denoted as H; Control the vertical motion module to return the camera to its initial position.
3. The 3D structured light measurement calibration method according to claim 2, characterized in that: The calibration process of the rotary table axis and plane position is as follows: Sequentially read the collected calibration point cloud data Q1, Q2, Q3, ..., Qend; Use the random sampling consistency algorithm to perform plane fitting extraction and obtain the calibration plane equation: z = Ax + By + C, and the plane normal vector: N = (A, B, 1). Here, x, y, and z represent the coordinates of the point on the plane on the x, y, and z axes, respectively. A and B are the slopes of the calibration plane in the x and y directions, respectively, and C is the z-intercept. Calculate the angle α between the normal vector of the fitting plane and the YOZ plane and XOZ plane x ,α y ; Calculate the rotation angles θ and φ around the X and Y axes required for point cloud alignment; use a right-handed coordinate system, with the counterclockwise direction as the positive direction of rotation, and determine the values of θ and φ based on the quadrant in which they are located; let Then the values of θ and φ are as follows: If the normal vector N is in quadrants I and VII, θ = α1, φ = -α2; If the normal vector N is in quadrants II and VIII, θ = α1, φ = α2; If the normal vector N is in quadrants III and V, θ = -α1, φ = α2; If the normal vector N is in quadrants IV and VI, θ = -α1, φ = -α2; Calculate the rotation matrices R1 and R2 around the X-axis and Y-axis required for point cloud alignment, and perform rotation transformation so that the fitting plane is parallel to the plane XOY in the point cloud space coordinate system; Use the radius filtering algorithm to filter the plane point cloud data and remove outliers; Discard the z value in the three-dimensional plane point cloud data and convert it into a point set on a two-dimensional plane; Create a two-dimensional plane convex hull and use the indices of the vertices that make up the convex hull to find the edge contour of the three-dimensional point cloud image; Fit a circle to the extracted calibration part plane contour point cloud data and save the center position of the circle; Read the next viewpoint point cloud data until all viewpoint point cloud data are processed; Fit a space circle based on the center position of the point cloud data at each viewing angle; Calculate the axis coordinates and the equation of the plane where the turntable is located. The axis is O' and the coordinates are (x0, y0, z0). The equation of the turntable plane is z = A0x + B0y + C0. Let the height of the calibration piece be h. Then, the plane where the circle is located is h points below the plane where the turntable is located, and the axis of rotation of the turntable is h points below the center of the circle.
4. The 3D structured light measurement calibration method according to claim 3, characterized in that: The calculation process of the coordinate system transformation matrix is: Calculate the angle α between the normal vector of the turntable plane and the OZ axis z , given the turntable plane equation z = A0x + B0y + C0, the bottom surface normal vector is N' = (A0, B0, 1), and the OZ axis unit vector is Z = (0, 0, 1), then: Where A0 and B0 are the slopes of the rotation stage plane in the x-axis and y-axis directions, respectively, and C0 is the z-axis intercept; The point cloud is rotated and transformed so that the bottom surface of the 3D point cloud is parallel to the plane XOY in the point cloud space coordinate system; With n as the rotation axis, n=N×Z, n is: n=(n x ,n y ,n z ), the rotation matrix is: Point cloud translation, the translation matrix of the point cloud is T; If the coordinates of the turntable center O' are known to be (x0, y0, z0), then (ΔX, ΔY, ΔZ) = (-x0, -y0, -z0); Among them, ΔX, ΔY, and ΔZ represent the translation of the point cloud along the x, y, and z axes; Save the parameters related to the rotation matrix and translation matrix.
5. The 3D structured light measurement calibration method according to claim 4, characterized in that: The calculation process of the ratio of point spacing to actual distance is: Read point cloud data Qend and H respectively; Coordinate system transformation: convert the initial point cloud space coordinate system into a world coordinate system with the axis of the turntable as the origin and the turntable plane as the plane of the coordinate system XOY; Plane fitting extraction: Use the random sampling consistency algorithm to perform plane fitting extraction on the point cloud data Qend and H, and obtain the plane point cloud data P1, P2, and the distance h1 between the two planes; The ratio of the Z-direction point spacing to the actual distance is calculated. According to the calibration point cloud data acquisition scheme, the actual distance between the two planes is h0, so the ratio of the Z-direction point spacing to the actual distance is h1 / h0; Point cloud filtering, using radius filtering to remove outliers in P1; Data dimensionality reduction, discarding the z value in the three-dimensional plane point cloud data and converting P1 into a point set on a two-dimensional plane; Create a two-dimensional plane convex hull and use the indices of the vertices that make up the convex hull to find the edge contour of the three-dimensional point cloud image; The edge contours of P1 are used to fit the space circle Y1, and their diameters are d1; The ratio of the point spacing in the X and Y directions to the actual distance is calculated. The longest point spacing in the X and Y directions is the diameter d1, and the actual diameter of the calibration piece is d0. Therefore, the point spacing in the X and Y directions to the actual distance is d1 / d0.
6. A 3D structured light measurement and calibration system, characterized in that: include: Module M1: system power-on startup; Module M2: System initialization and test platform configuration, including: selecting the square power battery model, checking whether the battery test indicators are correct, changing them if incorrect, manually entering the relevant test indicators for the first selected model; configuring the 3D structured light camera and motion control device parameters; Module M3: Calibrates the detection platform, including: collecting point cloud data of the calibration part and the circular calibration part; analyzing and processing the point cloud data to determine the axis and plane positions of the rotary table; calculating the coordinate system conversion matrix; analyzing and processing the point cloud data to determine the ratio of the distance between points in the point cloud data to the actual distance; and saving the calibration parameters. Module M4: Create a new measurement task, start measurement, and output a measurement report.
7. The 3D structured light measurement and calibration system according to claim 6, characterized in that: The process of collecting point cloud data of calibration parts is as follows: Parameter configuration, set the number of turntable rotations and the angle and speed parameters of each rotation, and set the camera exposure value; Place the ring calibration piece in the center area of the turntable; Start the 3D camera and observe the position of the point cloud image in the point cloud space coordinate system; Initial position setting, control the horizontal motion module, vertical motion module and servo motor so that the structured light of the 3D camera is projected to the center of the rotating stage. The position meets the working distance of the 3D camera, the point cloud image is displayed in the center of the GUI interface, and the point cloud data volume meets the measurement requirements. Collect the point cloud data of the calibration part at the current viewing angle, save it sequentially and transmit it to the point cloud data processing module for processing; Control the turntable to rotate once, and use the turntable movement to change the visual posture of the calibration object on the turntable until the point cloud data of the calibration object from all viewing angles is collected. This part of the point cloud data is formed into a group of point cloud data, recorded as Q1, Q2, Q3, ..., Qend, and used for the calibration of the axis and plane position of the turntable; Control the vertical motion module to move the camera upward by a distance h0, so that the position of the point cloud image of the calibration object in the spatial coordinate system changes; Collect point cloud data, denoted as H; Control the vertical motion module to return the camera to its initial position.
8. The 3D structured light measurement and calibration system according to claim 7, characterized in that: The calibration process of the rotary table axis and plane position is as follows: Sequentially read the collected calibration point cloud data Q1, Q2, Q3, ..., Qend; Use the random sampling consistency algorithm to perform plane fitting extraction and obtain the calibration plane equation: z = Ax + By + C, and the plane normal vector: N = (A, B, 1). Here, x, y, and z represent the coordinates of the point on the plane on the x, y, and z axes, respectively. A and B are the slopes of the calibration plane in the x and y directions, respectively, and C is the z-intercept. Calculate the angle α between the normal vector of the fitting plane and the YOZ plane and XOZ plane x ,α y ; Calculate the rotation angles θ and φ around the X and Y axes required for point cloud alignment; use a right-handed coordinate system, with the counterclockwise direction as the positive direction of rotation, and determine the values of θ and φ based on the quadrant in which they are located; let Then the values of θ and φ are as follows: If the normal vector N is in quadrants I and VII, θ = α1, φ = -α2; If the normal vector N is in quadrants II and VIII, θ = α1, φ = α2; If the normal vector N is in quadrants III and V, θ = -α1, φ = α2; If the normal vector N is in quadrants IV and VI, θ = -α1, φ = -α2; Calculate the rotation matrices R1 and R2 around the X-axis and Y-axis required for point cloud alignment, and perform rotation transformation so that the fitting plane is parallel to the plane XOY in the point cloud space coordinate system; Use the radius filtering algorithm to filter the plane point cloud data and remove outliers; Discard the z value in the three-dimensional plane point cloud data and convert it into a point set on a two-dimensional plane; Create a two-dimensional plane convex hull and use the indices of the vertices that make up the convex hull to find the edge contour of the three-dimensional point cloud image; Fit a circle to the extracted calibration part plane contour point cloud data and save the center position of the circle; Read the next viewpoint point cloud data until all viewpoint point cloud data are processed; Fit a space circle based on the center position of the point cloud data at each viewing angle; Calculate the axis coordinates and the equation of the plane where the turntable is located. The axis is O' and the coordinates are (x0, y0, z0). The equation of the turntable plane is z = A0x + B0y + C0. Let the height of the calibration piece be h. Then, the plane where the circle is located is h points below the plane where the turntable is located, and the axis of rotation of the turntable is h points below the center of the circle.
9. The 3D structured light measurement and calibration system according to claim 8, characterized in that: The calculation process of the coordinate system transformation matrix is: Calculate the angle α between the normal vector of the turntable plane and the OZ axis z , given the turntable plane equation z = A0x + B0y + C0, the bottom surface normal vector is N' = (A0, B0, 1), and the OZ axis unit vector is Z = (0, 0, 1), then: Where A0 and B0 are the slopes of the rotation stage plane in the x-axis and y-axis directions, respectively, and C0 is the z-axis intercept; The point cloud is rotated and transformed so that the bottom surface of the 3D point cloud is parallel to the plane XOY in the point cloud space coordinate system; With n as the rotation axis, n=N×Z, n is: n=(n x ,n y ,n z ), the rotation matrix is: Point cloud translation, the translation matrix of the point cloud is T; If the coordinates of the turntable center O' are known to be (x0, y0, z0), then (ΔX, ΔY, ΔZ) = (-x0, -y0, -z0); Among them, ΔX, ΔY, and ΔZ represent the translation of the point cloud along the x, y, and z axes; Save the parameters related to the rotation matrix and translation matrix.
10. The 3D structured light measurement and calibration system according to claim 9, characterized in that: The calculation process of the ratio of point spacing to actual distance is: Read point cloud data Qend and H respectively; Coordinate system transformation: convert the initial point cloud space coordinate system into a world coordinate system with the axis of the turntable as the origin and the turntable plane as the plane of the coordinate system XOY; Plane fitting extraction: Use the random sampling consistency algorithm to perform plane fitting extraction on the point cloud data Qend and H, and obtain the plane point cloud data P1, P2, and the distance h1 between the two planes; The ratio of the Z-direction point spacing to the actual distance is calculated. According to the calibration point cloud data acquisition scheme, the actual distance between the two planes is h0, so the ratio of the Z-direction point spacing to the actual distance is h1 / h0; Point cloud filtering, using radius filtering to remove outliers in P1; Data dimensionality reduction, discarding the z value in the three-dimensional plane point cloud data and converting P1 into a point set on a two-dimensional plane; Create a two-dimensional plane convex hull and use the indices of the vertices that make up the convex hull to find the edge contour of the three-dimensional point cloud image; The edge contours of P1 are used to fit the space circle Y1, and their diameters are d1; The ratio of the point spacing in the X and Y directions to the actual distance is calculated. The longest point spacing in the X and Y directions is the diameter d1, and the actual diameter of the calibration piece is d0. Therefore, the point spacing in the X and Y directions to the actual distance is d1 / d0.
Citation Information
Cited By
Revolving body workpiece three-dimensional reconstruction method, system and equipment based on laser contourgraph and medium
CN121527347A
Freedom degree calibration method and system of multi-group line structure optical measuring head
CN121540087A
