Three-dimensional curved surface model height measurement method, device, equipment, medium and program
By arranging position points on the reference plane and performing coordinate transformation, the surface mapping points on the three-dimensional surface model are determined, which solves the problem of accuracy and low efficiency of the height measurement of the three-dimensional surface model in the prior art, and achieves efficient and accurate height measurement.
Patent Information
- Application Number
- CN202510041607.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-10
- Publication Date
- 2025-05-23
AI Technical Summary
In the prior art, the height of each point on the surface of the three-dimensional curved surface model to the reference plane is obtained through manual marking measurement, which has low accuracy and efficiency, making it difficult to achieve accurate and efficient height measurement.
A three-dimensional surface model height measurement method is provided. By arranging the reference plane position points on the reference plane, obtaining its plane coordinates, and converting it into three-dimensional coordinates through the transformation matrix, determining the surface mapping point, and calculating its height to the reference plane.
Automatic measurement is realized, error problems in manual measurement are avoided, and measurement efficiency and accuracy are improved.
Smart Images

Figure CN120031950A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to a method, device, equipment, medium and program for measuring the height of a three-dimensional surface model. Background Art
[0002] With the development of process design technology, building a 3D surface model has become a generalized part of the process design process. In the process of building a 3D surface model, determining the height of each point on the surface of the 3D surface model to the reference plane is the key to ensuring product size and performance.
[0003] In the prior art, the height of each point on the surface of a three-dimensional surface model to a reference plane is often obtained by manual marking and measurement, which has low accuracy and efficiency. Therefore, how to accurately and efficiently measure the height of a three-dimensional surface model has become an urgent problem to be solved. Summary of the invention
[0004] Based on this, it is necessary to provide a three-dimensional surface model height measurement method, device, equipment, medium and program to address the above technical problems, so as to accurately and efficiently determine the height of the three-dimensional surface model to the reference plane.
[0005] In a first aspect, the present invention provides a method for measuring the height of a three-dimensional surface model, the method comprising: Arrange the reference plane position points on the reference plane according to the preset arrangement rules; Get the plane coordinates of all reference plane position points on the reference plane; According to the first transformation matrix, the plane coordinates of all reference surface position points are converted into three-dimensional coordinates in the three-dimensional space where the three-dimensional surface model is located; According to the three-dimensional coordinates of the reference surface position point, determining whether there is a surface mapping point corresponding to the reference surface position point on the surface of the three-dimensional surface model; For each surface mapping point, the height from the surface mapping point to the reference surface is calculated.
[0006] In one embodiment, obtaining the plane coordinates of all reference plane position points on the reference plane includes: taking the center point of all reference plane position points as the origin, initializing an X vector and a Y vector passing through the origin on the reference plane; the X vector and the Y vector are perpendicular to each other; constructing a reference plane coordinate system according to the origin, the X vector and the Y vector; and obtaining the plane coordinates of all reference plane position points in the reference plane coordinate system.
[0007] In one of the embodiments, determining whether there is a surface mapping point corresponding to the reference plane position point based on the three-dimensional coordinates of the reference plane position point includes: determining a direction vector of the reference plane based on the upper and lower positions of the surface of the three-dimensional surface model relative to the reference plane; using the three-dimensional coordinates of the reference plane position point as a starting point, and drawing a ray along a direction parallel to the direction vector; and determining whether there is a surface mapping point on the surface of the three-dimensional surface model corresponding to the reference plane position point based on whether the ray intersects with the surface of the three-dimensional surface model.
[0008] In one of the embodiments, whether a surface mapping point exists on the surface of the three-dimensional surface model at a corresponding reference plane position point is determined based on whether a ray intersects with the surface of the three-dimensional surface model, including: if the ray intersects with the surface of the three-dimensional surface model, determining that a surface mapping point exists on the surface of the three-dimensional surface model at the corresponding reference plane position point; otherwise, determining that no surface mapping point exists on the surface of the three-dimensional surface model at the corresponding reference plane position point.
[0009] In one of the embodiments, for each surface mapping point, the height from the surface mapping point to the reference plane is calculated, including: obtaining a surface equation of a three-dimensional surface model; converting a ray derived from a reference plane position point where the surface mapping point exists into a mapping vector in the three-dimensional surface model according to a second transformation matrix; solving the mapping vector and the surface equation group together to obtain the three-dimensional coordinates of the surface mapping point; and calculating the height from the surface mapping point to the reference plane according to the three-dimensional coordinates of the surface mapping point.
[0010] In one of the embodiments, the height from the surface mapping point to the reference plane is calculated based on the three-dimensional coordinates of the surface mapping point, including: calculating the distance from the surface mapping point to the corresponding reference position point based on the three-dimensional coordinates of the surface mapping point and the three-dimensional coordinates of the corresponding reference position point, and using the distance as the height from the surface mapping point to the reference plane.
[0011] In a second aspect, the present invention further provides a three-dimensional surface model height measurement device, comprising: An arrangement module, used for arranging reference plane position points on the reference plane according to a preset arrangement rule; A first acquisition module is used to acquire the plane coordinates of all reference plane position points on the reference plane; A conversion module, used for converting the plane coordinates of all reference surface position points into three-dimensional coordinates in the three-dimensional space where the three-dimensional surface model is located according to the first transformation matrix; A determination module, used to determine whether there is a surface mapping point on the surface of the three-dimensional surface model corresponding to the reference surface position point according to the three-dimensional coordinates of the reference surface position point; The calculation module is used to calculate the height from each surface mapping point to the reference plane.
[0012] In a third aspect, the present invention further provides a computer device, including 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: Arrange the reference plane position points on the reference plane according to the preset arrangement rules; Get the plane coordinates of all reference plane position points on the reference plane; According to the first transformation matrix, the plane coordinates of all reference surface position points are converted into three-dimensional coordinates in the three-dimensional space where the three-dimensional surface model is located; According to the three-dimensional coordinates of the reference surface position point, determining whether there is a surface mapping point corresponding to the reference surface position point on the surface of the three-dimensional surface model; For each surface mapping point, the height from the surface mapping point to the reference surface is calculated.
[0013] In a fourth aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the following steps are implemented: Arrange the reference plane position points on the reference plane according to the preset arrangement rules; Get the plane coordinates of all reference plane position points on the reference plane; According to the first transformation matrix, the plane coordinates of all reference surface position points are converted into three-dimensional coordinates in the three-dimensional space where the three-dimensional surface model is located; According to the three-dimensional coordinates of the reference surface position point, determining whether there is a surface mapping point corresponding to the reference surface position point on the surface of the three-dimensional surface model; For each surface mapping point, the height from the surface mapping point to the reference surface is calculated.
[0014] In a fifth aspect, the present invention further provides a computer program product, comprising a computer program, which implements the following steps when executed by a processor: Arrange the reference plane position points on the reference plane according to the preset arrangement rules; Get the plane coordinates of all reference plane position points on the reference plane; According to the first transformation matrix, the plane coordinates of all reference surface position points are converted into three-dimensional coordinates in the three-dimensional space where the three-dimensional surface model is located; According to the three-dimensional coordinates of the reference surface position point, determining whether there is a surface mapping point corresponding to the reference surface position point on the surface of the three-dimensional surface model; For each surface mapping point, the height from the surface mapping point to the reference surface is calculated.
[0015] The above-mentioned three-dimensional surface model height measurement method, device, equipment, medium and program arrange reference plane position points on the reference plane according to preset arrangement rules; obtain the plane coordinates of all reference plane position points on the reference plane; according to the first transformation matrix, convert the plane coordinates of all reference plane position points into three-dimensional coordinates in the three-dimensional space where the three-dimensional surface model is located; according to the three-dimensional coordinates of the reference plane position points, determine whether there is a surface mapping point on the surface of the three-dimensional surface model corresponding to the reference plane position point; for each surface mapping point, calculate and obtain the height from the surface mapping point to the reference plane, thereby replacing the manual measurement method with the automated measurement method, which can avoid the error problem in manual measurement and improve the efficiency and accuracy of measuring the height of the surface points of the three-dimensional surface model. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or related technologies, the drawings required for use in the embodiments of the present invention or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 The figure is a flow chart of a method for measuring the height of a three-dimensional surface model in one embodiment. DETAILED DESCRIPTION
[0018] The technical scheme in the embodiment of the present invention is described clearly and completely below in conjunction with the accompanying drawings in the embodiment of the present invention. In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention can also be implemented in other ways different from those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present invention, so the present invention is not limited by the specific embodiments disclosed below.
[0019] In an alternative embodiment, if Figure 1 As shown, a method for measuring the height of a three-dimensional surface model is provided. In this embodiment, the method includes the following steps: S110, arranging reference plane position points on the reference plane according to a preset arrangement rule.
[0020] The reference plane can be understood as a reference plane of a three-dimensional surface model. The preset arrangement rules can be set by technicians based on experience or actual needs, and are not limited here. For example, in the preset arrangement rules, the number of reference plane position points arranged on the reference plane and the spacing between adjacent reference plane position points can be set.
[0021] S120, obtaining the plane coordinates of all reference plane position points on the reference plane.
[0022] In an optional embodiment, the method for obtaining plane coordinates may include: taking the center point of all reference plane position points as the origin, initializing an X vector and a Y vector passing through the origin on the reference plane; constructing a reference plane coordinate system based on the origin, the X vector and the Y vector; and obtaining the plane coordinates of all reference plane position points in the reference plane coordinate system.
[0023] Optionally, the X vector and the Y vector may be initialized according to a preset direction, and the X vector and the Y vector may be in a mutually perpendicular positional relationship. The preset direction may be set by a technician according to experience or actual needs, and is not limited here.
[0024] S130: According to the first transformation matrix, convert the plane coordinates of all reference surface position points into three-dimensional coordinates in the three-dimensional space where the three-dimensional curved surface model is located.
[0025] The first transformation matrix may be understood as a transformation matrix used to transform the plane coordinates of the reference plane position point into three-dimensional coordinates.
[0026] For ease of understanding, the principle of the transformation matrix is first explained here. The transformation matrix can also be called a linear transformation matrix. The coordinate transformation of a point through the transformation matrix is actually to rotate, scale, and translate the position of the point. For example, as shown in formula (1): Transformation matrix, where M represents rotation and scaling, t represents translation, 0 represents a zero matrix, and 1 represents a scalar.
[0027] (1) In addition, before transforming through the transformation matrix, the coordinate system needs to be expanded to the homogeneous coordinate system, that is, a new parameter is added after the coordinate. As shown in formula (2), after the coordinates (X, Y, Z) of the three-dimensional point Vector are expanded to the homogeneous coordinate system, the parameter W can be introduced. When W is 1, Vector can represent a point in the four-dimensional coordinate system, and when W is 0, Vector can represent a three-dimensional vector.
[0028] (2) Optionally, as shown in formula (3), if you want to transform the three-dimensional point Move tx, ty and tz on the x-axis, y-axis and z-axis respectively. Expand to the homogeneous coordinate system, and then transform the three-dimensional point Multiply by the transformation matrix N.
[0029] (3) Optionally, three rotation transformation matrices representing rotations as shown in formula (4) can respectively realize the rotation transformation of coordinates around the X-axis, Y-axis and Z-axis. Among them, θ represents the rotation angle around the coordinate axis, Rx is the X-axis rotation transformation matrix, Ry is the Y-axis rotation transformation matrix, and Rz is the Z-axis rotation transformation matrix.
[0030] (4) Furthermore, when a composite transformation is required, a composite transformation matrix can be obtained by multiplying different transformation matrices. As shown in formula (5), M composite is a composite transformation matrix, M move is a movement transformation matrix, and M rotate is a rotation transformation matrix. The M composite obtained by multiplying M move and M rotate can realize a composite transformation of rotating the coordinate point first and then moving it.
[0031] In an optional embodiment, the process of converting the two-dimensional coordinates of a reference plane coordinate point P1 into a three-dimensional coordinate point P2 can be shown as formula (5). Wherein, P1x, P1y and P1z represent the X component coordinates, Y component coordinates and Z component coordinates of the reference plane coordinate point P1 respectively. However, since P1 is a two-dimensional coordinate point, P1z needs to be initialized to 0 first, and the parameter W (described above) is introduced and W is set to 1. P2x, P2y and P2z are the three-dimensional coordinate values after being transformed by the first transformation matrix M1.
[0032] (5) S140, determining whether there is a surface mapping point corresponding to the reference surface position point on the surface of the three-dimensional surface model according to the three-dimensional coordinates of the reference surface position point.
[0033] The surface mapping point can be understood as the mapping point of the reference plane position point on the surface of the three-dimensional surface model.
[0034] In an optional embodiment, the method for determining whether a surface mapping point exists may include the following steps: S141, determining a direction vector of the reference plane according to the upper and lower positions of the surface of the three-dimensional surface model relative to the reference plane.
[0035] It is understandable that the upper and lower positions of the surface of the three-dimensional surface model relative to the reference plane are uncertain, and it can be located above the reference plane or below the reference plane. In order to map the reference plane position point to the three-dimensional surface in the correct direction, the direction vector of the reference plane and the upper and lower positions of the surface of the three-dimensional surface model relative to the reference plane can be kept consistent. Exemplarily, if the surface of the three-dimensional surface model is located above the reference plane, the direction vector of the reference plane is determined to be a vector that is perpendicular to the reference plane and points upward; if the surface of the three-dimensional surface model is located below the reference plane, the direction vector of the reference plane is determined to be a vector that is perpendicular to the reference plane and points downward. It should be emphasized that for the surface of the same three-dimensional surface model, part of it can be located above the reference plane and part of it can be located below the reference plane. For this case, it is necessary to determine the reference plane direction vector corresponding to each part of the three-dimensional surface model surface according to the upper and lower positions of each part of the three-dimensional surface model surface relative to the reference plane.
[0036] S142, taking the three-dimensional coordinates of the reference surface position point as the starting point, draw a ray along a direction parallel to the direction vector.
[0037] The rays can be understood as mapping rays, through which the reference plane position points can be mapped onto the surface of the three-dimensional surface model.
[0038] S143, determining whether a surface mapping point exists on the surface of the three-dimensional surface model corresponding to the reference surface position point according to whether the ray has an intersection with the surface of the three-dimensional surface model.
[0039] It should be noted that when the range of the reference plane is larger than the range of the 3D surface model, some reference plane position points will be outside the range of the 3D surface model, that is, these reference plane position points cannot be mapped to the surface of the 3D surface model, and there will be no corresponding surface mapping points. By determining whether there are surface mapping points, the reference plane position points outside the range can be filtered, because these points have no practical significance for measuring the height of surface points.
[0040] Optionally, if the ray intersects the surface of the three-dimensional surface model, it is determined that a surface mapping point exists on the surface of the three-dimensional surface model for the corresponding reference plane position point; otherwise, it is determined that no surface mapping point exists on the surface of the three-dimensional surface model for the corresponding reference plane position point.
[0041] S150: For each surface mapping point, calculate and obtain the height from the surface mapping point to the reference surface.
[0042] It can be understood that the surface mapping point is located on the surface of the three-dimensional surface model, and calculating the height from the surface mapping point to the reference plane is actually calculating the height from the point on the surface of the three-dimensional surface model to the reference plane.
[0043] In an optional embodiment, the method for calculating the height from the curved surface mapping point to the reference surface may include the following steps: S151, obtaining a surface equation of a three-dimensional surface model.
[0044] The surface equation of the three-dimensional surface model can be understood as an equation representing the surface features of the three-dimensional surface model.
[0045] Optionally, the surface equation may be obtained according to the RayIntersections function. In the RayIntersections function, optional parameters may include the surface, the basic point of the ray (that is, the reference surface position point from which the ray is drawn), the direction vector, the intersection point parameter, the circular surface processing parameter, the penetration operation parameter, and the dynamic accuracy parameter.
[0046] S152, according to the second transformation matrix, converting the ray derived from the reference plane position point where the surface mapping point exists into a mapping vector in the three-dimensional space where the three-dimensional surface model is located.
[0047] The second transformation matrix can be understood as a transformation matrix used to transform rays into mapping vectors. Optionally, the second transformation matrix and the first transformation matrix can use the same transformation matrix.
[0048] It can be understood that the reference plane position point has been transformed by the first transformation matrix, and the ray itself is only used to determine whether the reference plane position point has a surface mapping point on the surface of the three-dimensional surface model. After determining that it exists, the ray needs to be converted into a mapping vector in the three-dimensional space where the three-dimensional surface model is located before the three-dimensional coordinates of the surface mapping point can be further calculated.
[0049] As shown in formula (6), the mapping vector Vf2 can be obtained by multiplying the vector representation Vf1 of the ray and the second transformation matrix M2.
[0050] (6) S153, solving the mapping vector and the surface equation group simultaneously to obtain the three-dimensional coordinates of the surface mapping point.
[0051] S154, calculating and obtaining the height from the surface mapping point to the reference plane according to the three-dimensional coordinates of the surface mapping point.
[0052] Optionally, the distance from the surface mapping point to the corresponding reference position point may be calculated based on the three-dimensional coordinates of the surface mapping point and the three-dimensional coordinates of the corresponding reference position point, and the distance may be used as the height from the surface mapping point to the reference surface.
[0053] Exemplarily, as shown in formula (7), S is the height from the surface mapping point to the reference plane, P3x, P3y and P3z respectively represent the three-dimensional component coordinates of the surface mapping point, and P4x, P4y and P4z respectively represent the three-dimensional component coordinates of the reference plane position point.
[0054] (7) In this embodiment, according to a preset arrangement rule, the reference plane position points are arranged on the reference plane; the plane coordinates of all the reference plane position points on the reference plane are obtained; according to a first transformation matrix, the plane coordinates of all the reference plane position points are converted into three-dimensional coordinates in the three-dimensional space where the three-dimensional surface model is located; according to the three-dimensional coordinates of the reference plane position points, it is determined whether there is a surface mapping point corresponding to the reference plane position point on the surface of the three-dimensional surface model; for each surface mapping point, the height from the surface mapping point to the reference plane is calculated, thereby replacing the manual measurement method with the automated measurement method, which can avoid the error problem in manual measurement and improve the efficiency and accuracy of measuring the height of the surface points of the three-dimensional surface model.
[0055] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0056] The technical features of the above embodiments may be arbitrarily combined. 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 the present invention.
[0057] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the present invention. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the attached claims.
Claims
1. A method for measuring the height of a three-dimensional surface model, characterized in that: The method comprises: Arrange the reference plane position points on the reference plane according to the preset arrangement rules; Get the plane coordinates of all reference plane position points on the reference plane; According to the first transformation matrix, the plane coordinates of all reference surface position points are converted into three-dimensional coordinates in the three-dimensional space where the three-dimensional surface model is located; According to the three-dimensional coordinates of the reference surface position point, determining whether there is a surface mapping point corresponding to the reference surface position point on the surface of the three-dimensional surface model; For each surface mapping point, the height from the surface mapping point to the reference surface is calculated.
2. The method according to claim 1, characterized in that The step of obtaining the plane coordinates of all reference plane position points on the reference plane includes: Taking the center point of all reference plane position points as the origin, initializing an X vector and a Y vector passing through the origin on the reference plane; the X vector and the Y vector are perpendicular to each other; constructing a reference plane coordinate system according to the origin, the X vector and the Y vector; Get the plane coordinates of all reference plane position points in the reference plane coordinate system.
3. The method according to claim 1, characterized in that The step of determining whether there is a surface mapping point corresponding to the reference surface position point according to the three-dimensional coordinates of the reference surface position point comprises: According to the upper and lower positions of the surface of the three-dimensional surface model relative to the reference plane, the direction vector of the reference plane is determined; Take the three-dimensional coordinates of the reference surface position point as the starting point and draw a ray along the direction parallel to the direction vector; According to whether the ray has an intersection with the surface of the three-dimensional surface model, it is determined whether a surface mapping point exists on the surface of the three-dimensional surface model at the corresponding reference surface position point.
4. The method according to claim 3, characterized in that The determining whether a corresponding reference surface position point has a surface mapping point on the surface of the three-dimensional surface model according to whether the ray has an intersection with the surface of the three-dimensional surface model comprises: If the ray intersects the surface of the three-dimensional surface model, it is determined that the corresponding reference surface position point has a surface mapping point on the surface of the three-dimensional surface model; otherwise, it is determined that the corresponding reference surface position point does not have a surface mapping point on the surface of the three-dimensional surface model.
5. The method according to claim 3, characterized in that: The step of calculating, for each surface mapping point, the height from the surface mapping point to the reference surface comprises: Obtaining the surface equation of the three-dimensional surface model; According to the second transformation matrix, the ray derived from the reference surface position point where the surface mapping point exists is converted into a mapping vector in the three-dimensional space where the three-dimensional surface model is located; Solve the mapping vector and surface equations together to obtain the three-dimensional coordinates of the surface mapping points; According to the three-dimensional coordinates of the surface mapping point, the height from the surface mapping point to the reference surface is calculated.
6. The method according to claim 1, characterized in that The step of calculating the height from the surface mapping point to the reference surface according to the three-dimensional coordinates of the surface mapping point comprises: According to the three-dimensional coordinates of the surface mapping point and the three-dimensional coordinates of the corresponding reference position point, the distance from the surface mapping point to the corresponding reference position point is calculated, and the distance is used as the height from the surface mapping point to the reference surface.
7. A three-dimensional surface model height measurement device, characterized in that: The device comprises: An arrangement module, used for arranging reference plane position points on the reference plane according to a preset arrangement rule; A first acquisition module is used to acquire the plane coordinates of all reference plane position points on the reference plane; A conversion module, used for converting the plane coordinates of all reference surface position points into three-dimensional coordinates in the three-dimensional space where the three-dimensional surface model is located according to the first transformation matrix; A determination module, used to determine whether there is a surface mapping point on the surface of the three-dimensional surface model corresponding to the reference surface position point according to the three-dimensional coordinates of the reference surface position point; The calculation module is used to calculate the height from each surface mapping point to the reference plane.
8. 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 6 are implemented.
9. 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 6 are implemented.
10. A computer program product, comprising a computer program, 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 6 are implemented.