Workpiece parameter measurement method, device, computer equipment and readable storage medium

By integrating 2D and 3D measurement methods for workpiece parameter measurement, the problem of difficulty in taking into account accuracy and efficiency in workpiece parameter measurement is solved, and efficient and accurate parameter measurement is achieved.

CN118960560BActive Publication Date: 2025-09-02SPEEDBOT ROBOTICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411024218.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-29
Publication Date
2025-09-02
Estimated Expiration
2044-07-29

AI Technical Summary

Technical Problem

The prior art is difficult to take into account both measurement accuracy and measurement efficiency when measuring workpiece parameters. It is difficult to quickly screen out key point cloud data sets in high-density areas of 3D point cloud data, and it is difficult to ensure accuracy in 2D measurements.

Method used

By performing spatial transformation of the spatial sampling points of the workpiece to be measured, a plane sampling point is obtained, a plane measurement point is selected, and an inverse spatial transformation is performed. The parameter measurement is used to use three-dimensional measurement data to integrate the advantages of 2D and 3D measurements.

Benefits of technology

It realizes the measurement accuracy and efficiency in the measurement of workpiece parameters, improves measurement efficiency and maintains measurement accuracy, and avoids the defect of using 2D or 3D measurement methods alone.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118960560B_ABST
    Figure CN118960560B_ABST
Patent Text Reader

Abstract

The present application relates to a workpiece parameter measurement method, apparatus, computer equipment, and readable storage medium. The workpiece parameter measurement method comprises: performing spatial transformation on multiple spatial sampling points on a workpiece to be measured to obtain plane sampling points corresponding to each of the spatial sampling points, wherein the spatial sampling points and the plane sampling points are used to reflect the same workpiece parameter characteristics of the workpiece to be measured; selecting at least one plane measurement point from each of the plane sampling points based on the workpiece parameter characteristics; and performing inverse spatial transformation on each of the plane measurement points to obtain a spatial measurement point corresponding to each of the plane measurement points. This method can be used to measure workpiece parameters, which is difficult to achieve both measurement accuracy and measurement efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of visual measurement technology, and in particular to a workpiece parameter measurement method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art

[0002] With the continuous development of science and technology, the use of visual technology to measure workpiece parameters in industrial application scenarios has become common. The specific measurement methods mainly include 2D (Two-Dimensional) measurement and 3D (Three-Dimensional) measurement. Among them, 3D measurement has become the mainstream measurement method used in workpiece parameter measurement due to its high accuracy and flexibility.

[0003] At present, when measuring workpiece parameters, 3D point cloud data of the workpiece surface is usually obtained through a 3D camera, and then key point cloud data sets are screened out from the 3D point cloud data, and finally the workpiece parameters are measured through the key point cloud data sets. However, since 3D point cloud data is a discrete representation of the workpiece surface, it covers a large number of 3D points, and there will be multiple 3D points in high-density areas to represent the workpiece parameter characteristics, which makes it difficult to quickly screen out key point cloud data sets from the 3D point cloud data, and it is easy to cause the workpiece parameter measurement to take a long time. It is difficult to ensure the measurement accuracy of the workpiece parameters when measuring through a 2D camera. Therefore, it is difficult to take into account both measurement accuracy and measurement efficiency when measuring workpiece parameters. Summary of the Invention

[0004] Based on this, it is necessary to provide a workpiece parameter measurement method, device, computer equipment, computer-readable storage medium and computer program product that can address the above technical problems and overcome the difficulties in balancing measurement accuracy and efficiency when measuring workpiece parameters.

[0005] In a first aspect, the present application provides a method for measuring workpiece parameters, comprising:

[0006] Performing spatial transformation on a plurality of spatial sampling points on a workpiece to be measured to obtain plane sampling points corresponding to each of the spatial sampling points, wherein the spatial sampling points and the plane sampling points are used to reflect the same workpiece parameter feature of the workpiece to be measured;

[0007] Selecting at least one plane measurement point from each of the plane sampling points according to the workpiece parameter characteristics;

[0008] Performing an inverse spatial transformation on each of the planar measurement points to obtain a spatial measurement point corresponding to each of the planar measurement points;

[0009] Parameter measurement is performed on the workpiece to be measured according to the three-dimensional measurement data of each of the spatial measurement points.

[0010] In a second aspect, the present application further provides a workpiece parameter measuring device, comprising:

[0011] a spatial transformation module, configured to perform spatial transformation on a plurality of spatial sampling points on a workpiece to be measured to obtain plane sampling points corresponding to each of the spatial sampling points, wherein the spatial sampling points and the plane sampling points are used to reflect the same workpiece parameter feature of the workpiece to be measured;

[0012] A selection module, configured to select at least one plane measurement point from each of the plane sampling points according to the workpiece parameter characteristics;

[0013] an inverse spatial transformation module, configured to perform inverse spatial transformation on each of the planar measurement points to obtain a spatial measurement point corresponding to each of the planar measurement points;

[0014] The measuring module is used to measure parameters of the workpiece to be measured according to the three-dimensional measurement data of each of the spatial measurement points.

[0015] In a third aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0016] A plurality of spatial sampling points on a workpiece to be measured are spatially transformed to obtain plane sampling points corresponding to each of the spatial sampling points, wherein the spatial sampling points and the plane sampling points are used to reflect the same workpiece parameter feature of the workpiece to be measured; at least one plane measurement point is selected from each of the plane sampling points based on the workpiece parameter feature; an inverse spatial transformation is performed on each of the plane measurement points to obtain a spatial measurement point corresponding to each of the plane measurement points; and parameter measurement of the workpiece to be measured is performed based on the three-dimensional measurement data of each of the spatial measurement points.

[0017] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0018] A plurality of spatial sampling points on a workpiece to be measured are spatially transformed to obtain plane sampling points corresponding to each of the spatial sampling points, wherein the spatial sampling points and the plane sampling points are used to reflect the same workpiece parameter feature of the workpiece to be measured; at least one plane measurement point is selected from each of the plane sampling points based on the workpiece parameter feature; an inverse spatial transformation is performed on each of the plane measurement points to obtain a spatial measurement point corresponding to each of the plane measurement points; and parameter measurement of the workpiece to be measured is performed based on the three-dimensional measurement data of each of the spatial measurement points.

[0019] In a fifth aspect, the present application further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the following steps:

[0020] A plurality of spatial sampling points on a workpiece to be measured are spatially transformed to obtain plane sampling points corresponding to each of the spatial sampling points, wherein the spatial sampling points and the plane sampling points are used to reflect the same workpiece parameter feature of the workpiece to be measured; at least one plane measurement point is selected from each of the plane sampling points based on the workpiece parameter feature; an inverse spatial transformation is performed on each of the plane measurement points to obtain a spatial measurement point corresponding to each of the plane measurement points; and parameter measurement of the workpiece to be measured is performed based on the three-dimensional measurement data of each of the spatial measurement points.

[0021] The above-mentioned workpiece parameter measurement method, device, computer equipment, computer-readable storage medium and computer program product first perform spatial transformation on multiple spatial sampling points on the workpiece to be measured to obtain plane sampling points corresponding to different spatial sampling points. Since the spatial sampling points and the plane sampling points are used to reflect the same workpiece parameter characteristics of the workpiece to be measured, that is, the sampling points that feedback the workpiece parameter characteristics are reduced in dimension through spatial transformation to obtain multiple plane sampling points on the plane, and then plane measurement points are selected from the multiple plane sampling points through the workpiece parameter characteristics, and then the multiple plane measurement points are inversely spatially transformed to obtain spatial measurement points corresponding to different plane measurement points. Finally, the parameter detection of the workpiece to be measured is completed through the three-dimensional measurement data of the multiple spatial measurement points. Since the plane sampling points have less dimensional information than the spatial sampling points, the plane measurement points can be quickly located among the multiple plane sampling points through the workpiece parameter characteristics, which has a significant improvement in measurement efficiency compared to 3D measurement. At the same time, when the plane measurement points are selected, After the surface measurement points are inversely transformed to obtain spatial measurement points, the three-dimensional measurement data of the spatial measurement points can contain multi-dimensional information reflecting the parameter characteristics of the workpiece, which has a significant improvement in measurement accuracy compared to 2D measurement. Therefore, when measuring workpiece parameters, the purpose of measuring the workpiece is achieved by integrating the efficiency advantage of 2D measurement in the measurement process and the accuracy advantage of 3D measurement in the measurement results, rather than using 2D measurement or 3D measurement alone to measure the workpiece parameters. Therefore, the 3D point cloud data is a discrete representation of the workpiece surface, which covers a large number of 3D points, and there will be multiple 3D points in high-density areas to represent the workpiece parameter characteristics, which makes it difficult to quickly screen out key point cloud data sets in the 3D point cloud data, which makes it easy for the workpiece parameter measurement to take a long time, and it is difficult to ensure the measurement accuracy of the workpiece parameters when measuring through a 2D camera. Therefore, both measurement accuracy and efficiency are taken into account when measuring workpiece parameters. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments of the present application or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying any creative work.

[0023] Figure 1 1 is a flow chart of a method for measuring workpiece parameters in one embodiment;

[0024] Figure 2 is a schematic flow chart of a workpiece parameter measurement method according to another embodiment;

[0025] Figure 3 A measurement flow chart of a workpiece parameter measurement method in one embodiment;

[0026] Figure 4 is a structural block diagram of a workpiece parameter measuring device in one embodiment;

[0027] Figure 5 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0028] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0029] First of all, it should be understood that when using visual measurement technology to measure workpiece parameters, it mainly involves two measurement methods: 2D measurement and 3D measurement. Among them, 2D measurement uses a 2D camera to collect image data, and then extracts the workpiece image texture features through the image data, and finally completes the workpiece parameter measurement based on the workpiece image texture features. Among them, 2D measurement is often used to measure the size parameters and position parameters of the workpiece, such as straightness, position and contour, due to the high accuracy of the image plane and obvious edge features. 3D measurement uses a 3D camera to collect point cloud data, and then uses the point cloud data to obtain the workpiece surface height information, and finally relies on the multi-dimensional characterization of the point cloud data to complete the workpiece measurement. Among them, 3D measurement is often used to measure the surface roughness, flatness and other aspects of the workpiece due to its advantages such as high Z-axis accuracy and obvious geometric features. and volume, etc. However, different measurement methods all have their shortcomings. Although 2D measurement has high measurement accuracy on planes, it is difficult to measure spatial geometric objects, and the changes in light and darkness within the field of view can easily lead to unstable measurement of the edge of the workpiece, and thus it is difficult to measure objects with unclear background and target colors. Although 3D measurement has incomparable advantages in measuring geometric shapes and other related features, it is also easy to generate noise interference at the edges due to surface features and measurement errors, and the positioning accuracy of planar features is low. For example, it is difficult to quickly locate the feature positions of straight lines and holes on the workpiece. Therefore, it is difficult to maximize the advantages and avoid the disadvantages when using 2D measurement method or 3D measurement method alone for parameter measurement. Therefore, there is an urgent need for a workpiece parameter measurement method that can take into account both measurement accuracy and measurement efficiency.

[0030] In one embodiment, Figure 1As shown, a workpiece parameter measurement method is provided. This embodiment takes the method applied to a terminal as an example. The terminal includes but is not limited to a personal computer, a laptop computer, a smart phone, and a tablet computer. The terminal includes a spatial transformation module, a selection module, an inverse spatial transformation module, and a measurement module. The acquisition module is used to perform spatial transformation on multiple spatial sampling points on the workpiece to be measured to obtain plane sampling points that reflect the same workpiece parameter characteristics of the workpiece to be measured as each spatial sampling point, and each spatial sampling point corresponds to each other. The selection module is used to select at least one plane measurement point from each plane sampling point according to the workpiece parameter characteristics. The inverse spatial transformation module is used to perform inverse spatial transformation on each plane measurement point to obtain a spatial measurement point corresponding to each plane measurement point. The measurement module is used to perform inverse spatial transformation on each plane measurement point to obtain a spatial measurement point corresponding to each plane measurement point. The three-dimensional measurement data of each spatial measurement point is used to measure the parameters of the workpiece to be measured. The terminal processes the data interactively between the spatial transformation module, the selection module, the inverse spatial transformation module, and the measurement module. During the workpiece parameter measurement process, the selection of plane measurement points that specifically reflect the workpiece parameter characteristics is completed by relying on plane sampling points with fewer dimensions. Then, the plane measurement points are used to perform inverse spatial transformation to obtain spatial measurement points containing more dimensional information to complete the measurement of the workpiece parameters. That is, when measuring the workpiece parameters, the advantages of different measurement methods are fully integrated, thereby achieving the purpose of taking into account both measurement accuracy and measurement efficiency. It is understandable that this method can also be applied to servers, and can also be applied to systems including terminals and servers, and is implemented through the interaction between terminals and servers. In this embodiment, the method includes the following steps 202 to 208. Among them:

[0031] In step 202 , a plurality of spatial sampling points on the workpiece to be measured are spatially transformed to obtain plane sampling points corresponding to each spatial sampling point. The spatial sampling points and the plane sampling points are used to reflect the same workpiece parameter feature of the workpiece to be measured.

[0032] It should be noted that the workpiece to be measured refers to the workpiece waiting for parameter measurement. The measured parameters can specifically include geometric size parameters, shape parameters, position parameters, and material parameters, such as aperture, straightness, profile, position, roughness, and flatness. The workpiece can specifically include electronic components, metal castings, and plastic parts. Taking a robot as an example, the workpiece parameter to be measured can specifically be the profile of the rearview mirror base. The workpiece parameter feature is used to characterize the properties of the workpiece parameter, and can specifically include aperture features, profile features, straight line features, or position features. The workpiece parameter feature can be determined by the measurement requirements of the measurement personnel. For example, in one feasible method, when measuring the aperture of the rearview mirror base, the corresponding workpiece parameter feature is the aperture feature. Spatial sampling points refer to sampling points obtained by sampling in three-dimensional space, wherein the spatial sampling points can be obtained by ordered sampling or disordered sampling. The sampling method of the spatial sampling points is not specifically limited in this embodiment and can be random sampling, uniform sampling, or grid sampling. The distribution of the spatial sampling points can be determined by multiple factors such as the sampling device and the sampling method. For example, in one practicable embodiment, assuming that the sampling device is a 3D camera, 3D points collected by the 3D camera within a preset distance threshold from the aperture surface of the workpiece to be inspected are integrated into multiple spatial sampling points that feedback workpiece parameter characteristics. It is understandable that among the multiple spatial sampling points, there may be sampling points that reflect the aperture characteristics at the same position, and there may also be sampling points that lack the aperture characteristics at a certain position. That is, after sampling is completed, there may be redundancy and lack of sampling points reflecting the aperture characteristics among the multiple spatial sampling points. This embodiment overcomes the above-mentioned technical shortcomings by integrating 2D measurement and 3D measurement methods to achieve both measurement accuracy and measurement efficiency when measuring workpiece parameters.

[0033] It should be noted that the specific method of spatial transformation is not specifically limited in this embodiment, and can be projection transformation, view transformation or matrix transformation, etc. The plane sampling point is the result of dimensionality reduction after the spatial sampling point is spatially transformed, that is, the plane sampling point refers to the sampling point obtained by sampling in two-dimensional space. It can be understood that in the process of reducing the sampling point from three-dimensional space to two-dimensional space, there is a loss of dimensional information, which can overcome the redundancy problem of sampling points reflecting workpiece parameter characteristics to a certain extent. For example, in one feasible method, it is assumed that the workpiece parameter feature reflected is a straight line feature, and the spatial sampling points reflecting the straight line feature include A, B and C, where the three-dimensional position coordinates of A are , the three-dimensional position coordinates of B are , the three-dimensional position coordinates of C are After the spatial transformation, the plane sampling points corresponding to the three spatial sampling points are all D, and the two-dimensional position coordinates of D are , then the feedback of A, B, and C on the straight line features can be achieved through the plane sampling point D. It can be understood that since a plane sampling point corresponding to a spatial sampling point reflects certain workpiece parameter characteristics of the workpiece to be measured, after the spatial sampling point dimensionality reduction is performed to obtain the plane sampling points, multiple plane sampling points can still fully reflect all the workpiece parameter characteristics of the workpiece to be measured, just like multiple spatial sampling points. By locating all the workpiece parameter characteristics of the workpiece to be measured, the corresponding workpiece parameters can be measured.

[0034] As an example, the projection directions of multiple spatial sampling points on the workpiece to be measured are obtained, and each spatial sampling point is orthogonally projected using the projection direction to obtain the plane sampling points corresponding to each spatial sampling point projected onto a preset plane.

[0035] Step 204 : Select at least one planar measurement point from each planar sampling point according to the workpiece parameter characteristics.

[0036] It should be noted that a plane measurement point refers to a sampling point in a two-dimensional space used to measure workpiece parameters, which can be one or more. For example, in one feasible method, different plane measurement points on a certain projection plane are used to reflect different positions of aperture features. It can be understood that different plane sampling points are used to reflect different workpiece parameter characteristics of the workpiece to be measured. The selection of plane measurement points is determined based on the workpiece parameter characteristics under the actual measurement needs of the measurement personnel.

[0037] As an example, at least one candidate measurement sampling point is randomly selected from each plane sampling point, and based on the two-dimensional position data of each candidate measurement sampling point, it is detected whether each candidate measurement sampling point meets the workpiece parameter characteristics. If it is detected that each candidate measurement sampling point meets the workpiece parameter characteristics, each candidate measurement sampling point is used as a plane measurement point. If it is detected that each candidate measurement sampling point does not meet the workpiece parameter characteristics, the process returns to the step of randomly selecting at least one candidate measurement sampling point from each plane sampling point and subsequent steps.

[0038] Step 206: Perform inverse spatial transformation on each plane measurement point to obtain a spatial measurement point corresponding to each plane measurement point.

[0039] It should be noted that due to the limited dimensions of the plane measurement points, if two-dimensional measurement of the plane measurement points is directly used, the measurement of the workpiece parameters will be biased due to the inability to fully feedback the workpiece parameter characteristics of the workpiece to be measured. For example, if the aperture of the workpiece to be measured is determined by relying on the plane measurement points, the aperture measurement error will occur due to the lack of geometric shape characteristics of the plane measurement points. Then, the inverse space transformation can be used to make the workpiece parameter measurement of the workpiece to be measured still rely on the measurement data in the initial dimensional space. It can be understood that the inverse space transformation is an inverse space transformation operation. For example, if the specific operation of the space transformation is "orthogonal projection", the specific operation of the inverse space transformation is "inverse orthogonal projection". The space measurement point refers to the sampling point in the three-dimensional space used to measure the workpiece parameters. The plane measurement points and the space measurement points correspond one to one. Through the inverse space transformation, the workpiece parameter characteristics of the workpiece to be measured can be represented in a high-dimensional space, thereby laying the foundation for the accurate measurement of the workpiece parameters.

[0040] As an example, the projection direction of the workpiece to be measured is obtained, and each spatial measurement point is orthogonally projected in the opposite direction of the projection direction to obtain the plane sampling points corresponding to each plane measurement point projected into the three-dimensional space.

[0041] Step 208 : performing parameter measurement on the workpiece to be measured based on the three-dimensional measurement data of each spatial measurement point.

[0042] It should be noted that three-dimensional measurement data refers to three-dimensional data used to measure workpiece parameters, which may include three-dimensional position data and three-dimensional pixel data, among which the three-dimensional position data may be The three-dimensional pixel data may specifically be an intensity value, wherein the intensity value refers to a reflection intensity value, which is used to measure the energy intensity of the laser beam reflected at each point in the three-dimensional space. Parameter measurement of the workpiece to be measured may rely on a measuring tool, and this embodiment does not specifically limit this.

[0043] As an example, three-dimensional measurement data of each spatial measurement point is collected, and parameter measurement of the workpiece to be measured is performed based on the three-dimensional measurement data and a preset measurement tool.

[0044] In the above workpiece parameter measurement method, first, a plurality of spatial sampling points on the workpiece to be measured are orthogonally projected onto a preset plane in a specific projection direction to obtain plane sampling points corresponding to different spatial sampling points, and then, with the help of the same workpiece parameter characteristics reflected by the plane sampling points and the spatial sampling points in different dimensions, a plurality of plane measurement points are screened out from each plane sampling point, and then, each spatial measurement point on the preset plane is orthogonally projected into the three-dimensional space in the opposite direction of the specific projection direction to obtain the spatial measurement point corresponding to each plane measurement point in the three-dimensional space, and finally, the three-dimensional measurement data of the plurality of spatial measurement points are used to measure the parameters of the workpiece to be measured. Since the plane sampling points have less dimensional information than the spatial sampling points, the plane measurement points can be quickly located from the plurality of plane sampling points through the workpiece parameter characteristics, which has a significant improvement in measurement efficiency compared to 3D measurement. At the same time, after the plane measurement points are inversely transformed into the spatial measurement points, the space measurement points 3D point cloud data is a discrete representation of the workpiece surface, which covers a large number of 3D points. In addition, there are multiple 3D points in high-density areas to represent the workpiece parameter characteristics, which makes it difficult to quickly screen out key point cloud data sets in the 3D point cloud data, making it easy to take a long time to measure the workpiece parameters. However, it is difficult to ensure the measurement accuracy of the workpiece parameters when measuring with a 2D camera. Therefore, both measurement accuracy and efficiency are taken into account when measuring the workpiece parameters.

[0045] In one embodiment, Figure 2 As shown, multiple spatial sampling points on the workpiece to be measured are spatially transformed to obtain the plane sampling points corresponding to each spatial sampling point, including:

[0046] Step 302: Perform a projection transformation on each spatial sampling point based on the three-dimensional position data of each spatial sampling point to obtain projection position data of each spatial sampling point projected onto a first preset plane.

[0047] It should be noted that when performing spatial transformation on each spatial sampling point, in order to make the spatial sampling point and the plane sampling point reflect the same parameter characteristics of the workpiece to be measured, the transformation direction of the spatial transformation needs to be parallel to the normal vector of the projection plane. However, in some specific application scenarios, such as when the workpiece to be measured is tilted or the transformation direction of the spatial transformation intersects with the normal vector of the projection plane, a simple spatial transformation method cannot determine whether the spatial sampling points before the spatial transformation and the spatial sampling points after the spatial transformation reflect the same workpiece parameter characteristics of the workpiece to be measured. This embodiment proposes a spatial transformation method that combines projection transformation and rotation transformation to realize the conversion of spatial sampling points to plane sampling points.

[0048] It should be noted that the first preset plane is a designated projection plane of each spatial sampling point, wherein the first preset plane can be obtained by solving the set three-dimensional plane equation, and the expression of the three-dimensional plane equation can be The projected position data refers to the two-dimensional position data of the spatial sampling point projected onto the first preset plane. For example, in one practicable method, a perpendicular line to the first preset plane is drawn for any spatial sampling point, and the perpendicular line is parallel to the normal vector of the first preset plane. The projected position coordinates can be obtained by relying on the above linear relationship and the three-dimensional position data of the spatial sampling point.

[0049] As an example, based on the three-dimensional position data of each spatial sampling point and a preset three-dimensional plane equation, a first preset plane of each spatial sampling point is determined, each spatial sampling point is projected onto the first preset plane, and a projection transformation relationship between the first preset plane and each spatial sampling point is determined. Based on the projection transformation relationship and the three-dimensional position data of each spatial sampling point, the projection position data of each spatial sampling point projected onto the first preset plane is calculated.

[0050] Step 304 : Rotate and transform each spatial sampling point from the first preset plane to the second preset plane according to each projection position data, wherein the projection direction onto the first preset plane is perpendicular to the second preset plane.

[0051] It should be noted that the second preset plane is a plane that keeps the workpiece parameter characteristics of each spatial sampling point unchanged. It can be understood that no matter how the workpiece to be measured is placed in three-dimensional space, there is always a unique plane perpendicular to the projection direction of the spatial sampling points. Then, by rotating the first preset plane by a preset angle, multiple spatial sampling points can be spatially transformed to the second preset plane to ensure that the plane sampling points and the spatial sampling points obtained after the spatial transformation have the same workpiece parameter characteristics. For example, in one feasible method, the first plane normal vector of the first preset plane and the second preset plane normal vector of the second preset plane are cross-multiplied to obtain the rotation axis, and the dot product is used to obtain the rotation angle. Through the rotation axis and the rotation angle, each spatial sampling point is rotationally transformed from the first preset plane to the second preset plane.

[0052] As an example, based on the projection position data, the first plane normal vector of the first preset plane and the second preset plane normal vector of the second preset plane are calculated, the first plane normal vector and the second preset plane normal vector are cross-multiplied to obtain the rotation axis for the rotation transformation of each spatial sampling point, the first plane normal vector and the second preset plane normal vector are dot-multiplied to obtain the rotation angle for the rotation transformation of each spatial sampling point, and each spatial sampling point is rotated from the first preset plane to the second preset plane through the rotation axis and the rotation angle.

[0053] Step 306: locate the plane sampling points corresponding to each spatial sampling point on the second preset plane.

[0054] As an example, based on each projection position data, the rotation position data of each spatial sampling point rotated to the second preset plane is solved, and based on the rotation position data, the plane sampling points corresponding to each spatial sampling point are located on the second preset plane.

[0055] When performing spatial transformation, the three-dimensional position data of the spatial sampling points are first used to project the spatial sampling points onto any specified first preset plane, and the projection position data of the spatial sampling points projected onto the first preset plane are obtained. Then, the projection position data are used to rotate each spatial sampling point from the first preset plane to the second preset plane. Since the projection direction onto the first preset plane is perpendicular to the second preset plane, the spatial sampling points still present the workpiece parameter characteristics in the three-dimensional space on the second preset plane after the projection transformation and the rotation transformation. That is, it is determined that the workpiece parameter characteristics of the spatial sampling points before and after the spatial transformation remain unchanged. Moreover, since the projection transformation and the rotation transformation do not limit the positional relationship between the spatial transformation direction and the plane, any workpiece to be measured can be obtained through a specific spatial transformation method to perform the conversion from spatial sampling points to plane sampling points. Therefore, while laying the foundation for improving the measurement efficiency of workpiece parameter measurement, the measurement flexibility of workpiece parameter measurement is improved.

[0056] In one embodiment, locating the plane sampling points corresponding to the spatial sampling points on the second preset plane includes:

[0057] Based on the three-dimensional position data, a projection transformation matrix corresponding to each spatial sampling point is determined; based on the rotation axis and rotation angle between the first preset plane and the second preset plane, a rotation transformation matrix corresponding to each spatial sampling point is determined; based on the projection transformation matrix, the rotation transformation matrix and the two-dimensional position data of each spatial sampling point on the second preset plane, a mapping relationship matrix for mapping each spatial sampling point to the second preset plane is determined; and based on the mapping relationship matrix, the plane sampling point corresponding to each spatial sampling point is located on the second preset plane.

[0058] It should be noted that, since the spatial sampling points always satisfy a certain linear relationship during the spatial transformation process, the linear relationship can be used to perform spatial transformation of the spatial sampling points to locate the plane sampling points of the second preset plane, wherein the projection transformation matrix is ​​used to characterize the projection transformation relationship, the rotation transformation matrix is ​​used to characterize the rotation transformation relationship, and the mapping relationship matrix is ​​used to characterize the mapping relationship between the spatial sampling points and the plane sampling points. The two-dimensional position number of each spatial sampling point mapped to the second preset plane can be calculated based on the projection position data. It can be understood that when the dimensions of different matrices are inconsistent, the matrices of different dimensions can be converted into matrices of the same dimension through preprocessing operations to facilitate the calculation. For example, in one feasible method, assuming that the mapping relationship matrix is ​​represented by T, the projection transformation matrix is ​​represented by T1, the rotation transformation matrix is ​​represented by T2, and the matrix formed by the two-dimensional position data of each spatial sampling point mapped to the second preset plane is T3, then there is .

[0059] As an example, based on the three-dimensional position data and the projection transformation relationship, the projection transformation matrix corresponding to each spatial sampling point is calculated; based on the first plane normal vector of the first preset plane and the second preset plane normal vector of the second preset plane, the rotation axis between the first preset plane and the second preset plane, and the rotation angle between the first preset plane and the second preset plane are calculated respectively, and the rotation matrix is ​​solved by the rotation axis and the rotation angle; the projection transformation matrix, the rotation transformation matrix and the two-dimensional position data of each spatial sampling point mapped to the second preset plane are point multiplied to obtain a mapping relationship matrix of the spatial sampling points mapped to the second preset plane; according to the mapping relationship matrix and the three-dimensional sampling data of each spatial sampling point, the plane sampling points corresponding to each spatial sampling point are located in the second preset plane.

[0060] By using the projection transformation matrix of the spatial sampling points in the projection transformation process and the rotation transformation matrix in the rotation transformation process, combined with the two-dimensional position data of the spatial sampling points mapped to the second preset plane, a mapping relationship matrix of multiple spatial sampling points mapped to the second preset plane is obtained. Then, using the mapping relationship matrix, the purpose of quickly locating the planar sampling points of the spatial sampling points of the workpiece to be measured on the second preset plane can be achieved. Since the mapping relationship matrix can reflect the mapping relationship between the spatial points and the planar points before and after the spatial transformation, a 3D-2D mapping relationship can be established by constructing the mapping relationship matrix. Compared with positioning based on the correspondence between position data, positioning based on the mapping relationship has a small amount of data processing, thereby improving the positioning efficiency of the planar sampling points.

[0061] In one embodiment, before the step of determining a mapping relationship matrix for mapping each spatial sampling point to the second preset plane based on the projection transformation matrix, the rotation transformation matrix, and the two-dimensional position data of each spatial sampling point on the second preset plane, the method further includes:

[0062] Determine the spacing extremes of the spatial sampling points in different directions of the second preset plane; generate a two-dimensional initial image corresponding to each spatial sampling point on the second preset plane based on each spacing extreme value; and determine the two-dimensional position data of each spatial sampling point on the second preset plane based on a mapping relationship between each projection position data and the two-dimensional initial image.

[0063] It should be noted that, under normal circumstances, the two-dimensional position data of the spatial sampling points mapped to the second preset plane can be calculated one by one through the spatial transformation relationship and with the help of the position data before the spatial transformation. However, since the number of spatial sampling points is very large and discrete, in order to more quickly select the plane measurement point from multiple sampling points, the range of each spatial sampling point mapped to the second preset plane is framed by generating a two-dimensional initial image, and based on the rotation transformation relationship and the projection position data as a reference, the two-dimensional position data of the spatial sampling point in the second preset plane is determined.

[0064] It should be noted that the spacing extreme value refers to the extreme value in a certain direction when the spatial sampling point is mapped to the second preset plane, which can be specifically the spacing maximum value and the spacing minimum value, etc., wherein the direction is given by the surveyor according to the needs, and can be specifically the x-axis direction or the y-axis direction of the coordinate system where the second preset plane is located. For example, in one feasible method, the maximum and minimum values ​​of the spatial sampling point in the x-axis direction when mapped to the second preset plane, as well as the maximum and minimum values ​​of the spatial sampling point in the y-axis direction when mapped to the second preset plane are determined by the projection position data, so that the size value of the two-dimensional initial image is determined by the ratio between the spacing extreme values ​​in different directions and the preset physical size value represented by the pixel point of the set two-dimensional initial image, and then the two-dimensional initial image is generated on the second preset plane according to the size value. Finally, the two-dimensional position data of the spatial sampling point mapped on the second preset plane is calculated according to the projection position data.

[0065] As an example, based on each projection position data, the first spacing extreme value in the x-axis direction and the second spacing extreme value in the y-axis direction of each spatial sampling point in the second preset plane are calculated; the ratio between the first spacing extreme value and the preset physical size value is calculated to obtain the length value of the two-dimensional initial image, and the ratio between the second spacing extreme value and the preset physical size value is calculated to obtain the width value of the two-dimensional initial image, and based on the length value and the width value, a two-dimensional initial image is generated in the second preset plane; the ratio between the projection position data and the preset physical size value is calculated, and the position data of each spatial sampling point in the two-dimensional initial image is rounded, and the position data is used as the two-dimensional position data of each spatial sampling point in the second preset plane.

[0066] In one feasible manner, since the two-dimensional initial image can be generated at any position of the second preset plane, in order to fit the origin of the coordinate system of the second preset plane, the following processing method can be adopted in the process of processing the position data of each spatial sampling point in the two-dimensional initial image: calculate the ratio between the projection position data minus the minimum value of the distance of each spatial sampling point in different directions and the preset physical size value, and round it to obtain the position data of each spatial sampling point in the two-dimensional initial image, and use the position data as the final position data of each spatial sampling point in the two-dimensional initial image, so as to avoid the error between the coordinate system of the second preset plane.

[0067] After each spatial sampling point is rotated and transformed to the second preset plane, the position transformation of each spatial sampling point mapped on the second preset plane is also performed, and then the two-dimensional position data of each spatial sampling point on the second preset plane are clustered in the two-dimensional initial image of the second preset plane, so as to facilitate the subsequent plane measurement point selection operation within multiple plane sampling points. Therefore, it lays the foundation for improving the efficiency of plane measurement point selection.

[0068] In one embodiment, at least one plane measurement point is selected from each plane sampling point according to the workpiece parameter characteristics, including:

[0069] A two-dimensional measurement image of the workpiece to be measured is generated based on the three-dimensional pixel data of each spatial sampling point and each planar sampling point, wherein one spatial sampling point corresponds to one planar sampling point based on a mapping relationship matrix; and at least one planar measurement point reflecting the parameter characteristics of the workpiece is extracted from the two-dimensional measurement image.

[0070] It should be noted that when selecting plane measurement points, in order to improve the efficiency of plane measurement point selection, it is possible to rely on a two-dimensional measurement image, wherein the two-dimensional measurement image refers to an image in a two-dimensional space used for workpiece parameter measurement, specifically a grayscale image or a color image, etc. Since the mapping relationship matrix between the spatial sampling points and the plane sampling points has been established, the two-dimensional measurement image can be generated by filling the corresponding three-dimensional pixel data in the two-dimensional initial image, wherein the three-dimensional pixel data can specifically be pixel values.

[0071] As an example, for any spatial sampling point, the plane sampling point of the spatial sampling point in the two-dimensional initial image is determined according to the mapping relationship matrix, and the pixel value of the spatial sampling point is assigned to the plane sampling point until each spatial sampling point completes the assignment to the corresponding plane sampling point, and a two-dimensional measurement image of the workpiece to be measured is generated according to the updated pixel value of each plane sampling point; at least one plane measurement point reflecting the parameter characteristics of the workpiece is extracted from the two-dimensional measurement image, wherein the specific method of extracting a plane measurement point reflecting the parameter characteristics of the workpiece can be an image processing operation such as edge detection or feature extraction.

[0072] In one embodiment, each plane sampling point includes a first plane sampling point and a second preset plane sampling point; generating a two-dimensional measurement image of the workpiece to be measured based on the three-dimensional pixel data of each spatial sampling point and each plane sampling point includes:

[0073] Based on the three-dimensional pixel data of each spatial sampling point, each spatial sampling point is screened to obtain at least one candidate spatial sampling point, where each candidate spatial sampling point corresponds to a first plane sampling point; the three-dimensional pixel data of each candidate spatial sampling point is normalized to obtain normalized pixel data corresponding to each candidate spatial sampling point; based on each normalized pixel data, the two-dimensional pixel data of each first plane sampling point is replaced to obtain at least one reconstructed plane sampling point; and based on each reconstructed plane sampling point and the second preset plane sampling point, a two-dimensional measurement image is generated.

[0074] It should be noted that, during the process of generating a two-dimensional measurement image, due to environmental or positional reasons, there may be sampling points whose three-dimensional pixel data of the spatial sampling points is invalid. Consequently, not all spatial sampling points correspond to pixels in the two-dimensional initial image. That is, not all sampling points require pixel data updating. The plane sampling points include first plane sampling points and second preset plane sampling points. The first plane sampling points are plane sampling points whose pixel values ​​need to be replaced, and the second sampling points are plane sampling points whose pixel values ​​do not need to be replaced. For example, in one practicable manner, after obtaining the three-dimensional pixel data of the spatial sampling points, the invalid spatial sampling points are removed based on the relationship between the pixel values ​​and a preset pixel threshold to obtain at least one candidate spatial sampling point. The pixel values ​​of the candidate spatial sampling points are then normalized to the interval [0, 255] to obtain normalized pixel data. The mapping relationship matrix is ​​then used to find the first plane sampling point corresponding to each candidate spatial sampling point to complete the pixel value replacement and obtain a reconstructed plane sampling point. Finally, the two-dimensional measurement image is generated based on the reconstructed plane sampling points and the second preset plane sampling points.

[0075] As an example, based on the relationship between the three-dimensional pixel data of each spatial sampling point and a preset pixel threshold, at least one candidate spatial sampling point is screened at each spatial sampling point, where each candidate spatial sampling point corresponds to a first plane sampling point; the three-dimensional pixel data of each candidate spatial sampling point is normalized to obtain normalized pixel data; based on each normalized pixel data, the two-dimensional pixel data of each first plane sampling point is replaced to obtain at least one reconstructed plane sampling point; and based on each reconstructed plane sampling point and a second preset plane sampling point, a two-dimensional measurement image is generated.

[0076] In one embodiment, before performing spatial transformation on a plurality of spatial sampling points on a workpiece to be measured to obtain a planar sampling point corresponding to each spatial sampling point, the method further includes:

[0077] Pixel update data is extracted from the three-dimensional position data of the abnormal spatial sampling point; and the abnormal spatial sampling point is adjusted to a spatial sampling point by replacing the three-dimensional pixel data of the abnormal spatial sampling point with the pixel update data.

[0078] It should be noted that different measuring devices have different sampling capabilities for sampling spatial sampling points, and thus it is difficult to avoid the situation where the three-dimensional sampling data of the acquired spatial sampling points are missing, such as missing pixel values. Therefore, by pre-processing the data, it is ensured that all spatial sampling points have normal three-dimensional sampling data, so as to facilitate the subsequent measurement of workpiece parameters. For example, in one feasible method, assuming that the spatial sampling point E has a missing pixel value, E is marked as an abnormal spatial sampling point, and the three-dimensional position data of E is of 、 or as pixel values.

[0079] As an example, the lateral position data within the 3D position data of an abnormal spatial sampling point is used as pixel update data. By replacing the 3D pixel data of the abnormal spatial sampling point with the pixel update data, the abnormal spatial sampling point is adjusted to a spatial sampling point. After the pixel update is completed, the abnormal spatial sampling point can be used as a normal spatial sampling point, thus ensuring the integrity of the spatial sampling point. This lays the foundation for both accuracy and efficiency in subsequent workpiece parameter measurement.

[0080] In one practicable manner, referring to Figure 3 , Figure 3 This is the measurement flow chart for workpiece parameter measurement. The specific process is as follows:

[0081] First, obtain a 3D point cloud on the workpiece surface: use a 3D camera to collect point cloud data on the workpiece surface, and save the original 3D point cloud x, y, z and intensity values, that is, collect multiple spatial sampling points of the workpiece to be measured, and obtain the three-dimensional position data and three-dimensional pixel data of each spatial sampling point, and then project the 3D point cloud to the specified plane: project each point in the original 3D point cloud to the specified plane to generate a projected 3D point cloud, that is, transform the projection of each spatial sampling point to the first preset plane, and then generate a 2D blank image: rotate the 3D point cloud on the projection plane to the XOY plane, and then generate a 2D blank image based on the rotated 3D point cloud data, that is, rotate each spatial sampling point from the first preset plane to the second preset plane, and generate a two-dimensional initial image in the second preset plane, and determine the two-dimensional position data of each spatial sampling point in the second preset plane, and then establish a 3D-2D mapping. Relationship: The 3D point cloud on the XOY plane is matched one-to-one with the pixel points on the 2D blank image, and then the mapping relationship matrix between the original 3D point cloud and the 2D image is constructed, that is, according to the two-dimensional position data of each spatial sampling point on the second preset plane, the projection transformation matrix and the rotation transformation matrix, the mapping relationship matrix is ​​solved, and then the pixel assignment is generated to generate a 2D image: the image pixel value is calculated by the intensity value of the original 3D point cloud to generate a 2D grayscale image, that is, according to the three-dimensional pixel data of each plane sampling point and each spatial sampling point, a two-dimensional measurement image is generated, and then the 2D is back-projected to the 3D point cloud: feature points are found on the 2D grayscale image and back-projected to the original 3D point cloud, that is, the plane measurement points are inversely transformed to obtain spatial measurement points, and the workpiece parameters are measured based on the spatial measurement points, and finally the workpiece diameter measurement, straightness measurement, contour measurement and position measurement are completed.

[0082] Since the plane sampling points have less dimensional information than the spatial sampling points, the plane measurement points can be quickly located among multiple plane sampling points through the workpiece parameter characteristics, which has a significant improvement in measurement efficiency compared to 3D measurement. At the same time, after the plane measurement points are inversely transformed into spatial measurement points, the three-dimensional measurement data of the spatial measurement points can contain multi-dimensional information reflecting the workpiece parameter characteristics, which has a significant improvement in measurement accuracy compared to 2D measurement. Therefore, when measuring workpiece parameters, the efficiency advantage of 2D measurement in the measurement process and the accuracy advantage of 3D measurement in the measurement results are combined to achieve the goal of The purpose of measuring the workpiece to be measured is to measure the workpiece parameters instead of using 2D measurement or 3D measurement alone. Therefore, it overcomes the problem that 3D point cloud data is a discrete representation of the workpiece surface, which covers a large number of 3D points, and there will be multiple 3D points in high-density areas to represent the workpiece parameter characteristics, resulting in difficulty in quickly screening out key point cloud data sets in 3D point cloud data, which in turn makes it easy for workpiece parameter measurement to take a long time, and it is difficult to ensure the measurement accuracy of workpiece parameters when measuring through 2D cameras. Therefore, both measurement accuracy and measurement efficiency are taken into account when measuring workpiece parameters.

[0083] It should be understood that, although the steps in the flowcharts of the above embodiments are shown in sequence as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the flowcharts of the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily to be performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0084] Based on the same inventive concept, embodiments of the present application also provide a workpiece parameter measurement device for implementing the aforementioned workpiece parameter measurement method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more workpiece parameter measurement device embodiments provided below can be found in the aforementioned limitations of the workpiece parameter measurement method and will not be further elaborated here.

[0085] In an exemplary embodiment, Figure 4 As shown, a workpiece parameter measurement device is provided, comprising: a space transformation module 401, a selection module 402, an inverse space transformation module 403 and a measurement module 404, wherein:

[0086] A spatial transformation module 401 is configured to perform spatial transformation on a plurality of spatial sampling points on a workpiece to be measured to obtain plane sampling points corresponding to each of the spatial sampling points, wherein the spatial sampling points and the plane sampling points are used to reflect the same workpiece parameter feature of the workpiece to be measured;

[0087] A selection module 402 is configured to select at least one plane measurement point from each of the plane sampling points according to the workpiece parameter characteristics;

[0088] An inverse spatial transformation module 403 is configured to perform an inverse spatial transformation on each of the planar measurement points to obtain a spatial measurement point corresponding to each of the planar measurement points;

[0089] The measurement module 404 is configured to perform parameter measurement on the workpiece to be measured based on the three-dimensional measurement data of each of the spatial measurement points.

[0090] In one embodiment, the space transformation module 401 is further configured to:

[0091] Based on the three-dimensional position data of each spatial sampling point, each spatial sampling point is projected and transformed to obtain projection position data of each spatial sampling point projected onto a first preset plane; based on each projection position data, each spatial sampling point is rotationally transformed from the first preset plane to a second preset plane, wherein the projection direction onto the first preset plane is perpendicular to the second preset plane; and a plane sampling point corresponding to each spatial sampling point is located on the second preset plane.

[0092] In one embodiment, the space transformation module 401 is further configured to:

[0093] Determine a projection transformation matrix commonly corresponding to each of the spatial sampling points based on the three-dimensional position data; determine a rotation transformation matrix commonly corresponding to each of the spatial sampling points based on the rotation axis and rotation angle between the first preset plane and the second preset plane; determine a mapping relationship matrix for mapping each of the spatial sampling points to the second preset plane based on the projection transformation matrix, the rotation transformation matrix, and the two-dimensional position data of each of the spatial sampling points in the second preset plane; and locate the planar sampling point corresponding to each of the spatial sampling points in the second preset plane based on the mapping relationship matrix.

[0094] In one embodiment, the workpiece parameter measuring device further includes a position transformation module; the position transformation module is used to determine the spacing extremes of each of the spatial sampling points in different directions of the second preset plane; based on each of the spacing extremes, a two-dimensional initial image corresponding to each of the spatial sampling points is generated on the second preset plane; based on the mapping relationship between each of the projection position data and the two-dimensional initial image, the two-dimensional position data of each of the spatial sampling points in the second preset plane is determined.

[0095] In one embodiment, the selection module 402 is further configured to:

[0096] A two-dimensional measurement image of the workpiece to be measured is generated based on the three-dimensional pixel data of each of the spatial sampling points and each of the planar sampling points, wherein one of the spatial sampling points corresponds to one of the planar sampling points based on the mapping relationship matrix; and at least one planar measurement point reflecting the parameter characteristics of the workpiece is extracted from the two-dimensional measurement image.

[0097] In one embodiment, each of the plane sampling points includes a first plane sampling point and a second preset plane sampling point; the selection module 402 is further configured to:

[0098] Based on the three-dimensional pixel data of each of the spatial sampling points, each of the spatial sampling points is screened to obtain at least one candidate spatial sampling point, where each candidate spatial sampling point corresponds to one of the first plane sampling points; the three-dimensional pixel data of each of the candidate spatial sampling points is normalized to obtain normalized pixel data corresponding to each of the candidate spatial sampling points; based on each of the normalized pixel data, the two-dimensional pixel data of each of the first plane sampling points is replaced to obtain at least one reconstructed plane sampling point; and the two-dimensional measurement image is generated based on each of the reconstructed plane sampling points and the second preset plane sampling points.

[0099] In one embodiment, the workpiece parameter measuring device further includes an adjustment module; the adjustment module is used to extract pixel update data from the three-dimensional position data of the abnormal spatial sampling point; and the abnormal spatial sampling point is adjusted to the spatial sampling point by replacing the three-dimensional pixel data of the abnormal spatial sampling point with the pixel update data.

[0100] Each module in the aforementioned workpiece parameter measurement device may be implemented in whole or in part through software, hardware, or a combination thereof. Each module may be embedded in or independent of a processor in a computer device in the form of hardware, or may be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.

[0101] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 5 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, it realizes a method for measuring workpiece parameters. Those skilled in the art can understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0102] In one embodiment, a computer device is further provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.

[0103] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0104] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0105] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), data processing logic devices based on quantum computing, and the like.

[0106] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0107] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A method for measuring workpiece parameters, characterized in that: The method comprises: Performing spatial transformation on a plurality of spatial sampling points on a workpiece to be measured to obtain plane sampling points corresponding to each of the spatial sampling points, wherein the spatial sampling points and the plane sampling points are used to reflect the same workpiece parameter feature of the workpiece to be measured; Selecting at least one plane measurement point from each of the plane sampling points according to the workpiece parameter characteristics; Performing an inverse spatial transformation on each of the planar measurement points to obtain a spatial measurement point corresponding to each of the planar measurement points; Performing parameter measurement on the workpiece to be measured based on the three-dimensional measurement data of each of the spatial measurement points, wherein performing spatial transformation on a plurality of spatial sampling points on the workpiece to be measured to obtain plane sampling points corresponding to each of the spatial sampling points includes: performing a projection transformation on each of the spatial sampling points according to the three-dimensional position data of each of the spatial sampling points to obtain projection position data of each of the spatial sampling points projected onto a first preset plane, wherein the first preset plane is determined according to the three-dimensional position data of each of the spatial sampling points and a preset three-dimensional plane equation; According to each projection position data, each of the spatial sampling points is rotated and transformed from the first preset plane to a second preset plane, wherein the projection direction onto the first preset plane is perpendicular to the second preset plane; Positioning the plane sampling points corresponding to each of the spatial sampling points on the second preset plane, wherein positioning the plane sampling points corresponding to each of the spatial sampling points on the second preset plane includes: Determining a projection transformation matrix corresponding to each of the spatial sampling points based on the three-dimensional position data; Determining a rotation transformation matrix corresponding to each of the spatial sampling points according to a rotation axis and a rotation angle between the first preset plane and the second preset plane; Determine a mapping relationship matrix for mapping each of the spatial sampling points to the second preset plane according to the projection transformation matrix, the rotation transformation matrix, and the two-dimensional position data of each of the spatial sampling points on the second preset plane; According to the mapping relationship matrix, the plane sampling points corresponding to each of the spatial sampling points are located on the second preset plane, wherein the two-dimensional position data of each of the spatial sampling points on the second preset plane are clustered in the two-dimensional initial image of the second preset plane.

2. The method according to claim 1, characterized in that Before the step of determining a mapping relationship matrix for mapping each of the spatial sampling points to the second preset plane based on the projection transformation matrix, the rotation transformation matrix, and the two-dimensional position data of each of the spatial sampling points on the second preset plane, the method further includes: Determining the extreme values ​​of spacing between the spatial sampling points in different directions of the second preset plane; Generating a two-dimensional initial image corresponding to each of the spatial sampling points on the second preset plane according to each of the extreme spacing values; The two-dimensional position data of each of the spatial sampling points on the second preset plane is determined according to a mapping relationship between each of the projection position data and the two-dimensional initial image.

3. The method according to claim 1, characterized in that The step of selecting at least one plane measurement point from each of the plane sampling points according to the workpiece parameter characteristics includes: generating a two-dimensional measurement image of the workpiece to be measured according to the three-dimensional pixel data of each of the spatial sampling points and each of the planar sampling points, wherein one of the spatial sampling points corresponds to one of the planar sampling points based on the mapping relationship matrix; At least one planar measurement point reflecting the parameter characteristics of the workpiece is extracted from the two-dimensional measurement image.

4. The method according to claim 3, characterized in that Each of the planar sampling points includes a first planar sampling point and a second preset planar sampling point; and generating a two-dimensional measurement image of the workpiece to be measured based on the three-dimensional pixel data of each of the spatial sampling points and each of the planar sampling points includes: screening each of the spatial sampling points according to the three-dimensional pixel data of each of the spatial sampling points to obtain at least one candidate spatial sampling point, where each candidate spatial sampling point corresponds to each of the first plane sampling points; Normalizing the three-dimensional pixel data of each candidate spatial sampling point to obtain normalized pixel data corresponding to each candidate spatial sampling point; replacing the two-dimensional pixel data of each of the first plane sampling points according to each of the normalized pixel data to obtain at least one reconstructed plane sampling point; The two-dimensional measurement image is generated according to each of the reconstructed plane sampling points and the second preset plane sampling points.

5. The method according to claim 1, wherein Before the step of performing spatial transformation on the plurality of spatial sampling points on the workpiece to be measured to obtain the plane sampling points corresponding to each of the spatial sampling points, the method further includes: Extracting pixel update data from the three-dimensional position data of the abnormal space sampling point; The abnormal spatial sampling point is adjusted to the spatial sampling point by replacing the three-dimensional pixel data of the abnormal spatial sampling point with the pixel update data.

6. A workpiece parameter measuring device, characterized in that: The device comprises: a spatial transformation module, configured to perform spatial transformation on a plurality of spatial sampling points on a workpiece to be measured to obtain plane sampling points corresponding to each of the spatial sampling points, wherein the spatial sampling points and the plane sampling points are used to reflect the same workpiece parameter feature of the workpiece to be measured; A selection module, configured to select at least one plane measurement point from each of the plane sampling points according to the workpiece parameter characteristics; an inverse spatial transformation module, configured to perform inverse spatial transformation on each of the planar measurement points to obtain a spatial measurement point corresponding to each of the planar measurement points; A measurement module is used to perform parameter measurement on the workpiece to be measured based on the three-dimensional measurement data of each of the spatial measurement points, wherein the spatial transformation module is further used to: According to the three-dimensional position data of each of the spatial sampling points, each of the spatial sampling points is projected and transformed to obtain projection position data of each of the spatial sampling points projected onto a first preset plane, wherein the first preset plane is determined according to the three-dimensional position data of each of the spatial sampling points and a preset three-dimensional plane equation; according to each of the projection position data, each of the spatial sampling points is rotationally transformed from the first preset plane to a second preset plane, wherein a projection direction onto the first preset plane is perpendicular to the second preset plane; and each corresponding plane sampling point of each of the spatial sampling points is located on the second preset plane, wherein the locating of each corresponding plane sampling point of each of the spatial sampling points on the second preset plane includes: Determining a projection transformation matrix corresponding to each of the spatial sampling points based on the three-dimensional position data; Determining a rotation transformation matrix corresponding to each of the spatial sampling points according to a rotation axis and a rotation angle between the first preset plane and the second preset plane; Determine a mapping relationship matrix for mapping each of the spatial sampling points to the second preset plane according to the projection transformation matrix, the rotation transformation matrix, and the two-dimensional position data of each of the spatial sampling points on the second preset plane; According to the mapping relationship matrix, the plane sampling points corresponding to each of the spatial sampling points are located on the second preset plane, wherein the two-dimensional position data of each of the spatial sampling points on the second preset plane are clustered in the two-dimensional initial image of the second preset plane.

7. The device according to claim 6, characterized in that The spatial transformation module is further used for: Determining a projection transformation matrix corresponding to each of the spatial sampling points based on the three-dimensional position data; determining a rotation transformation matrix corresponding to each of the spatial sampling points based on the rotation axis and rotation angle between the first preset plane and the second preset plane; and determining a mapping relationship matrix for each of the spatial sampling points to the second preset plane based on the projection transformation matrix, the rotation transformation matrix, and the two-dimensional position data of each of the spatial sampling points in the second preset plane. According to the mapping relationship matrix, the plane sampling points corresponding to each of the spatial sampling points are located on the second preset plane.

8. The device according to claim 6, characterized in that The workpiece parameter measuring device further includes a position conversion module; the position conversion module is used to: determining the extreme values ​​of spacing between the spatial sampling points in different directions of the second preset plane; and generating a two-dimensional initial image corresponding to each of the spatial sampling points on the second preset plane based on the extreme values ​​of spacing; The two-dimensional position data of each of the spatial sampling points on the second preset plane is determined according to a mapping relationship between each of the projection position data and the two-dimensional initial image.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Novel cylindrical three-dimensional reconstruction method and system

    CN112102474A

  • Hole site measurement method and device, computer equipment and storage medium

    CN115289974A